[PATCH] D127393: [Driver] Don't add -lresolv on FreeBSD

2022-06-11 Thread Brad Smith via Phabricator via cfe-commits
brad added a comment.

I was just looking at the same diff for OpenBSD.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127393/new/

https://reviews.llvm.org/D127393

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D107082: [X86][RFC] Enable `_Float16` type support on X86 following the psABI

2022-06-11 Thread Phoebe Wang via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2d2da259c872: [X86][RFC] Enable `_Float16` type support on 
X86 following the psABI (authored by pengfei).

Changed prior to commit:
  https://reviews.llvm.org/D107082?vs=435583=436190#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107082/new/

https://reviews.llvm.org/D107082

Files:
  llvm/docs/ReleaseNotes.rst
  llvm/lib/Target/X86/X86FastISel.cpp
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Target/X86/X86ISelLowering.h
  llvm/lib/Target/X86/X86InstrAVX512.td
  llvm/lib/Target/X86/X86InstrCompiler.td
  llvm/lib/Target/X86/X86InstrInfo.cpp
  llvm/lib/Target/X86/X86InstrSSE.td
  llvm/lib/Target/X86/X86InstrVecCompiler.td
  llvm/lib/Target/X86/X86InstructionSelector.cpp
  llvm/lib/Target/X86/X86RegisterInfo.td
  llvm/test/Analysis/CostModel/X86/fptoi_sat.ll
  llvm/test/CodeGen/MIR/X86/inline-asm-registers.mir
  llvm/test/CodeGen/X86/atomic-non-integer.ll
  llvm/test/CodeGen/X86/avx512-insert-extract.ll
  llvm/test/CodeGen/X86/avx512-masked_memop-16-8.ll
  llvm/test/CodeGen/X86/avx512fp16-fp-logic.ll
  llvm/test/CodeGen/X86/callbr-asm-bb-exports.ll
  llvm/test/CodeGen/X86/cvt16-2.ll
  llvm/test/CodeGen/X86/cvt16.ll
  llvm/test/CodeGen/X86/fastmath-float-half-conversion.ll
  llvm/test/CodeGen/X86/fmf-flags.ll
  llvm/test/CodeGen/X86/fp-round.ll
  llvm/test/CodeGen/X86/fp-roundeven.ll
  llvm/test/CodeGen/X86/fp128-cast-strict.ll
  llvm/test/CodeGen/X86/fpclamptosat.ll
  llvm/test/CodeGen/X86/fpclamptosat_vec.ll
  llvm/test/CodeGen/X86/fptosi-sat-scalar.ll
  llvm/test/CodeGen/X86/fptosi-sat-vector-128.ll
  llvm/test/CodeGen/X86/fptoui-sat-scalar.ll
  llvm/test/CodeGen/X86/fptoui-sat-vector-128.ll
  llvm/test/CodeGen/X86/freeze.ll
  llvm/test/CodeGen/X86/frem.ll
  llvm/test/CodeGen/X86/half-constrained.ll
  llvm/test/CodeGen/X86/half.ll
  llvm/test/CodeGen/X86/pr31088.ll
  llvm/test/CodeGen/X86/pr38533.ll
  llvm/test/CodeGen/X86/pr47000.ll
  llvm/test/CodeGen/X86/scheduler-asm-moves.mir
  llvm/test/CodeGen/X86/shuffle-extract-subvector.ll
  llvm/test/CodeGen/X86/stack-folding-fp-avx512fp16-fma.ll
  llvm/test/CodeGen/X86/stack-folding-fp-avx512fp16.ll
  llvm/test/CodeGen/X86/statepoint-invoke-ra-enter-at-end.mir
  llvm/test/CodeGen/X86/vec_fp_to_int.ll
  llvm/test/CodeGen/X86/vector-half-conversions.ll
  llvm/test/CodeGen/X86/vector-reduce-fmax-nnan.ll
  llvm/test/CodeGen/X86/vector-reduce-fmin-nnan.ll
  llvm/test/MC/X86/x86_64-asm-match.s

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 140ad7d - [Clang][VE][NFC] Fix a comment

2022-06-11 Thread Kazushi Marukawa via cfe-commits

Author: Kazushi (Jam) Marukawa
Date: 2022-06-12T10:27:30+09:00
New Revision: 140ad7d37813e525a202f38ceac64d7e12b38930

URL: 
https://github.com/llvm/llvm-project/commit/140ad7d37813e525a202f38ceac64d7e12b38930
DIFF: 
https://github.com/llvm/llvm-project/commit/140ad7d37813e525a202f38ceac64d7e12b38930.diff

LOG: [Clang][VE][NFC] Fix a comment

Added: 


Modified: 
clang/lib/Driver/ToolChains/Arch/VE.h

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/Arch/VE.h 
b/clang/lib/Driver/ToolChains/Arch/VE.h
index 531433534914c..c47a41df25bc4 100644
--- a/clang/lib/Driver/ToolChains/Arch/VE.h
+++ b/clang/lib/Driver/ToolChains/Arch/VE.h
@@ -24,7 +24,7 @@ void getVETargetFeatures(const Driver , const 
llvm::opt::ArgList ,
  std::vector );
 
 } // end namespace ve
-} // namespace tools
+} // end namespace tools
 } // end namespace driver
 } // end namespace clang
 



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 5f57ca2 - fix comment typo to cycle bots

2022-06-11 Thread Nico Weber via cfe-commits

Author: Nico Weber
Date: 2022-06-11T18:55:40-04:00
New Revision: 5f57ca208b41ea6f70089ab9c5104b6f8ecc13f4

URL: 
https://github.com/llvm/llvm-project/commit/5f57ca208b41ea6f70089ab9c5104b6f8ecc13f4
DIFF: 
https://github.com/llvm/llvm-project/commit/5f57ca208b41ea6f70089ab9c5104b6f8ecc13f4.diff

LOG: fix comment typo to cycle bots

Added: 


Modified: 
clang/lib/Lex/HeaderSearch.cpp

Removed: 




diff  --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index 5fd853541b6a2..0b9727cc7cd30 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -1973,7 +1973,7 @@ std::string HeaderSearch::suggestPathToFileForDiagnostics(
   }
 
   // Try resolving resulting filename via reverse search in header maps,
-  // key from header name is user prefered name for the include file.
+  // key from header name is user preferred name for the include file.
   StringRef Filename = File.drop_front(BestPrefixLength);
   for (const DirectoryLookup  : search_dir_range()) {
 if (!DL.isHeaderMap())



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123493: Support the min of module flags when linking, use for AArch64 BTI/PAC-RET

2022-06-11 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss added a comment.

In D123493#3569025 , @MaskRay wrote:

> This behavior requires that all participating modules have the module flag. 
> In the absence of the module flag, what should be behavior be?
>
> For module flags like `"sign-return-address"`, I see that you just emit the 
> flag unconditionally (which can be zero).

Absence of the `"branch-target-enforcement" and `"sign-return-address"` means 
features are off. So the flag merger will take an existing flag and the feature 
could be turned on, which is bad.
AutoUpdater should insert the attributes with zero value if they are missing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123493/new/

https://reviews.llvm.org/D123493

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127579: [clang][WIP] add option to keep types of ptr args for non-kernel functions in metadata

2022-06-11 Thread Ilia Diachkov via Phabricator via cfe-commits
iliya-diyachkov created this revision.
iliya-diyachkov added reviewers: Anastasia, bader, svenvh.
Herald added a subscriber: Naghasan.
Herald added a project: All.
iliya-diyachkov requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang.

It's a draft for the patch we discussed in the thread of opaque pointer support 
in the SPIR-V translator 
. The final 
decision on whether we will use this approach has not yet been made, so the 
patch is uploaded for convenience and concertizing of the discussion.

The types are already in metadata for kernel functions by default. Alexey Bader 
shared the code example  with non-kernel 
functions which lost the info. The patch fixes this case. To enable the feature 
you need to pass `-cl-extra-ptr-info` to clang.

TODO:

- emit only ptr type info metadata if EmitOpenCLExtraPtrInfo is enabled,
- maybe add the same info to function declarations,
- maybe add the same options to other languages (SYCL, HLSL ...) or make one 
common option for all languages.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127579

Files:
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/Options.td
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/Driver/ToolChains/Clang.cpp


Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -3447,6 +3447,7 @@
   options::OPT_cl_single_precision_constant,
   options::OPT_cl_finite_math_only,
   options::OPT_cl_kernel_arg_info,
+  options::OPT_cl_extra_ptr_info,
   options::OPT_cl_unsafe_math_optimizations,
   options::OPT_cl_fast_relaxed_math,
   options::OPT_cl_mad_enable,
Index: clang/lib/CodeGen/CodeGenFunction.cpp
===
--- clang/lib/CodeGen/CodeGenFunction.cpp
+++ clang/lib/CodeGen/CodeGenFunction.cpp
@@ -600,8 +600,11 @@
 void CodeGenFunction::EmitOpenCLKernelMetadata(const FunctionDecl *FD,
llvm::Function *Fn)
 {
-  if (!FD->hasAttr())
+  if (!FD->hasAttr()) {
+if (CGM.getCodeGenOpts().EmitOpenCLExtraPtrInfo)
+  CGM.GenOpenCLArgMetadata(Fn, FD, this);
 return;
+  }
 
   llvm::LLVMContext  = getLLVMContext();
 
Index: clang/include/clang/Driver/Options.td
===
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -896,6 +896,9 @@
   HelpText<"OpenCL only. Enable or disable OpenCL extensions/optional 
features. The argument is a comma-separated "
"sequence of one or more extension names, each prefixed by '+' or 
'-'.">,
   MarshallingInfoStringVector>;
+def cl_extra_ptr_info : Flag<["-"], "cl-extra-ptr-info">, Group, 
Flags<[CC1Option]>,
+  HelpText<"OpenCL only. Generate type hints for pointers.">,
+  MarshallingInfoFlag>;
 
 def client__name : JoinedOrSeparate<["-"], "client_name">;
 def combine : Flag<["-", "--"], "combine">, Flags<[NoXarchOption, 
Unsupported]>;
Index: clang/include/clang/Basic/CodeGenOptions.def
===
--- clang/include/clang/Basic/CodeGenOptions.def
+++ clang/include/clang/Basic/CodeGenOptions.def
@@ -87,6 +87,7 @@
 CODEGENOPT(EmitGcovArcs  , 1, 0) ///< Emit coverage data files, aka. GCDA.
 CODEGENOPT(EmitGcovNotes , 1, 0) ///< Emit coverage "notes" files, aka 
GCNO.
 CODEGENOPT(EmitOpenCLArgMetadata , 1, 0) ///< Emit OpenCL kernel arg metadata.
+CODEGENOPT(EmitOpenCLExtraPtrInfo , 1, 0) ///< Emit OpenCL extra pointer info.
 CODEGENOPT(EmulatedTLS   , 1, 0) ///< Set by default or 
-f[no-]emulated-tls.
 CODEGENOPT(ExplicitEmulatedTLS , 1, 0) ///< Set if -f[no-]emulated-tls is used.
 /// Embed Bitcode mode (off/all/bitcode/marker).


Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -3447,6 +3447,7 @@
   options::OPT_cl_single_precision_constant,
   options::OPT_cl_finite_math_only,
   options::OPT_cl_kernel_arg_info,
+  options::OPT_cl_extra_ptr_info,
   options::OPT_cl_unsafe_math_optimizations,
   options::OPT_cl_fast_relaxed_math,
   options::OPT_cl_mad_enable,
Index: clang/lib/CodeGen/CodeGenFunction.cpp
===
--- clang/lib/CodeGen/CodeGenFunction.cpp
+++ clang/lib/CodeGen/CodeGenFunction.cpp
@@ -600,8 +600,11 @@
 void CodeGenFunction::EmitOpenCLKernelMetadata(const FunctionDecl *FD,
llvm::Function *Fn)
 {
-  if (!FD->hasAttr())
+  if (!FD->hasAttr()) {
+if 

[PATCH] D127390: [clang-format][NFC] Remove unused FormatStyle members

2022-06-11 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment.

See D127578 .


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127390/new/

https://reviews.llvm.org/D127390

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127578: [clang-format] Handle deprecated options in dump_format_style.py

2022-06-11 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision.
owenpan added reviewers: MyDeveloperDay, curdeius, HazardyKnusperkeks.
owenpan added a project: clang-format.
Herald added a project: All.
owenpan requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Also add two deprecated options as comments back to Format.h.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127578

Files:
  clang/docs/tools/dump_format_style.py
  clang/include/clang/Format/Format.h


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -395,6 +395,11 @@
   /// \version 9
   bool AllowAllArgumentsOnNextLine;
 
+  /// This option is **deprecated**. See ``NextLine`` of
+  /// ``PackConstructorInitializers``.
+  /// \version 9
+  // bool AllowAllConstructorInitializersOnNextLine;
+
   /// If the function declaration doesn't fit on a line,
   /// allow putting all parameters of a function declaration onto
   /// the next line even if ``BinPackParameters`` is ``false``.
@@ -1878,6 +1883,11 @@
   /// \version 5
   bool CompactNamespaces;
 
+  /// This option is **deprecated**. See ``CurrentLine`` of
+  /// ``PackConstructorInitializers``.
+  /// \version 3.7
+  // bool ConstructorInitializerAllOnOneLineOrOnePerLine;
+
   /// The number of characters to use for indentation of constructor
   /// initializer lists as well as inheritance lists.
   /// \version 3.7
Index: clang/docs/tools/dump_format_style.py
===
--- clang/docs/tools/dump_format_style.py
+++ clang/docs/tools/dump_format_style.py
@@ -267,6 +267,9 @@
   name = re.sub(r'struct\s+(\w+)\s*\{', '\\1', line)
   nested_struct = NestedStruct(name, comment)
 elif line.endswith(';'):
+  prefix = '// '
+  if line.startswith(prefix):
+line = line[len(prefix):]
   state = State.InStruct
   field_type, field_name = re.match(r'([<>:\w(,\s)]+)\s+(\w+);',
 line).groups()


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -395,6 +395,11 @@
   /// \version 9
   bool AllowAllArgumentsOnNextLine;
 
+  /// This option is **deprecated**. See ``NextLine`` of
+  /// ``PackConstructorInitializers``.
+  /// \version 9
+  // bool AllowAllConstructorInitializersOnNextLine;
+
   /// If the function declaration doesn't fit on a line,
   /// allow putting all parameters of a function declaration onto
   /// the next line even if ``BinPackParameters`` is ``false``.
@@ -1878,6 +1883,11 @@
   /// \version 5
   bool CompactNamespaces;
 
+  /// This option is **deprecated**. See ``CurrentLine`` of
+  /// ``PackConstructorInitializers``.
+  /// \version 3.7
+  // bool ConstructorInitializerAllOnOneLineOrOnePerLine;
+
   /// The number of characters to use for indentation of constructor
   /// initializer lists as well as inheritance lists.
   /// \version 3.7
Index: clang/docs/tools/dump_format_style.py
===
--- clang/docs/tools/dump_format_style.py
+++ clang/docs/tools/dump_format_style.py
@@ -267,6 +267,9 @@
   name = re.sub(r'struct\s+(\w+)\s*\{', '\\1', line)
   nested_struct = NestedStruct(name, comment)
 elif line.endswith(';'):
+  prefix = '// '
+  if line.startswith(prefix):
+line = line[len(prefix):]
   state = State.InStruct
   field_type, field_name = re.match(r'([<>:\w(,\s)]+)\s+(\w+);',
 line).groups()
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D125936: [Sema] Relax an assertion in BuildStmtExpr

2022-06-11 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment.

The cleanups arise from expressions in the constraints, right?  There are a 
number of places where `ExprWithCleanups` does not mean the cleanups are 
independently nested within that expression; it's notably not how it works ever 
for something as basic as a variable initializer.  If we want the lifetime of 
temporaries in asm operands to include the full duration of the asm statement, 
I think we can just declare by fiat that that's how it works for `AsmStmt` 
instead of unnaturally wrapping things this way.

Or do we have a problem where the semantics are different for different kinds 
of asm statements?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125936/new/

https://reviews.llvm.org/D125936

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127545: Remove Itanium EH ABI workaround to allow modifying a pointer caught by-reference.

2022-06-11 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment.

Should we just diagnose this and report an error that catching pointers by 
non-const reference is unsupported on Itanium?  We don't support it properly 
for class pointers anyway.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127545/new/

https://reviews.llvm.org/D127545

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127390: [clang-format][NFC] Remove unused FormatStyle members

2022-06-11 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment.

In D127390#3575628 , @MyDeveloperDay 
wrote:

> If we remove it from here, then it will get removed from  the documentation
>
> F23403281: image.png 
>
> Also if you remove it, then the ClangFormatStyleOptions.rst needs to be 
> regenerated.

Good catch! I will regenerate it.

> But somehow I think we need that comment no? incase someone is looking up 
> their legacy options when migrating?

IIRC there were other deprecated options that were removed from Format.h. These 
two options were old enough and IMO we left them in Format.h long enough. 
Nevertheless, I will see if we can add the comments back without keeping the 
`FormatStyle` members.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127390/new/

https://reviews.llvm.org/D127390

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] 11f75e0 - [clang-tidy][docs] Remove an unintentional paragraph break

2022-06-11 Thread Dmitri Gribenko via cfe-commits

Author: Dmitri Gribenko
Date: 2022-06-11T21:03:43+02:00
New Revision: 11f75e0a2dfa1455eee097dfa72686d8a4dc7802

URL: 
https://github.com/llvm/llvm-project/commit/11f75e0a2dfa1455eee097dfa72686d8a4dc7802
DIFF: 
https://github.com/llvm/llvm-project/commit/11f75e0a2dfa1455eee097dfa72686d8a4dc7802.diff

LOG: [clang-tidy][docs] Remove an unintentional paragraph break

Added: 


Modified: 

clang-tools-extra/docs/clang-tidy/checks/bugprone-unchecked-optional-access.rst

Removed: 




diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/bugprone-unchecked-optional-access.rst
 
b/clang-tools-extra/docs/clang-tidy/checks/bugprone-unchecked-optional-access.rst
index 5d8b76aec771..3ed6372840a8 100644
--- 
a/clang-tools-extra/docs/clang-tidy/checks/bugprone-unchecked-optional-access.rst
+++ 
b/clang-tools-extra/docs/clang-tidy/checks/bugprone-unchecked-optional-access.rst
@@ -4,8 +4,8 @@ bugprone-unchecked-optional-access
 ==
 
 *Note*: This check uses a flow-sensitive static analysis to produce its
- results. Therefore, it may be more resource intensive (RAM, CPU) than the
- average clang-tidy check.
+results. Therefore, it may be more resource intensive (RAM, CPU) than the
+average clang-tidy check.
 
 This check identifies unsafe accesses to values contained in
 ``std::optional``, ``absl::optional``, or ``base::Optional``



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] 65299c9 - [clang-tidy][docs] Use std::optional instead of absl::optional in examples

2022-06-11 Thread Dmitri Gribenko via cfe-commits

Author: Dmitri Gribenko
Date: 2022-06-11T21:03:43+02:00
New Revision: 65299c9c652f3ce4958011ffe28119d0eff0f38d

URL: 
https://github.com/llvm/llvm-project/commit/65299c9c652f3ce4958011ffe28119d0eff0f38d
DIFF: 
https://github.com/llvm/llvm-project/commit/65299c9c652f3ce4958011ffe28119d0eff0f38d.diff

LOG: [clang-tidy][docs] Use std::optional instead of absl::optional in examples

The standard type is vastly more popular than the Abseil polyfill, so it
makes more sense to use it in documentation, even though the checker
actually understands both (and that fact is documented already).

Added: 


Modified: 

clang-tools-extra/docs/clang-tidy/checks/bugprone-unchecked-optional-access.rst

Removed: 




diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/bugprone-unchecked-optional-access.rst
 
b/clang-tools-extra/docs/clang-tidy/checks/bugprone-unchecked-optional-access.rst
index 9c53c8a6d175f..5d8b76aec771d 100644
--- 
a/clang-tools-extra/docs/clang-tidy/checks/bugprone-unchecked-optional-access.rst
+++ 
b/clang-tools-extra/docs/clang-tidy/checks/bugprone-unchecked-optional-access.rst
@@ -42,7 +42,7 @@ existence check:
 
 .. code-block:: c++
 
-   void f(absl::optional opt) {
+   void f(std::optional opt) {
  use(*opt); // unsafe: it is unclear whether `opt` has a value.
}
 
@@ -54,7 +54,7 @@ branches of the code. For example:
 
 .. code-block:: c++
 
-   void f(absl::optional opt) {
+   void f(std::optional opt) {
  if (opt.has_value()) {
  } else {
use(opt.value()); // unsafe: it is clear that `opt` does *not* have a 
value.
@@ -99,11 +99,11 @@ optional has a value. For example:
 
 .. code-block:: c++
 
-   void g(absl::optional opt) {
+   void g(std::optional opt) {
  use(*opt); // unsafe: it is unclear whether `opt` has a value.
}
 
-   void f(absl::optional opt) {
+   void f(std::optional opt) {
  if (opt.has_value()) {
g(opt);
  }
@@ -121,7 +121,7 @@ example:
 
 .. code-block:: c++
 
-   void f(absl::optional opt) {
+   void f(std::optional opt) {
  if (opt.has_value()) {
use(*opt);
  }
@@ -137,9 +137,9 @@ have a value. For example:
 
 .. code-block:: c++
 
-   void f(absl::optional opt1) {
+   void f(std::optional opt1) {
  if (opt1.has_value()) {
-   absl::optional opt2 = opt1;
+   std::optional opt2 = opt1;
use(*opt2);
  }
}
@@ -154,7 +154,7 @@ a value. For example:
 
 .. code-block:: c++
 
-   void f(absl::optional opt) {
+   void f(std::optional opt) {
  DCHECK(opt.has_value());
  use(*opt);
}
@@ -168,7 +168,7 @@ paths that lead to an access. For example:
 
 .. code-block:: c++
 
-   void f(absl::optional opt) {
+   void f(std::optional opt) {
  bool safe = false;
  if (opt.has_value() && SomeOtherCondition()) {
safe = true;
@@ -223,7 +223,7 @@ check the optional again in the local scope of the callee. 
For example:
  use(val);
}
 
-   void f(absl::optional opt) {
+   void f(std::optional opt) {
  if (opt.has_value()) {
g(*opt);
  }
@@ -234,7 +234,7 @@ and
 .. code-block:: c++
 
struct S {
- absl::optional opt;
+ std::optional opt;
  int x;
};
 
@@ -260,7 +260,7 @@ The check is aware of aliases of optional types that are 
created via
 
 .. code-block:: c++
 
-   using OptionalInt = absl::optional;
+   using OptionalInt = std::optional;
 
void f(OptionalInt opt) {
  use(opt.value()); // unsafe: it is unclear whether `opt` has a value.



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127351: clang: fix early substitution of alias templates

2022-06-11 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments.



Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:1872
   QualType Result = getSema().Context.getTemplateTypeParmType(
-  T->getDepth() - TemplateArgs.getNumSubstitutedLevels(), T->getIndex(),
-  T->isParameterPack(), NewTTPDecl);
+  getNewDepth(T->getDepth()), T->getIndex(), T->isParameterPack(),
+  NewTTPDecl);

mizvekov wrote:
> mizvekov wrote:
> > rsmith wrote:
> > > mizvekov wrote:
> > > > mark
> > > Instead of adding the new `EarlySubstitution` flag and wiring it through 
> > > everywhere, can you use the existing 
> > > `MultiLevelTemplateArgumentList::getNewDepth` function? That already 
> > > handles the case of a depth that's within the number of retained outer 
> > > levels. We might need to set the number of retained outer levels properly 
> > > when doing alias template substitution; I'm not sure if we do so 
> > > currently and I suspect we don't.
> > I think we do set the number of outer levels correctly when substituting 
> > within the type of alias templates, circa SemaTemplate.cpp:3718:
> > ```
> > // Only substitute for the innermost template argument list.
> > MultiLevelTemplateArgumentList TemplateArgLists;
> > TemplateArgLists.addOuterTemplateArguments();
> > TemplateArgLists.addOuterRetainedLevels(
> > AliasTemplate->getTemplateParameters()->getDepth());
> > ```
> > 
> > What the flag was done to deal with is what happens in 
> > `TemplateDeclInstantiator::VisitTypeAliasTemplateDecl`, when replacing just 
> > the inner level. We need to substitute there without changing any depths, 
> > including the template parameters of the alias itself, and I could not find 
> > a way to do that without extending it with the new flag.
> > 
> > Anyway, I will think about this again.
> > I ended up finding another test case which this patch only partially helps, 
> > so I have been back investigating this problem again: 
> > https://godbolt.org/z/9fGb1KKvq
> > ```
> > template  struct Y;
> > template  using Z = Y;
> > template  struct foo {
> >   template  using bind = Z;
> > };
> > using U = foo::bind;
> > ```
> Though that last test case seems actually to be a wrong index problem, not 
> wrong depth.
That last new test case hits an unrelated problem besides this one, so I will 
deal with it in a separate patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127351/new/

https://reviews.llvm.org/D127351

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127351: clang: fix early substitution of alias templates

2022-06-11 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 436155.
mizvekov added a comment.

- much smaller patch, puts the new flag as a mutable member of 
MultiLevelTemplateArgumentList


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127351/new/

https://reviews.llvm.org/D127351

Files:
  clang/include/clang/Sema/Template.h
  clang/lib/Sema/SemaTemplateInstantiate.cpp
  clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
  clang/test/AST/ast-dump-template-decls.cpp

Index: clang/test/AST/ast-dump-template-decls.cpp
===
--- clang/test/AST/ast-dump-template-decls.cpp
+++ clang/test/AST/ast-dump-template-decls.cpp
@@ -121,7 +121,7 @@
 // CHECK-NEXT: BuiltinType 0x{{[^ ]*}} 'void'
 // CHECK-NEXT: FunctionProtoType 0x{{[^ ]*}} 'void (int)' cdecl
 // CHECK-NEXT: SubstTemplateTypeParmType 0x{{[^ ]*}} 'void' sugar
-// CHECK-NEXT: TemplateTypeParmType 0x{{[^ ]*}} 'U' dependent depth 0 index 0
+// CHECK-NEXT: TemplateTypeParmType 0x{{[^ ]*}} 'U' dependent depth 1 index 0
 // CHECK-NEXT: TemplateTypeParm 0x{{[^ ]*}} 'U'
 // CHECK-NEXT: BuiltinType 0x{{[^ ]*}} 'void'
 // CHECK-NEXT: SubstTemplateTypeParmType 0x{{[^ ]*}} 'int' sugar
Index: clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
===
--- clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -1029,8 +1029,9 @@
   // will contain the instantiations of the template parameters.
   LocalInstantiationScope Scope(SemaRef);
 
-  TemplateParameterList *TempParams = D->getTemplateParameters();
-  TemplateParameterList *InstParams = SubstTemplateParams(TempParams);
+  auto EarlySubstitutionScope = TemplateArgs.getEarlySubstitutionRAII();
+  TemplateParameterList *InstParams =
+  SubstTemplateParams(D->getTemplateParameters());
   if (!InstParams)
 return nullptr;
 
@@ -2757,7 +2758,7 @@
 
   TemplateTypeParmDecl *Inst = TemplateTypeParmDecl::Create(
   SemaRef.Context, Owner, D->getBeginLoc(), D->getLocation(),
-  D->getDepth() - TemplateArgs.getNumSubstitutedLevels(), D->getIndex(),
+  TemplateArgs.getNewDepth(D->getDepth()), D->getIndex(),
   D->getIdentifier(), D->wasDeclaredWithTypename(), D->isParameterPack(),
   D->hasTypeConstraint(), NumExpanded);
 
@@ -2910,14 +2911,14 @@
   if (IsExpandedParameterPack)
 Param = NonTypeTemplateParmDecl::Create(
 SemaRef.Context, Owner, D->getInnerLocStart(), D->getLocation(),
-D->getDepth() - TemplateArgs.getNumSubstitutedLevels(),
-D->getPosition(), D->getIdentifier(), T, DI, ExpandedParameterPackTypes,
+TemplateArgs.getNewDepth(D->getDepth()), D->getPosition(),
+D->getIdentifier(), T, DI, ExpandedParameterPackTypes,
 ExpandedParameterPackTypesAsWritten);
   else
 Param = NonTypeTemplateParmDecl::Create(
 SemaRef.Context, Owner, D->getInnerLocStart(), D->getLocation(),
-D->getDepth() - TemplateArgs.getNumSubstitutedLevels(),
-D->getPosition(), D->getIdentifier(), T, D->isParameterPack(), DI);
+TemplateArgs.getNewDepth(D->getDepth()), D->getPosition(),
+D->getIdentifier(), T, D->isParameterPack(), DI);
 
   if (AutoTypeLoc AutoLoc = DI->getTypeLoc().getContainedAutoTypeLoc())
 if (AutoLoc.isConstrained())
@@ -3051,13 +3052,13 @@
   if (IsExpandedParameterPack)
 Param = TemplateTemplateParmDecl::Create(
 SemaRef.Context, Owner, D->getLocation(),
-D->getDepth() - TemplateArgs.getNumSubstitutedLevels(),
-D->getPosition(), D->getIdentifier(), InstParams, ExpandedParams);
+TemplateArgs.getNewDepth(D->getDepth()), D->getPosition(),
+D->getIdentifier(), InstParams, ExpandedParams);
   else
 Param = TemplateTemplateParmDecl::Create(
 SemaRef.Context, Owner, D->getLocation(),
-D->getDepth() - TemplateArgs.getNumSubstitutedLevels(),
-D->getPosition(), D->isParameterPack(), D->getIdentifier(), InstParams);
+TemplateArgs.getNewDepth(D->getDepth()), D->getPosition(),
+D->isParameterPack(), D->getIdentifier(), InstParams);
   if (D->hasDefaultArgument() && !D->defaultArgumentWasInherited()) {
 NestedNameSpecifierLoc QualifierLoc =
 D->getDefaultArgument().getTemplateQualifierLoc();
@@ -4021,6 +4022,7 @@
   if (Expr *E = L->getRequiresClause()) {
 EnterExpressionEvaluationContext ConstantEvaluated(
 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated);
+auto LateSubstitutionScope = TemplateArgs.getLateSubstitutionRAII();
 ExprResult Res = SemaRef.SubstExpr(E, TemplateArgs);
 if (Res.isInvalid() || !Res.isUsable()) {
   return nullptr;
Index: clang/lib/Sema/SemaTemplateInstantiate.cpp
===
--- clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -959,8 +959,12 @@
   this->Entity = Entity;
  

[clang] 439a675 - Use getValueOr (NFC)

2022-06-11 Thread Kazu Hirata via cfe-commits

Author: Kazu Hirata
Date: 2022-06-11T11:24:57-07:00
New Revision: 439a675a5a7d8a61014863b2fbb75cb291cad6a0

URL: 
https://github.com/llvm/llvm-project/commit/439a675a5a7d8a61014863b2fbb75cb291cad6a0
DIFF: 
https://github.com/llvm/llvm-project/commit/439a675a5a7d8a61014863b2fbb75cb291cad6a0.diff

LOG: Use getValueOr (NFC)

Added: 


Modified: 
clang/lib/Frontend/InitPreprocessor.cpp
llvm/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp
llvm/lib/InterfaceStub/ELFObjHandler.cpp

Removed: 




diff  --git a/clang/lib/Frontend/InitPreprocessor.cpp 
b/clang/lib/Frontend/InitPreprocessor.cpp
index 73986b2740760..834946411b84b 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -410,7 +410,7 @@ static void InitializeStandardPredefinedMacros(const 
TargetInfo ,
 if (TI.getTriple().getOS() == llvm::Triple::ShaderModel) {
   VersionTuple Version = TI.getTriple().getOSVersion();
   Builder.defineMacro("__SHADER_TARGET_MAJOR", Twine(Version.getMajor()));
-  unsigned Minor = Version.getMinor() ? *Version.getMinor() : 0;
+  unsigned Minor = Version.getMinor().getValueOr(0);
   Builder.defineMacro("__SHADER_TARGET_MINOR", Twine(Minor));
 }
 return;

diff  --git a/llvm/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp 
b/llvm/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp
index 162f1db0189bd..da2041d541040 100644
--- a/llvm/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp
+++ b/llvm/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp
@@ -90,10 +90,8 @@ Error CVSymbolVisitor::visitSymbolStreamFiltered(const 
CVSymbolArray ,
   if (!Filter.SymbolOffset)
 return visitSymbolStream(Symbols);
   uint32_t SymbolOffset = *Filter.SymbolOffset;
-  uint32_t ParentRecurseDepth =
-  Filter.ParentRecursiveDepth ? *Filter.ParentRecursiveDepth : 0;
-  uint32_t ChildrenRecurseDepth =
-  Filter.ChildRecursiveDepth ? *Filter.ChildRecursiveDepth : 0;
+  uint32_t ParentRecurseDepth = Filter.ParentRecursiveDepth.getValueOr(0);
+  uint32_t ChildrenRecurseDepth = Filter.ChildRecursiveDepth.getValueOr(0);
   if (!Symbols.isOffsetValid(SymbolOffset))
 return createStringError(inconvertibleErrorCode(), "Invalid symbol 
offset");
   CVSymbol Sym = *Symbols.at(SymbolOffset);

diff  --git a/llvm/lib/InterfaceStub/ELFObjHandler.cpp 
b/llvm/lib/InterfaceStub/ELFObjHandler.cpp
index 6f37cf6f7e8a9..55d06cd224f79 100644
--- a/llvm/lib/InterfaceStub/ELFObjHandler.cpp
+++ b/llvm/lib/InterfaceStub/ELFObjHandler.cpp
@@ -217,7 +217,7 @@ template  class ELFStubBuilder {
   // time as long as it is not SHN_UNDEF. Set shndx to 1, which
   // points to ".dynsym".
   uint16_t Shndx = Sym.Undefined ? SHN_UNDEF : 1;
-  uint64_t Size = Sym.Size ? *Sym.Size : 0;
+  uint64_t Size = Sym.Size.getValueOr(0);
   DynSym.Content.add(DynStr.Content.getOffset(Sym.Name), Size, Bind,
  convertIFSSymbolTypeToELF(Sym.Type), 0, Shndx);
 }



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 5ee3876 - Use isa instead of dyn_cast (NFC)

2022-06-11 Thread Kazu Hirata via cfe-commits

Author: Kazu Hirata
Date: 2022-06-11T11:15:52-07:00
New Revision: 5ee387690568979fbb8c973eeb61e1a66ee6cc61

URL: 
https://github.com/llvm/llvm-project/commit/5ee387690568979fbb8c973eeb61e1a66ee6cc61
DIFF: 
https://github.com/llvm/llvm-project/commit/5ee387690568979fbb8c973eeb61e1a66ee6cc61.diff

LOG: Use isa instead of dyn_cast (NFC)

Added: 


Modified: 
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/Sema/SemaOpenMP.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/CodeGenModule.cpp 
b/clang/lib/CodeGen/CodeGenModule.cpp
index 21f7219639910..23b0df26ba2aa 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -3664,7 +3664,7 @@ void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl 
GD) {
 
 // Fix up function declarations that were created for cpu_specific before
 // cpu_dispatch was known
-if (!dyn_cast(IFunc)) {
+if (!isa(IFunc)) {
   assert(cast(IFunc)->isDeclaration());
   auto *GI = llvm::GlobalIFunc::create(DeclTy, 0, Linkage, "", 
ResolverFunc,
());

diff  --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 803e0139d40ec..0615c81bff4ae 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -11966,8 +11966,8 @@ bool OpenMPAtomicCompareCaptureChecker::checkStmt(Stmt 
*S,
   UpdateStmt = S1;
   CondUpdateStmt = S2;
   // Check if form 45.
-  if (dyn_cast(BO->getRHS()->IgnoreImpCasts()) &&
-  dyn_cast(S2))
+  if (isa(BO->getRHS()->IgnoreImpCasts()) &&
+  isa(S2))
 return checkForm45(CS, ErrorInfo);
   // It cannot be set before we the check for form45.
   IsPostfixUpdate = true;



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D117977: [cmake] Don't export `LLVM_TOOLS_INSTALL_DIR` anymore

2022-06-11 Thread John Ericson via Phabricator via cfe-commits
Ericson2314 marked an inline comment as done.
Ericson2314 added inline comments.



Comment at: openmp/tools/CMakeLists.txt:1-3
+set(OPENMP_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
+"Path for binary subdirectory (defaults to '${CMAKE_INSTALL_BINDIR}')")
+mark_as_advanced(OPENMP_TOOLS_INSTALL_DIR)

Ericson2314 wrote:
> protze.joachim wrote:
> > Is this variable used anywhere?
> `llvm_add_tool` computes a usage.
Moved this stuff make sure it is used properly.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117977/new/

https://reviews.llvm.org/D117977

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D117977: [cmake] Don't export `LLVM_TOOLS_INSTALL_DIR` anymore

2022-06-11 Thread John Ericson via Phabricator via cfe-commits
Ericson2314 updated this revision to Diff 436152.
Ericson2314 added a comment.

Fix typo

Thank you @aaron.ballman and @nikic for finding the culprit!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117977/new/

https://reviews.llvm.org/D117977

Files:
  bolt/tools/CMakeLists.txt
  bolt/tools/driver/CMakeLists.txt
  bolt/tools/heatmap/CMakeLists.txt
  bolt/tools/merge-fdata/CMakeLists.txt
  clang/CMakeLists.txt
  clang/cmake/modules/AddClang.cmake
  flang/CMakeLists.txt
  flang/cmake/modules/AddFlang.cmake
  lld/CMakeLists.txt
  lld/cmake/modules/AddLLD.cmake
  llvm/cmake/modules/AddLLVM.cmake
  llvm/cmake/modules/CMakeLists.txt
  llvm/cmake/modules/LLVMConfig.cmake.in
  llvm/cmake/modules/TableGen.cmake
  mlir/CMakeLists.txt
  mlir/cmake/modules/AddMLIR.cmake
  mlir/tools/mlir-cpu-runner/CMakeLists.txt
  mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt
  mlir/tools/mlir-lsp-server/CMakeLists.txt
  mlir/tools/mlir-opt/CMakeLists.txt
  mlir/tools/mlir-pdll-lsp-server/CMakeLists.txt
  mlir/tools/mlir-reduce/CMakeLists.txt
  mlir/tools/mlir-spirv-cpu-runner/CMakeLists.txt
  mlir/tools/mlir-translate/CMakeLists.txt
  mlir/tools/mlir-vulkan-runner/CMakeLists.txt
  mlir/tools/tblgen-lsp-server/CMakeLists.txt
  openmp/libomptarget/tools/CMakeLists.txt
  openmp/libomptarget/tools/deviceinfo/CMakeLists.txt

Index: openmp/libomptarget/tools/deviceinfo/CMakeLists.txt
===
--- openmp/libomptarget/tools/deviceinfo/CMakeLists.txt
+++ openmp/libomptarget/tools/deviceinfo/CMakeLists.txt
@@ -12,7 +12,7 @@
 
 libomptarget_say("Building the llvm-omp-device-info tool")
 
-add_llvm_tool(llvm-omp-device-info llvm-omp-device-info.cpp)
+add_openmp_tool(llvm-omp-device-info llvm-omp-device-info.cpp)
 
 llvm_update_compile_flags(llvm-omp-device-info)
 
Index: openmp/libomptarget/tools/CMakeLists.txt
===
--- openmp/libomptarget/tools/CMakeLists.txt
+++ openmp/libomptarget/tools/CMakeLists.txt
@@ -10,4 +10,18 @@
 #
 ##===--===##
 
+set(OPENMP_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
+"Path for binary subdirectory (defaults to '${CMAKE_INSTALL_BINDIR}')")
+mark_as_advanced(OPENMP_TOOLS_INSTALL_DIR)
+
+# Move these macros to AddOpenMP if such a CMake module is ever created.
+
+macro(add_openmp_tool name)
+  llvm_add_tool(OPENMP ${ARGV})
+endmacro()
+
+macro(add_openmp_tool_symlink name)
+  llvm_add_tool_symlink(OPENMP ${ARGV})
+endmacro()
+
 add_subdirectory(deviceinfo)
Index: mlir/tools/tblgen-lsp-server/CMakeLists.txt
===
--- mlir/tools/tblgen-lsp-server/CMakeLists.txt
+++ mlir/tools/tblgen-lsp-server/CMakeLists.txt
@@ -2,7 +2,7 @@
   TableGenLspServerLib
   )
 
-add_llvm_tool(tblgen-lsp-server
+add_mlir_tool(tblgen-lsp-server
   tblgen-lsp-server.cpp
 
   DEPENDS
Index: mlir/tools/mlir-vulkan-runner/CMakeLists.txt
===
--- mlir/tools/mlir-vulkan-runner/CMakeLists.txt
+++ mlir/tools/mlir-vulkan-runner/CMakeLists.txt
@@ -88,7 +88,7 @@
 LIST(APPEND targets_to_link "LLVM${t}")
   ENDFOREACH(t)
 
-  add_llvm_tool(mlir-vulkan-runner
+  add_mlir_tool(mlir-vulkan-runner
 mlir-vulkan-runner.cpp
 
 DEPENDS
Index: mlir/tools/mlir-translate/CMakeLists.txt
===
--- mlir/tools/mlir-translate/CMakeLists.txt
+++ mlir/tools/mlir-translate/CMakeLists.txt
@@ -5,7 +5,7 @@
 get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
 get_property(translation_libs GLOBAL PROPERTY MLIR_TRANSLATION_LIBS)
 
-add_llvm_tool(mlir-translate
+add_mlir_tool(mlir-translate
   mlir-translate.cpp
   )
 llvm_update_compile_flags(mlir-translate)
Index: mlir/tools/mlir-spirv-cpu-runner/CMakeLists.txt
===
--- mlir/tools/mlir-spirv-cpu-runner/CMakeLists.txt
+++ mlir/tools/mlir-spirv-cpu-runner/CMakeLists.txt
@@ -5,7 +5,7 @@
 if (MLIR_ENABLE_SPIRV_CPU_RUNNER)
   message(STATUS "Building SPIR-V CPU runner")
 
-  add_llvm_tool(mlir-spirv-cpu-runner
+  add_mlir_tool(mlir-spirv-cpu-runner
 mlir-spirv-cpu-runner.cpp
   )
 
Index: mlir/tools/mlir-reduce/CMakeLists.txt
===
--- mlir/tools/mlir-reduce/CMakeLists.txt
+++ mlir/tools/mlir-reduce/CMakeLists.txt
@@ -17,7 +17,7 @@
   MLIRReduceLib
   )
 
-add_llvm_tool(mlir-reduce
+add_mlir_tool(mlir-reduce
   mlir-reduce.cpp
 
   DEPENDS
Index: mlir/tools/mlir-pdll-lsp-server/CMakeLists.txt
===
--- mlir/tools/mlir-pdll-lsp-server/CMakeLists.txt
+++ mlir/tools/mlir-pdll-lsp-server/CMakeLists.txt
@@ -2,7 +2,7 @@
   MLIRPdllLspServerLib
   )
 
-add_llvm_tool(mlir-pdll-lsp-server

[PATCH] D117977: [cmake] Don't export `LLVM_TOOLS_INSTALL_DIR` anymore

2022-06-11 Thread John Ericson via Phabricator via cfe-commits
Ericson2314 reopened this revision.
Ericson2314 added a comment.
This revision is now accepted and ready to land.

Thanks for finding this and sorry for the disruption. Hope the revert didn't 
come to slowly.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117977/new/

https://reviews.llvm.org/D117977

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127393: [Driver] Don't add -lresolv on FreeBSD

2022-06-11 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision.
MaskRay added a comment.

Perhaps change to `isOSLinux() && isGNUEnvironment()` now. I suspect other *BSD 
don't need this, either. musl definitely doesn't need this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127393/new/

https://reviews.llvm.org/D127393

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127270: [clang-format] Add space in placement new expression

2022-06-11 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments.



Comment at: clang/include/clang/Format/Format.h:3498
+/// \endcode
+bool AfterPlacementNew;
 /// If ``true``, put a space between operator overloading and opening

HazardyKnusperkeks wrote:
> Please sort after `AfterOver...` here and all other occasions.
For new options they tend to go through a live cycle   bool->Enum->Structure...

can I as we start with an enum not a bool and do something like 
`Always,None,Leave` so Leave will just leave the code completely as it is 
today..

We get a lot of criticism for changing the defaults, often we are not changing 
them we are fixing things or now we format where we never did before.

I think it helps (as a concession to those who want us to NEVER change 
anything), if new options can have a `Leave` option so people don't get one or 
the other it just leaves the code neither formatted with a space or without a 
space, but doing what clang-format did before.

i.e. in the past we've been asked to be able to turn off/on individual styles. 
by ensuring we always have a "Leave" option we can guard the changes and in 
theory not introduce a change in people current formatting when using a later 
binary.



Comment at: clang/include/clang/Format/Format.h:3539
   AfterFunctionDefinitionName(false), AfterIfMacros(false),
-  AfterOverloadedOperator(false), AfterRequiresInClause(false),
-  AfterRequiresInExpression(false), BeforeNonEmptyParentheses(false) {}
+  AfterPlacementNew(true), AfterOverloadedOperator(false),
+  AfterRequiresInClause(false), AfterRequiresInExpression(false),

swap



Comment at: clang/include/clang/Format/Format.h:3550
  AfterIfMacros == Other.AfterIfMacros &&
+ AfterPlacementNew == Other.AfterPlacementNew &&
  AfterOverloadedOperator == Other.AfterOverloadedOperator &&

move down one P comes after O `AfterO -> AfterP`



Comment at: clang/lib/Format/Format.cpp:938
 IO.mapOptional("AfterIfMacros", Spacing.AfterIfMacros);
+IO.mapOptional("AfterPlacementNew", Spacing.AfterPlacementNew);
 IO.mapOptional("AfterOverloadedOperator", Spacing.AfterOverloadedOperator);

move down one line


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127270/new/

https://reviews.llvm.org/D127270

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127270: [clang-format] Add space in placement new expression

2022-06-11 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment.

Thank you for the patch, was there a github issue for this? Can we just 
validate that those requirements are covered here too while we are at it?

https://github.com/llvm/llvm-project/issues/54703
https://github.com/llvm/llvm-project/issues/41501  ( I know this is yours, but 
ensure you mention it in the summary!) so the commit gets tied to the review




Comment at: clang/lib/Format/TokenAnnotator.cpp:3399
+  return Style.SpaceBeforeParensOptions.AfterPlacementNew ||
+ spaceRequiredBeforeParens(Right);
 if (Line.Type == LT_ObjCDecl)

what case is covered here by spaceRequiredBeforeParens(Right)?



Comment at: clang/unittests/Format/FormatTest.cpp:15276
 
+  FormatStyle SpacePlacementNew = getLLVMStyle();
+  SpacePlacementNew.SpaceBeforeParens = FormatStyle::SBPO_Custom;

curdeius wrote:
> Are there any tests with `AfterPlacementNew = false;`? Could you add those 
> please?
you should probably give yourself your own test, for SpacePlacementNew


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127270/new/

https://reviews.llvm.org/D127270

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127484: [clang-format] Use tabs on GNU style

2022-06-11 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment.

We get heavily criticized for changing defaults between versions, I think if 
someone want to use GNU style, and they choose to now have this option set it 
should be done so in their own .clang-format file

On reflection, I think its wrong of us to change that now in case people are 
doing

  BasedOnStyle: GNU

I sort of feel this is a style we have to leave alone. But what do GNU users 
think? are they complaining? What led you to this change in the first place (I 
saw the twitter thread)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127484/new/

https://reviews.llvm.org/D127484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127390: [clang-format][NFC] Remove unused FormatStyle members

2022-06-11 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment.

If we remove it from here, then it will get removed from  the documentation

F23403281: image.png 

Also if you remove it, then the ClangFormatStyleOptions.rst needs to be 
regenerated. But somehow I think we need that comment no? incase someone is 
looking up their legacy options when migrating?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127390/new/

https://reviews.llvm.org/D127390

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] ff80dc8 - [X86] Add __extension__ to f16c macro intrinsics to suppress warnings about compound literals

2022-06-11 Thread Craig Topper via cfe-commits

Author: Craig Topper
Date: 2022-06-11T08:34:37-07:00
New Revision: ff80dc85449307d90e5276cd8f41825ace9b8594

URL: 
https://github.com/llvm/llvm-project/commit/ff80dc85449307d90e5276cd8f41825ace9b8594
DIFF: 
https://github.com/llvm/llvm-project/commit/ff80dc85449307d90e5276cd8f41825ace9b8594.diff

LOG: [X86] Add __extension__ to f16c macro intrinsics to suppress warnings 
about compound literals

This had previously been fixed, but was lost 4 years ago when __extension__
was removed from many intrinsic macros.

Refixes PR32491.

Added: 


Modified: 
clang/lib/Headers/f16cintrin.h

Removed: 




diff  --git a/clang/lib/Headers/f16cintrin.h b/clang/lib/Headers/f16cintrin.h
index 13905e6fb0ec..94a662c1d93a 100644
--- a/clang/lib/Headers/f16cintrin.h
+++ b/clang/lib/Headers/f16cintrin.h
@@ -65,9 +65,9 @@ _cvtsh_ss(unsigned short __a)
 ///011: Truncate \n
 ///1XX: Use MXCSR.RC for rounding
 /// \returns The converted 16-bit half-precision float value.
-#define _cvtss_sh(a, imm) \
-  ((unsigned short)(((__v8hi)__builtin_ia32_vcvtps2ph((__v4sf){a, 0, 0, 0}, \
- (imm)))[0]))
+#define _cvtss_sh(a, imm) __extension__ ({ \
+  (unsigned short)(((__v8hi)__builtin_ia32_vcvtps2ph((__v4sf){a, 0, 0, 0}, \
+ (imm)))[0]); })
 
 /// Converts a 128-bit vector containing 32-bit float values into a
 ///128-bit vector containing 16-bit half-precision float values.



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 45b278f - [Clang][Doc][SafeStack] Fix deadlink (NFC)

2022-06-11 Thread via cfe-commits

Author: ksyx
Date: 2022-06-11T10:59:51-04:00
New Revision: 45b278f195b25e012fe441db13715cfecb377fce

URL: 
https://github.com/llvm/llvm-project/commit/45b278f195b25e012fe441db13715cfecb377fce
DIFF: 
https://github.com/llvm/llvm-project/commit/45b278f195b25e012fe441db13715cfecb377fce.diff

LOG: [Clang][Doc][SafeStack] Fix deadlink (NFC)

Added: 


Modified: 
clang/docs/SafeStack.rst

Removed: 




diff  --git a/clang/docs/SafeStack.rst b/clang/docs/SafeStack.rst
index 8b5557bf59b0..c585315dff88 100644
--- a/clang/docs/SafeStack.rst
+++ b/clang/docs/SafeStack.rst
@@ -18,7 +18,7 @@ buffer overflows on the unsafe stack cannot be used to 
overwrite anything
 on the safe stack.
 
 SafeStack is a part of the `Code-Pointer Integrity (CPI) Project
-`_.
+`_.
 
 Performance
 ---
@@ -84,7 +84,7 @@ Known security limitations
 A complete protection against control-flow hijack attacks requires combining
 SafeStack with another mechanism that enforces the integrity of code pointers
 that are stored on the heap or the unsafe stack, such as `CPI
-`_, or a forward-edge control flow integrity
+`_, or a forward-edge control flow 
integrity
 mechanism that enforces correct calling conventions at indirect call sites,
 such as `IFCC `_ with arity
 checks. Clang has control-flow integrity protection scheme for :doc:`C++ 
virtual
@@ -186,7 +186,7 @@ Deprecated: This builtin function is an alias for
 Design
 ==
 
-Please refer to the `Code-Pointer Integrity 
`__
+Please refer to the `Code-Pointer Integrity 
`__
 project page for more information about the design of the SafeStack and its
 related technologies.
 



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123064: [Clang][C++23] P2071 Named universal character escapes

2022-06-11 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 436142.
cor3ntin added a comment.

Do not hardcode the list of generated code points ranges in the generator
code to ease maintainance burden.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123064/new/

https://reviews.llvm.org/D123064

Files:
  clang/include/clang/Basic/DiagnosticLexKinds.td
  clang/include/clang/Lex/Lexer.h
  clang/lib/Lex/Lexer.cpp
  clang/lib/Lex/LiteralSupport.cpp
  clang/test/FixIt/fixit-unicode-named-escape-sequences.c
  clang/test/Lexer/char-escapes-delimited.c
  clang/test/Lexer/unicode.c
  clang/test/Parser/cxx11-user-defined-literals.cpp
  clang/test/Preprocessor/ucn-pp-identifier.c
  clang/test/Sema/ucn-identifiers.c
  llvm/CMakeLists.txt
  llvm/include/llvm/Support/Unicode.h
  llvm/lib/Support/CMakeLists.txt
  llvm/lib/Support/UnicodeNameToCodepoint.cpp
  llvm/lib/Support/UnicodeNameToCodepointGenerated.cpp
  llvm/unittests/Support/UnicodeTest.cpp
  llvm/utils/UnicodeData/CMakeLists.txt
  llvm/utils/UnicodeData/UnicodeNameMappingGenerator.cpp

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123064: [Clang][C++23] P2071 Named universal character escapes

2022-06-11 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 436137.
cor3ntin added a comment.

Use utohexstr and revert the changes that put to_hexString in StringExtras.
I'll remove to_hexString entierly in a separate NFC change to avoid
duplication and further confusion.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123064/new/

https://reviews.llvm.org/D123064

Files:
  clang/include/clang/Basic/DiagnosticLexKinds.td
  clang/include/clang/Lex/Lexer.h
  clang/lib/Lex/Lexer.cpp
  clang/lib/Lex/LiteralSupport.cpp
  clang/test/FixIt/fixit-unicode-named-escape-sequences.c
  clang/test/Lexer/char-escapes-delimited.c
  clang/test/Lexer/unicode.c
  clang/test/Parser/cxx11-user-defined-literals.cpp
  clang/test/Preprocessor/ucn-pp-identifier.c
  clang/test/Sema/ucn-identifiers.c
  llvm/CMakeLists.txt
  llvm/include/llvm/Support/Unicode.h
  llvm/lib/Support/CMakeLists.txt
  llvm/lib/Support/UnicodeNameToCodepoint.cpp
  llvm/lib/Support/UnicodeNameToCodepointGenerated.cpp
  llvm/unittests/Support/UnicodeTest.cpp
  llvm/utils/UnicodeData/CMakeLists.txt
  llvm/utils/UnicodeData/UnicodeNameMappingGenerator.cpp

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D117977: [cmake] Don't export `LLVM_TOOLS_INSTALL_DIR` anymore

2022-06-11 Thread Nikita Popov via Phabricator via cfe-commits
nikic added inline comments.



Comment at: clang/cmake/modules/AddClang.cmake:178
   # Always generate install targets
-  llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE)
+  llvm_install_symlink(CLANG name} ${dest} ALWAYS_GENERATE)
 endmacro()

Yeah, there's a typo on this line. Should be `${name}`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117977/new/

https://reviews.llvm.org/D117977

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123064: [Clang][C++23] P2071 Named universal character escapes

2022-06-11 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment.

@tstellar I saw you say in another path that you got confirmation from lawyers 
that it's okay to include UnicodeData.txt (which this patch doesn't do) and 
derived data (which this patch does). Can you confirm? Thanks


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123064/new/

https://reviews.llvm.org/D123064

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123064: [Clang][C++23] P2071 Named universal character escapes

2022-06-11 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 436133.
cor3ntin added a comment.

- Rebase
- The generator code is more consistent with LLVM style guides.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123064/new/

https://reviews.llvm.org/D123064

Files:
  clang/include/clang/Basic/DiagnosticLexKinds.td
  clang/include/clang/Lex/Lexer.h
  clang/lib/Lex/Lexer.cpp
  clang/lib/Lex/LiteralSupport.cpp
  clang/test/FixIt/fixit-unicode-named-escape-sequences.c
  clang/test/Lexer/char-escapes-delimited.c
  clang/test/Lexer/unicode.c
  clang/test/Parser/cxx11-user-defined-literals.cpp
  clang/test/Preprocessor/ucn-pp-identifier.c
  clang/test/Sema/ucn-identifiers.c
  llvm/CMakeLists.txt
  llvm/include/llvm/ADT/StringExtras.h
  llvm/include/llvm/Support/ScopedPrinter.h
  llvm/include/llvm/Support/Unicode.h
  llvm/lib/Support/CMakeLists.txt
  llvm/lib/Support/ScopedPrinter.cpp
  llvm/lib/Support/StringExtras.cpp
  llvm/lib/Support/UnicodeNameToCodepoint.cpp
  llvm/lib/Support/UnicodeNameToCodepointGenerated.cpp
  llvm/unittests/Support/UnicodeTest.cpp
  llvm/utils/UnicodeData/CMakeLists.txt
  llvm/utils/UnicodeData/UnicodeNameMappingGenerator.cpp

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123674: Clang-Repl Error Recovery Bug Fix

2022-06-11 Thread Purva Chaudhari via Phabricator via cfe-commits
Purva-Chaudhari updated this revision to Diff 436129.
Purva-Chaudhari added a comment.

Fix asan test fail


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123674/new/

https://reviews.llvm.org/D123674

Files:
  clang/lib/Interpreter/IncrementalParser.cpp
  clang/test/Interpreter/errorRecovery.cpp


Index: clang/test/Interpreter/errorRecovery.cpp
===
--- /dev/null
+++ clang/test/Interpreter/errorRecovery.cpp
@@ -0,0 +1,16 @@
+// RUN: clang-repl "int x = 12;" 'extern "C" int printf(const char*,...);' \
+// RUN:'auto r1 = printf("x = %d\n", x);' | FileCheck 
--check-prefix=CHECK-DRIVER %s
+// REQUIRES: host-supports-jit
+// UNSUPPORTED: system-aix
+// CHECK-DRIVER: x = 12
+// RUN: cat %s | clang-repl | FileCheck %s
+extern "C" int printf(const char *, ...);
+int x = 5;
+auto r1 = printf("x = %d\n", x);
+// CHECK: x = 5
+
+int y = 10; err;
+int y = 11;
+auto r2 = printf("y = %d\n", y);
+// CHECK-NEXT: y = 11
+quit
Index: clang/lib/Interpreter/IncrementalParser.cpp
===
--- clang/lib/Interpreter/IncrementalParser.cpp
+++ clang/lib/Interpreter/IncrementalParser.cpp
@@ -188,7 +188,7 @@
 S.TUScope->setEntity(PreviousTU);
 
 // Clean up the lookup table
-if (StoredDeclsMap *Map = PreviousTU->getLookupPtr()) {
+if (StoredDeclsMap *Map = PreviousTU->getPrimaryContext()->getLookupPtr()) 
{
   for (auto I = Map->begin(); I != Map->end(); ++I) {
 StoredDeclsList  = I->second;
 DeclContextLookupResult R = List.getLookupResult();


Index: clang/test/Interpreter/errorRecovery.cpp
===
--- /dev/null
+++ clang/test/Interpreter/errorRecovery.cpp
@@ -0,0 +1,16 @@
+// RUN: clang-repl "int x = 12;" 'extern "C" int printf(const char*,...);' \
+// RUN:'auto r1 = printf("x = %d\n", x);' | FileCheck --check-prefix=CHECK-DRIVER %s
+// REQUIRES: host-supports-jit
+// UNSUPPORTED: system-aix
+// CHECK-DRIVER: x = 12
+// RUN: cat %s | clang-repl | FileCheck %s
+extern "C" int printf(const char *, ...);
+int x = 5;
+auto r1 = printf("x = %d\n", x);
+// CHECK: x = 5
+
+int y = 10; err;
+int y = 11;
+auto r2 = printf("y = %d\n", y);
+// CHECK-NEXT: y = 11
+quit
Index: clang/lib/Interpreter/IncrementalParser.cpp
===
--- clang/lib/Interpreter/IncrementalParser.cpp
+++ clang/lib/Interpreter/IncrementalParser.cpp
@@ -188,7 +188,7 @@
 S.TUScope->setEntity(PreviousTU);
 
 // Clean up the lookup table
-if (StoredDeclsMap *Map = PreviousTU->getLookupPtr()) {
+if (StoredDeclsMap *Map = PreviousTU->getPrimaryContext()->getLookupPtr()) {
   for (auto I = Map->begin(); I != Map->end(); ++I) {
 StoredDeclsList  = I->second;
 DeclContextLookupResult R = List.getLookupResult();
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D117977: [cmake] Don't export `LLVM_TOOLS_INSTALL_DIR` anymore

2022-06-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment.

We saw the same thing at Intel FWIW. When I investigated it, all of the 
symlinks were being created as `name}` instead of whatever you'd expect the 
symlink to be named.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117977/new/

https://reviews.llvm.org/D117977

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127313: [libc++] Implement P0618R0 (Deprecating )

2022-06-11 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik updated this revision to Diff 436126.
philnik added a comment.

Rebased to fix CI


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127313/new/

https://reviews.llvm.org/D127313

Files:
  libcxx/docs/ReleaseNotes.rst
  libcxx/docs/Status/Cxx17Papers.csv
  libcxx/include/codecvt
  libcxx/include/locale
  libcxx/src/locale.cpp
  
libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_mode.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp
  
libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_in.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_in.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_unshift.pass.cpp
  
libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_always_noconv.pass.cpp
  
libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_encoding.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_length.pass.cpp
  
libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_max_length.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_unshift.pass.cpp
  libcxx/test/std/localization/locale.stdcvt/depr.verify.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/depr.verify.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/overflow.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/rdbuf.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/seekoff.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/test.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt_state.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/depr.verify.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
  
libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/types.pass.cpp

Index: libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/types.pass.cpp
===
--- libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/types.pass.cpp
+++ libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/types.pass.cpp
@@ -8,6 +8,8 @@
 
 // 
 
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+
 // template,
 //  class Byte_alloc = allocator>
Index: 

[PATCH] D126215: [analyzer] Deprecate `-analyzer-store region` flag

2022-06-11 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 436124.
steakhal added a comment.

- Add the new `diag::warn_analyzer_deprecated_option` warning to the 
`"deprecated-static-analyzer-flag"` `DiagGroup` to prevent breaking the 
`clang/test/Misc/warning-flags.c` test file.

I'm also adding @thakis to review this change, prior to proceeding.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126215/new/

https://reviews.llvm.org/D126215

Files:
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Basic/DiagnosticDriverKinds.td
  clang/include/clang/Basic/DiagnosticGroups.td
  clang/include/clang/Driver/Options.td
  clang/include/clang/StaticAnalyzer/Core/Analyses.def
  clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
  clang/test/Analysis/CFNumber.c
  clang/test/Analysis/CFRetainRelease_NSAssertionHandler.m
  clang/test/Analysis/CGColorSpace.c
  clang/test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp
  clang/test/Analysis/NSPanel.m
  clang/test/Analysis/NSString.m
  clang/test/Analysis/NSWindow.m
  clang/test/Analysis/OSAtomic_mac.cpp
  clang/test/Analysis/PR3991.m
  clang/test/Analysis/PR7218.c
  clang/test/Analysis/analyzeOneFunction.m
  clang/test/Analysis/array-struct.c
  clang/test/Analysis/blocks.m
  clang/test/Analysis/bool-assignment.c
  clang/test/Analysis/bstring.cpp
  clang/test/Analysis/casts.c
  clang/test/Analysis/casts.cpp
  clang/test/Analysis/casts.m
  clang/test/Analysis/cfref_PR2519.c
  clang/test/Analysis/cfref_rdar6080742.c
  clang/test/Analysis/chroot.c
  clang/test/Analysis/concrete-address.c
  clang/test/Analysis/coverage.c
  clang/test/Analysis/cstring-syntax-cxx.cpp
  clang/test/Analysis/cxx-method-names.cpp
  clang/test/Analysis/dead-stores.cpp
  clang/test/Analysis/default-diagnostic-visitors.c
  clang/test/Analysis/delegates.m
  clang/test/Analysis/deprecated-flags-and-options.cpp
  clang/test/Analysis/disable-all-checks.c
  clang/test/Analysis/elementtype.c
  clang/test/Analysis/fields.c
  clang/test/Analysis/free.c
  clang/test/Analysis/free.cpp
  clang/test/Analysis/func.c
  clang/test/Analysis/gmalloc.c
  clang/test/Analysis/ivars.m
  clang/test/Analysis/keychainAPI-diagnostic-visitor.m
  clang/test/Analysis/localization-aggressive.m
  clang/test/Analysis/localization.m
  clang/test/Analysis/lvalue.cpp
  clang/test/Analysis/malloc-annotations.c
  clang/test/Analysis/malloc-annotations.cpp
  clang/test/Analysis/malloc.c
  clang/test/Analysis/malloc.m
  clang/test/Analysis/method-call-intra-p.cpp
  clang/test/Analysis/misc-ps-64.m
  clang/test/Analysis/misc-ps-arm.m
  clang/test/Analysis/misc-ps-eager-assume.m
  clang/test/Analysis/misc-ps-ranges.m
  clang/test/Analysis/misc-ps-region-store-i386.m
  clang/test/Analysis/misc-ps-region-store-x86_64.m
  clang/test/Analysis/misc-ps-region-store.cpp
  clang/test/Analysis/misc-ps-region-store.m
  clang/test/Analysis/misc-ps-region-store.mm
  clang/test/Analysis/misc-ps.m
  clang/test/Analysis/new-with-exceptions.cpp
  clang/test/Analysis/new.cpp
  clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret-region.m
  clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
  clang/test/Analysis/no-exit-cfg.c
  clang/test/Analysis/no-outofbounds.c
  clang/test/Analysis/null-deref-path-notes.m
  clang/test/Analysis/null-deref-ps.c
  clang/test/Analysis/nullptr.cpp
  clang/test/Analysis/objc-boxing.m
  clang/test/Analysis/objc-message.m
  clang/test/Analysis/objc-subscript.m
  clang/test/Analysis/outofbound-notwork.c
  clang/test/Analysis/outofbound.c
  clang/test/Analysis/override-werror.c
  clang/test/Analysis/pr22954.c
  clang/test/Analysis/pr4209.m
  clang/test/Analysis/pr_2542_rdar_6793404.m
  clang/test/Analysis/pr_4164.c
  clang/test/Analysis/properties.m
  clang/test/Analysis/properties.mm
  clang/test/Analysis/ptr-arith.c
  clang/test/Analysis/qt_malloc.cpp
  clang/test/Analysis/range_casts.c
  clang/test/Analysis/rdar-6442306-1.m
  clang/test/Analysis/rdar-6541136-region.c
  clang/test/Analysis/rdar-6562655.m
  clang/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m
  clang/test/Analysis/rdar-7168531.m
  clang/test/Analysis/refcnt_naming.m
  clang/test/Analysis/reference.cpp
  clang/test/Analysis/region-1.m
  clang/test/Analysis/retain-release-path-notes.m
  clang/test/Analysis/retain-release-region-store.m
  clang/test/Analysis/retain-release.mm
  clang/test/Analysis/stack-addr-ps.c
  clang/test/Analysis/stack-addr-ps.cpp
  clang/test/Analysis/stack-block-returned.cpp
  clang/test/Analysis/string-fail.c
  clang/test/Analysis/undef-buffers.c
  clang/test/Analysis/uninit-ps-rdar6145427.m
  clang/test/Analysis/uninit-vals-union.c
  clang/test/Analysis/uninit-vals.m
  clang/test/Analysis/unions-region.m
  clang/test/Analysis/unix-fns.c
  clang/test/Analysis/valist-as-lazycompound.c
  

[PATCH] D126984: [clang] Add initial support for gcc's optimize function attribute

2022-06-11 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added inline comments.



Comment at: clang/test/CodeGen/attr-optimize.c:16
+
+__attribute__((optimize("Oz"))) void f4(void) {}
+// O2: @f4{{.*}}[[ATTR_OPTSIZE]]

For -Os, clang adds optsize. For -Oz, clang adds optsize and minsize. So tests 
should check it, maybe currently this is broken in your patch?

https://godbolt.org/z/dEsffoeW4


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126984/new/

https://reviews.llvm.org/D126984

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-11 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment.

Possible alternative version of `linker-flags-windows.f90` that also tests 
MinGW and takes the feedback by @mstorsjo into account:

  ! Verify that the Fortran runtime libraries are present in the linker
  ! invocation. These libraries are added on top of other standard runtime
  ! libraries that the Clang driver will include.
  
  ! ---
  ! target MSVC
  ! ---
  
  ! NOTE: The additional linker flags tested here are currently specified in
  ! clang/lib/Driver/Toolchains/MSVC.cpp.
  
  !
  ! RUN COMMAND
  !
  ! RUN: %flang -### -target x86_64-windows-msvc -flang-experimental-exec 
%S/Inputs/hello.f90 2>&1 | FileCheck %s
  
  !
  ! EXPECTED OUTPUT
  !
  ! Compiler invocation to generate the object file
  ! CHECK-LABEL: {{.*}} "-emit-obj"
  ! CHECK-SAME:  "-o" "[[object_file:.*]]" {{.*}}Inputs/hello.f90
  
  ! Linker invocation to generate the executable
  ! NOTE: This check should also match if the default linker is lld-link.exe
  ! CHECK-LABEL: link.exe
  ! CHECK-NOT: libcmt
  ! CHECK-NOT: oldnames
  ! CHECK-SAME: Fortran_main.lib
  ! CHECK-SAME: FortranRuntime.lib
  ! CHECK-SAME: FortranDecimal.lib
  ! CHECK-SAME: /subsystem:console
  ! CHECK-SAME: "[[object_file]]"
  
  ! 
  ! target MinGW
  ! 
  
  ! NOTE: The additional linker flags tested here are currently specified in
  ! clang/lib/Driver/Toolchains/MinGW.cpp.
  
  !
  ! RUN COMMAND
  !
  ! RUN: %flang -### -target x86_64-windows-gnu -flang-experimental-exec 
%S/Inputs/hello.f90 2>&1 | FileCheck %s
  
  !
  ! EXPECTED OUTPUT
  !
  ! Compiler invocation to generate the object file
  ! CHECK-LABEL: {{.*}} "-emit-obj"
  ! CHECK-SAME:  "-o" "[[object_file:.*]]" {{.*}}Inputs/hello.f90
  
  ! Linker invocation to generate the executable
  ! CHECK-SAME: "[[object_file]]"
  ! CHECK-SAME: -lFortran_main
  ! CHECK-SAME: -lFortranRuntime
  ! CHECK-SAME: -lFortranDecimal


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126291/new/

https://reviews.llvm.org/D126291

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 781dc34 - [clang][docs] Fix typo in code-block declaration

2022-06-11 Thread Simon Pilgrim via cfe-commits

Author: Simon Pilgrim
Date: 2022-06-11T09:28:38+01:00
New Revision: 781dc344f5e13b163818fa851f278233d53724c3

URL: 
https://github.com/llvm/llvm-project/commit/781dc344f5e13b163818fa851f278233d53724c3
DIFF: 
https://github.com/llvm/llvm-project/commit/781dc344f5e13b163818fa851f278233d53724c3.diff

LOG: [clang][docs] Fix typo in code-block declaration

Added: 


Modified: 
clang/docs/LanguageExtensions.rst

Removed: 




diff  --git a/clang/docs/LanguageExtensions.rst 
b/clang/docs/LanguageExtensions.rst
index 3e4108bdbe50b..a69b798f31ee4 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -3221,7 +3221,7 @@ Note that this intrinsic cannot yet be called in a 
``constexpr`` context.
 Guaranteed inlined memset
 ^
 
-. code-block:: c
+.. code-block:: c
 
   void __builtin_memset_inline(void *dst, int value, size_t size);
 



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127532: [clang-format] Fix a bug in RemoveBracesLLVM

2022-06-11 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG05d771021ad9: [clang-format] Fix a bug in RemoveBracesLLVM 
(authored by owenpan).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127532/new/

https://reviews.llvm.org/D127532

Files:
  clang/lib/Format/UnwrappedLineParser.cpp
  clang/unittests/Format/FormatTest.cpp


Index: clang/unittests/Format/FormatTest.cpp
===
--- clang/unittests/Format/FormatTest.cpp
+++ clang/unittests/Format/FormatTest.cpp
@@ -25576,6 +25576,17 @@
"  g;",
Style);
 
+  verifyFormat("if (a) {\n"
+   "  b;\n"
+   "  c;\n"
+   "} else { // comment\n"
+   "  if (d) {\n"
+   "e;\n"
+   "f;\n"
+   "  }\n"
+   "}",
+   Style);
+
   verifyFormat("if (a)\n"
"  b;\n"
"else if (c)\n"
Index: clang/lib/Format/UnwrappedLineParser.cpp
===
--- clang/lib/Format/UnwrappedLineParser.cpp
+++ clang/lib/Format/UnwrappedLineParser.cpp
@@ -2610,6 +2610,7 @@
 nextToken();
 handleAttributes();
 if (FormatTok->is(tok::l_brace)) {
+  const bool FollowedByIf = Tokens->peekNextToken()->is(tok::kw_if);
   FormatTok->setFinalizedType(TT_ElseLBrace);
   ElseLeftBrace = FormatTok;
   CompoundStatementIndenter Indenter(this, Style, Line->Level);
@@ -2621,7 +2622,7 @@
 KeepElseBraces = KeepElseBraces ||
  ElseBlockKind == IfStmtKind::IfOnly ||
  ElseBlockKind == IfStmtKind::IfElseIf;
-  } else if (IfLBrace && !IfLBrace->Optional) {
+  } else if (FollowedByIf && IfLBrace && !IfLBrace->Optional) {
 KeepElseBraces = true;
 assert(ElseLeftBrace->MatchingParen);
 markOptionalBraces(ElseLeftBrace);


Index: clang/unittests/Format/FormatTest.cpp
===
--- clang/unittests/Format/FormatTest.cpp
+++ clang/unittests/Format/FormatTest.cpp
@@ -25576,6 +25576,17 @@
"  g;",
Style);
 
+  verifyFormat("if (a) {\n"
+   "  b;\n"
+   "  c;\n"
+   "} else { // comment\n"
+   "  if (d) {\n"
+   "e;\n"
+   "f;\n"
+   "  }\n"
+   "}",
+   Style);
+
   verifyFormat("if (a)\n"
"  b;\n"
"else if (c)\n"
Index: clang/lib/Format/UnwrappedLineParser.cpp
===
--- clang/lib/Format/UnwrappedLineParser.cpp
+++ clang/lib/Format/UnwrappedLineParser.cpp
@@ -2610,6 +2610,7 @@
 nextToken();
 handleAttributes();
 if (FormatTok->is(tok::l_brace)) {
+  const bool FollowedByIf = Tokens->peekNextToken()->is(tok::kw_if);
   FormatTok->setFinalizedType(TT_ElseLBrace);
   ElseLeftBrace = FormatTok;
   CompoundStatementIndenter Indenter(this, Style, Line->Level);
@@ -2621,7 +2622,7 @@
 KeepElseBraces = KeepElseBraces ||
  ElseBlockKind == IfStmtKind::IfOnly ||
  ElseBlockKind == IfStmtKind::IfElseIf;
-  } else if (IfLBrace && !IfLBrace->Optional) {
+  } else if (FollowedByIf && IfLBrace && !IfLBrace->Optional) {
 KeepElseBraces = true;
 assert(ElseLeftBrace->MatchingParen);
 markOptionalBraces(ElseLeftBrace);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 05d7710 - [clang-format] Fix a bug in RemoveBracesLLVM

2022-06-11 Thread via cfe-commits

Author: owenca
Date: 2022-06-11T01:12:11-07:00
New Revision: 05d771021ad9de12f3e657d464d18731a13578ab

URL: 
https://github.com/llvm/llvm-project/commit/05d771021ad9de12f3e657d464d18731a13578ab
DIFF: 
https://github.com/llvm/llvm-project/commit/05d771021ad9de12f3e657d464d18731a13578ab.diff

LOG: [clang-format] Fix a bug in RemoveBracesLLVM

Remove the braces of an else block only if the r_brace of the block
is followed by an if.

Differential Revision: https://reviews.llvm.org/D127532

Added: 


Modified: 
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTest.cpp

Removed: 




diff  --git a/clang/lib/Format/UnwrappedLineParser.cpp 
b/clang/lib/Format/UnwrappedLineParser.cpp
index d2d69aabfd80a..2721949794195 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -2610,6 +2610,7 @@ FormatToken 
*UnwrappedLineParser::parseIfThenElse(IfStmtKind *IfKind,
 nextToken();
 handleAttributes();
 if (FormatTok->is(tok::l_brace)) {
+  const bool FollowedByIf = Tokens->peekNextToken()->is(tok::kw_if);
   FormatTok->setFinalizedType(TT_ElseLBrace);
   ElseLeftBrace = FormatTok;
   CompoundStatementIndenter Indenter(this, Style, Line->Level);
@@ -2621,7 +2622,7 @@ FormatToken 
*UnwrappedLineParser::parseIfThenElse(IfStmtKind *IfKind,
 KeepElseBraces = KeepElseBraces ||
  ElseBlockKind == IfStmtKind::IfOnly ||
  ElseBlockKind == IfStmtKind::IfElseIf;
-  } else if (IfLBrace && !IfLBrace->Optional) {
+  } else if (FollowedByIf && IfLBrace && !IfLBrace->Optional) {
 KeepElseBraces = true;
 assert(ElseLeftBrace->MatchingParen);
 markOptionalBraces(ElseLeftBrace);

diff  --git a/clang/unittests/Format/FormatTest.cpp 
b/clang/unittests/Format/FormatTest.cpp
index 14b169ebe5869..27984ecb0fa53 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -25576,6 +25576,17 @@ TEST_F(FormatTest, RemoveBraces) {
"  g;",
Style);
 
+  verifyFormat("if (a) {\n"
+   "  b;\n"
+   "  c;\n"
+   "} else { // comment\n"
+   "  if (d) {\n"
+   "e;\n"
+   "f;\n"
+   "  }\n"
+   "}",
+   Style);
+
   verifyFormat("if (a)\n"
"  b;\n"
"else if (c)\n"



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 6cf8348 - [NFC][clang] Fix typo

2022-06-11 Thread via cfe-commits

Author: Sheng
Date: 2022-06-11T15:59:05+08:00
New Revision: 6cf83480ea631b05bdab8b32a5903728685a6c2a

URL: 
https://github.com/llvm/llvm-project/commit/6cf83480ea631b05bdab8b32a5903728685a6c2a
DIFF: 
https://github.com/llvm/llvm-project/commit/6cf83480ea631b05bdab8b32a5903728685a6c2a.diff

LOG: [NFC][clang] Fix typo

Change 'otuer' to 'outer'.

Added: 


Modified: 
clang/include/clang/Sema/Template.h

Removed: 




diff  --git a/clang/include/clang/Sema/Template.h 
b/clang/include/clang/Sema/Template.h
index 540d2c9aa87e..5dcde77b5dd3 100644
--- a/clang/include/clang/Sema/Template.h
+++ b/clang/include/clang/Sema/Template.h
@@ -398,7 +398,7 @@ enum class TemplateSubstitutionKind : char {
   return newScope;
 }
 
-/// deletes the given scope, and all otuer scopes, down to the
+/// deletes the given scope, and all outer scopes, down to the
 /// given outermost scope.
 static void deleteScopes(LocalInstantiationScope *Scope,
  LocalInstantiationScope *Outermost) {



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127484: [clang-format] Use tabs on GNU style

2022-06-11 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment.

In D127484#3574803 , @curdeius wrote:

> It seems like a breaking change that may be painful for users of GNU style.

Yeah. There are tens of thousands of lines starting with 8 spaces but none 
starting with a tab in all .c files under git://git.sv.gnu.org/coreutils.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127484/new/

https://reviews.llvm.org/D127484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits