[PATCH] D156172: [clang][CodeGen] Emit annotations for function declarations.

2023-09-13 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added a comment.

Reverted this in 88b7e06dcf9723d0869b0c6bee030b4140e4366d 
 as it 
makes clang crash. Reduced test case in the commit description.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156172

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


[PATCH] D144911: adding bf16 support to NVPTX

2023-06-28 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

I don't have much knowledge about the PTX ABI, but everything here makes 
perfect sense to me.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144911

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


[PATCH] D133574: [C2x] reject type definitions in offsetof

2023-01-13 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added a comment.

GitHub finds around 1.9k instances of this pattern to compute `alignof`. 
There's a lot of duplicates and `#ifdefs` so the real number is going to be 
smaller, but it seems to be quite common. The annoying part is that there is no 
`_Alignof` in C99 so for many of those projects there is no easy fix.

Can this be demoted to a warning?

https://github.com/search?type=code=%2Foffsetof%5Cs*%5C%28%5Cs*struct%5Cs*%5C%7B%2F+lang%3Ac


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133574

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


[PATCH] D140332: [ADT] Alias llvm::Optional to std::optional

2022-12-19 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer marked an inline comment as done.
bkramer added a comment.

In D140332#4005988 , @MaskRay wrote:

> Can you push `using OptionalFileEntryRef = 
> CustomizableOptional;` and the renaming as a separate commit to 
> make this patch smaller?
> There is a smaller that this rename may be reverted.
> 205c0589f918f95d2f2c586a01bea2716d73d603 
>  
> reverted a change related to `OptionalFileEntryRef`. I assume that your 
> change is fine.

Yeah, I'll split this into smaller pieces once we agree on the direction and 
just submit the alias. I expect a revert or two.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140332

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


[PATCH] D140332: [ADT] Alias llvm::Optional to std::optional

2022-12-19 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer marked an inline comment as done.
bkramer added inline comments.



Comment at: clang/lib/Basic/TargetInfo.cpp:513
   if (Opts.MaxBitIntWidth)
-MaxBitIntWidth = Opts.MaxBitIntWidth;
+MaxBitIntWidth = (unsigned)Opts.MaxBitIntWidth;
 

barannikov88 wrote:
> Nit: C-style casts are generally discouraged (there are several occurrences 
> in this patch).
-> static_cast



Comment at: llvm/lib/CodeGen/RegAllocGreedy.h:83
   public:
-ExtraRegInfo() = default;
+ExtraRegInfo() {}
 ExtraRegInfo(const ExtraRegInfo &) = delete;

barannikov88 wrote:
> Is it somehow different than ' = default'?
It makes the class non-trivial, std::optional::emplace has issues with trivial 
default constructors :(



Comment at: mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp:182
 
-  return ret;
+  return std::move(ret);
 }

barannikov88 wrote:
> clang-tidy would usually complain on this. Does it solve some gcc issue?
It does, this is a bug in GCC 7.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140332

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


[PATCH] D139525: Add implementation isTargetCanonicalConstantNode for hexagon.

2022-12-07 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

Looks good, thanks. Let's land this now to unbreak things.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139525

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


[PATCH] D139525: Add implementation isTargetCanonicalConstantNode for hexagon.

2022-12-07 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added a comment.

Mind moving the test case from `llvm/test/CodeGen/AArch64` to 
`llvm/test/CodeGen/Hexagon`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139525

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


[PATCH] D138792: [AArch64] Improve TargetParser API

2022-12-04 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added inline comments.



Comment at: llvm/include/llvm/Support/AArch64TargetParser.h:115-118
+  ArchInfo(const ArchInfo &) = delete;
+  ArchInfo(const ArchInfo &&) = delete;
+  ArchInfo =(const ArchInfo ) = delete;
+  ArchInfo &=(const ArchInfo &) = delete;

If this is really non-copyable add a (constexpr) constructor. non-copyable and 
aggregate initialization doesn't mix. C++20 doesn't allow it, C++17 
accidentally has a lot of loopholes around the non-copyability if you do 
aggregate initialization.



Comment at: llvm/include/llvm/Support/AArch64TargetParser.h:154-160
+// Create ArchInfo structs named 
+#define AARCH64_ARCH(MAJOR, MINOR, PROFILE, NAME, ID, ARCH_FEATURE,
\
+ ARCH_BASE_EXT)
\
+  inline constexpr ArchInfo ID = {VersionTuple{MAJOR, MINOR}, PROFILE, NAME,   
\
+  ARCH_FEATURE, ARCH_BASE_EXT};
+#include "AArch64TargetParser.def"
+#undef AARCH64_ARCH

Is there a good reason for these to be defined in the header? This was wrong 
before and now works because of inline constexpr, but it's still wasting a 
bunch of compile time.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138792

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


[PATCH] D137760: Add FP8 E4M3 support to APFloat.

2022-11-15 Thread Benjamin Kramer 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 rG88eb3c62f25d: Add FP8 E4M3 support to APFloat. (authored by 
reedwm, committed by bkramer).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137760

Files:
  clang/include/clang/AST/Stmt.h
  clang/lib/AST/MicrosoftMangle.cpp
  llvm/include/llvm/ADT/APFloat.h
  llvm/lib/Support/APFloat.cpp
  llvm/unittests/ADT/APFloatTest.cpp

Index: llvm/unittests/ADT/APFloatTest.cpp
===
--- llvm/unittests/ADT/APFloatTest.cpp
+++ llvm/unittests/ADT/APFloatTest.cpp
@@ -1683,6 +1683,7 @@
 TEST(APFloatTest, getLargest) {
   EXPECT_EQ(3.402823466e+38f, APFloat::getLargest(APFloat::IEEEsingle()).convertToFloat());
   EXPECT_EQ(1.7976931348623158e+308, APFloat::getLargest(APFloat::IEEEdouble()).convertToDouble());
+  EXPECT_EQ(448, APFloat::getLargest(APFloat::Float8E4M3FN()).convertToDouble());
 }
 
 TEST(APFloatTest, getSmallest) {
@@ -1766,6 +1767,8 @@
   {::x87DoubleExtended(), true, {0, 0x8000ULL}, 2},
   {::Float8E5M2(), false, {0, 0}, 1},
   {::Float8E5M2(), true, {0x80ULL, 0}, 1},
+  {::Float8E4M3FN(), false, {0, 0}, 1},
+  {::Float8E4M3FN(), true, {0x80ULL, 0}, 1},
   };
   const unsigned NumGetZeroTests = 12;
   for (unsigned i = 0; i < NumGetZeroTests; ++i) {
@@ -3665,6 +3668,16 @@
 EXPECT_EQ(f1.mod(f2), APFloat::opOK);
 EXPECT_TRUE(f1.bitwiseIsEqual(expected));
   }
+  {
+// Test E4M3FN mod where the LHS exponent is maxExponent (8) and the RHS is
+// the max value whose exponent is minExponent (-6). This requires special
+// logic in the mod implementation to prevent overflow to NaN.
+APFloat f1(APFloat::Float8E4M3FN(), "0x1p8");// 256
+APFloat f2(APFloat::Float8E4M3FN(), "0x1.ep-6"); // 0.029296875
+APFloat expected(APFloat::Float8E4M3FN(), "0x1p-8"); // 0.00390625
+EXPECT_EQ(f1.mod(f2), APFloat::opOK);
+EXPECT_TRUE(f1.bitwiseIsEqual(expected));
+  }
 }
 
 TEST(APFloatTest, remainder) {
@@ -4756,6 +4769,389 @@
   EXPECT_TRUE(ilogb(F) == -1);
 }
 
+TEST(APFloatTest, ConvertE4M3FNToE5M2) {
+  bool losesInfo;
+  APFloat test(APFloat::Float8E4M3FN(), "1.0");
+  APFloat::opStatus status = test.convert(
+  APFloat::Float8E5M2(), APFloat::rmNearestTiesToEven, );
+  EXPECT_EQ(1.0f, test.convertToFloat());
+  EXPECT_FALSE(losesInfo);
+  EXPECT_EQ(status, APFloat::opOK);
+
+  test = APFloat(APFloat::Float8E4M3FN(), "0.0");
+  status = test.convert(APFloat::Float8E5M2(), APFloat::rmNearestTiesToEven,
+);
+  EXPECT_EQ(0.0f, test.convertToFloat());
+  EXPECT_FALSE(losesInfo);
+  EXPECT_EQ(status, APFloat::opOK);
+
+  test = APFloat(APFloat::Float8E4M3FN(), "0x1.2p0"); // 1.125
+  status = test.convert(APFloat::Float8E5M2(), APFloat::rmNearestTiesToEven,
+);
+  EXPECT_EQ(0x1.0p0 /* 1.0 */, test.convertToFloat());
+  EXPECT_TRUE(losesInfo);
+  EXPECT_EQ(status, APFloat::opInexact);
+
+  test = APFloat(APFloat::Float8E4M3FN(), "0x1.6p0"); // 1.375
+  status = test.convert(APFloat::Float8E5M2(), APFloat::rmNearestTiesToEven,
+);
+  EXPECT_EQ(0x1.8p0 /* 1.5 */, test.convertToFloat());
+  EXPECT_TRUE(losesInfo);
+  EXPECT_EQ(status, APFloat::opInexact);
+
+  // Convert E4M3 denormal to E5M2 normal. Should not be truncated, despite the
+  // destination format having one fewer significand bit
+  test = APFloat(APFloat::Float8E4M3FN(), "0x1.Cp-7");
+  status = test.convert(APFloat::Float8E5M2(), APFloat::rmNearestTiesToEven,
+);
+  EXPECT_EQ(0x1.Cp-7, test.convertToFloat());
+  EXPECT_FALSE(losesInfo);
+  EXPECT_EQ(status, APFloat::opOK);
+
+  // Test convert from NaN
+  test = APFloat(APFloat::Float8E4M3FN(), "nan");
+  status = test.convert(APFloat::Float8E5M2(), APFloat::rmNearestTiesToEven,
+);
+  EXPECT_TRUE(std::isnan(test.convertToFloat()));
+  EXPECT_FALSE(losesInfo);
+  EXPECT_EQ(status, APFloat::opOK);
+}
+
+TEST(APFloatTest, ConvertE5M2ToE4M3FN) {
+  bool losesInfo;
+  APFloat test(APFloat::Float8E5M2(), "1.0");
+  APFloat::opStatus status = test.convert(
+  APFloat::Float8E4M3FN(), APFloat::rmNearestTiesToEven, );
+  EXPECT_EQ(1.0f, test.convertToFloat());
+  EXPECT_FALSE(losesInfo);
+  EXPECT_EQ(status, APFloat::opOK);
+
+  test = APFloat(APFloat::Float8E5M2(), "0.0");
+  status = test.convert(APFloat::Float8E4M3FN(), APFloat::rmNearestTiesToEven,
+);
+  EXPECT_EQ(0.0f, test.convertToFloat());
+  EXPECT_FALSE(losesInfo);
+  EXPECT_EQ(status, APFloat::opOK);
+
+  test = APFloat(APFloat::Float8E5M2(), "0x1.Cp8"); // 448
+  status = test.convert(APFloat::Float8E4M3FN(), APFloat::rmNearestTiesToEven,
+);
+  EXPECT_EQ(0x1.Cp8 /* 448 */, test.convertToFloat());
+  EXPECT_FALSE(losesInfo);
+  

[PATCH] D137760: Add FP8 E4M3 support to APFloat.

2022-11-15 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lgtm


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137760

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


[PATCH] D132920: [clang] Silence a false positive GCC -Wunused-but-set-parameter warning with constexpr

2022-08-30 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

thanks


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132920

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


[PATCH] D130964: [X86][BF16] Enable __bf16 for x86 targets.

2022-08-02 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added a comment.

In D130964#3694473 , @rjmccall wrote:

> How are you actually implementing `__bf16` on these targets?  There isn't 
> even hardware support for conversions.

`bf16` -> `float` is really just a bit shift. The other direction gets lowered 
to a libcall, compiler-rt has a conversion function with proper rounding. I 
added some support to make the backend promote all other arithmetic to float, 
but I think that's only enabled on x86 so far.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130964

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


[PATCH] D128571: [X86] Support `_Float16` on SSE2 and up

2022-06-25 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

Thanks


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128571

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


[PATCH] D122173: [libc++][ranges] Implement ranges::transform

2022-04-05 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added inline comments.



Comment at: 
clang/lib/ExtractAPI/Serialization/ranges_transform.module.verify.cpp:1-15
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//

This file doesn't belong in clang/lib. Deleted it in 
302fe7b3c40f7b949f3bebb74997bef9bf74d59f.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122173

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


[PATCH] D116037: [clang-include-fixer] Fix incorrect ranking because of dangling references

2021-12-20 Thread Benjamin Kramer via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGcff192739bb6: [clang-include-fixer] Fix incorrect ranking 
because of dangling references (authored by danlark, committed by bkramer).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116037

Files:
  clang-tools-extra/clang-include-fixer/SymbolIndexManager.cpp


Index: clang-tools-extra/clang-include-fixer/SymbolIndexManager.cpp
===
--- clang-tools-extra/clang-include-fixer/SymbolIndexManager.cpp
+++ clang-tools-extra/clang-include-fixer/SymbolIndexManager.cpp
@@ -8,8 +8,9 @@
 
 #include "SymbolIndexManager.h"
 #include "find-all-symbols/SymbolInfo.h"
-#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringMap.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Path.h"
 
@@ -47,7 +48,7 @@
 
 static void rank(std::vector ,
  llvm::StringRef FileName) {
-  llvm::DenseMap Score;
+  llvm::StringMap Score;
   for (const auto  : Symbols) {
 // Calculate a score from the similarity of the header the symbol is in
 // with the current file and the popularity of the symbol.
@@ -58,14 +59,14 @@
   }
   // Sort by the gathered scores. Use file name as a tie breaker so we can
   // deduplicate.
-  std::sort(Symbols.begin(), Symbols.end(),
-[&](const SymbolAndSignals , const SymbolAndSignals ) {
-  auto AS = Score[A.Symbol.getFilePath()];
-  auto BS = Score[B.Symbol.getFilePath()];
-  if (AS != BS)
-return AS > BS;
-  return A.Symbol.getFilePath() < B.Symbol.getFilePath();
-});
+  llvm::sort(Symbols.begin(), Symbols.end(),
+ [&](const SymbolAndSignals , const SymbolAndSignals ) {
+   auto AS = Score[A.Symbol.getFilePath()];
+   auto BS = Score[B.Symbol.getFilePath()];
+   if (AS != BS)
+ return AS > BS;
+   return A.Symbol.getFilePath() < B.Symbol.getFilePath();
+ });
 }
 
 std::vector


Index: clang-tools-extra/clang-include-fixer/SymbolIndexManager.cpp
===
--- clang-tools-extra/clang-include-fixer/SymbolIndexManager.cpp
+++ clang-tools-extra/clang-include-fixer/SymbolIndexManager.cpp
@@ -8,8 +8,9 @@
 
 #include "SymbolIndexManager.h"
 #include "find-all-symbols/SymbolInfo.h"
-#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringMap.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Path.h"
 
@@ -47,7 +48,7 @@
 
 static void rank(std::vector ,
  llvm::StringRef FileName) {
-  llvm::DenseMap Score;
+  llvm::StringMap Score;
   for (const auto  : Symbols) {
 // Calculate a score from the similarity of the header the symbol is in
 // with the current file and the popularity of the symbol.
@@ -58,14 +59,14 @@
   }
   // Sort by the gathered scores. Use file name as a tie breaker so we can
   // deduplicate.
-  std::sort(Symbols.begin(), Symbols.end(),
-[&](const SymbolAndSignals , const SymbolAndSignals ) {
-  auto AS = Score[A.Symbol.getFilePath()];
-  auto BS = Score[B.Symbol.getFilePath()];
-  if (AS != BS)
-return AS > BS;
-  return A.Symbol.getFilePath() < B.Symbol.getFilePath();
-});
+  llvm::sort(Symbols.begin(), Symbols.end(),
+ [&](const SymbolAndSignals , const SymbolAndSignals ) {
+   auto AS = Score[A.Symbol.getFilePath()];
+   auto BS = Score[B.Symbol.getFilePath()];
+   if (AS != BS)
+ return AS > BS;
+   return A.Symbol.getFilePath() < B.Symbol.getFilePath();
+ });
 }
 
 std::vector
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116037: [clang-include-fixer] Fix incorrect ranking because of dangling references

2021-12-20 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

Thanks


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116037

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


[PATCH] D109865: [NFC] `goto fail` has failed us in the past...

2021-09-21 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

Looks good, thanks


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109865

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


[PATCH] D107760: [clang] Fix warning -Wnon-virtual-dtor.

2021-08-09 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

thanks


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107760

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


[PATCH] D98816: PR49585: Emit the jump destination for a for loop 'continue' from within the scope of the condition variable.

2021-03-19 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added a comment.

Invalid IR generation should be addressed by 
19d2c65ddd757997785163709800f837857f686d 



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98816

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


[PATCH] D98980: [CodeGen] Don't crash on for loops with cond variables and no increment

2021-03-19 Thread Benjamin Kramer 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 rG19d2c65ddd75: [CodeGen] Dont crash on for loops with 
cond variables and no increment (authored by bkramer).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98980

Files:
  clang/lib/CodeGen/CGStmt.cpp
  clang/test/CodeGenCXX/for-cond-var.cpp


Index: clang/test/CodeGenCXX/for-cond-var.cpp
===
--- clang/test/CodeGenCXX/for-cond-var.cpp
+++ clang/test/CodeGenCXX/for-cond-var.cpp
@@ -123,3 +123,16 @@
   // CHECK [[for_end]]:
   // CHECK: ret void
 }
+
+// CHECK: define {{.*}} void @_Z16incless_for_loopv(
+void incless_for_loop() {
+  // CHECK: br label %[[for_cond:.*]]
+  // CHECK: [[for_cond]]:
+  // CHECK:   br i1 {{.*}}, label %[[for_body:.*]], label %[[for_end:.*]]
+  // CHECK: [[for_body]]:
+  // CHECK:   br label %[[for_cond]]
+  // CHECK: [[for_end]]:
+  // CHECK:   ret void
+  // CHECK: }
+  for (; int b = 0;) continue;
+}
Index: clang/lib/CodeGen/CGStmt.cpp
===
--- clang/lib/CodeGen/CGStmt.cpp
+++ clang/lib/CodeGen/CGStmt.cpp
@@ -992,7 +992,7 @@
 
   // We have entered the condition variable's scope, so we're now able to
   // jump to the continue block.
-  Continue = getJumpDestInCurrentScope("for.inc");
+  Continue = S.getInc() ? getJumpDestInCurrentScope("for.inc") : CondDest;
   BreakContinueStack.back().ContinueBlock = Continue;
 }
 


Index: clang/test/CodeGenCXX/for-cond-var.cpp
===
--- clang/test/CodeGenCXX/for-cond-var.cpp
+++ clang/test/CodeGenCXX/for-cond-var.cpp
@@ -123,3 +123,16 @@
   // CHECK [[for_end]]:
   // CHECK: ret void
 }
+
+// CHECK: define {{.*}} void @_Z16incless_for_loopv(
+void incless_for_loop() {
+  // CHECK: br label %[[for_cond:.*]]
+  // CHECK: [[for_cond]]:
+  // CHECK:   br i1 {{.*}}, label %[[for_body:.*]], label %[[for_end:.*]]
+  // CHECK: [[for_body]]:
+  // CHECK:   br label %[[for_cond]]
+  // CHECK: [[for_end]]:
+  // CHECK:   ret void
+  // CHECK: }
+  for (; int b = 0;) continue;
+}
Index: clang/lib/CodeGen/CGStmt.cpp
===
--- clang/lib/CodeGen/CGStmt.cpp
+++ clang/lib/CodeGen/CGStmt.cpp
@@ -992,7 +992,7 @@
 
   // We have entered the condition variable's scope, so we're now able to
   // jump to the continue block.
-  Continue = getJumpDestInCurrentScope("for.inc");
+  Continue = S.getInc() ? getJumpDestInCurrentScope("for.inc") : CondDest;
   BreakContinueStack.back().ContinueBlock = Continue;
 }
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D98980: [CodeGen] Don't crash on for loops with cond variables and no increment

2021-03-19 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added a comment.

Landing this as it's a pretty bad crasher. Feel free to point out all my 
mistakes in post-commit review :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98980

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


[PATCH] D98980: [CodeGen] Don't crash on for loops with cond variables and no increment

2021-03-19 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer created this revision.
bkramer added reviewers: rupprecht, rjmccall, rsmith.
bkramer requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This looks like an oversight from a875721d8a2d 
, creating 
IR that refers
to `for.inc` even if it doesn't exist.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98980

Files:
  clang/lib/CodeGen/CGStmt.cpp
  clang/test/CodeGenCXX/for-cond-var.cpp


Index: clang/test/CodeGenCXX/for-cond-var.cpp
===
--- clang/test/CodeGenCXX/for-cond-var.cpp
+++ clang/test/CodeGenCXX/for-cond-var.cpp
@@ -123,3 +123,16 @@
   // CHECK [[for_end]]:
   // CHECK: ret void
 }
+
+// CHECK: define {{.*}} void @_Z16incless_for_loopv(
+void incless_for_loop() {
+  // CHECK: br label %[[for_cond:.*]]
+  // CHECK: [[for_cond]]:
+  // CHECK:   br i1 {{.*}}, label %[[for_body:.*]], label %[[for_end:.*]]
+  // CHECK: [[for_body]]:
+  // CHECK:   br label %[[for_cond]]
+  // CHECK: [[for_end]]:
+  // CHECK:   ret void
+  // CHECK: }
+  for (; int b = 0;) continue;
+}
Index: clang/lib/CodeGen/CGStmt.cpp
===
--- clang/lib/CodeGen/CGStmt.cpp
+++ clang/lib/CodeGen/CGStmt.cpp
@@ -992,7 +992,7 @@
 
   // We have entered the condition variable's scope, so we're now able to
   // jump to the continue block.
-  Continue = getJumpDestInCurrentScope("for.inc");
+  Continue = S.getInc() ? getJumpDestInCurrentScope("for.inc") : CondDest;
   BreakContinueStack.back().ContinueBlock = Continue;
 }
 


Index: clang/test/CodeGenCXX/for-cond-var.cpp
===
--- clang/test/CodeGenCXX/for-cond-var.cpp
+++ clang/test/CodeGenCXX/for-cond-var.cpp
@@ -123,3 +123,16 @@
   // CHECK [[for_end]]:
   // CHECK: ret void
 }
+
+// CHECK: define {{.*}} void @_Z16incless_for_loopv(
+void incless_for_loop() {
+  // CHECK: br label %[[for_cond:.*]]
+  // CHECK: [[for_cond]]:
+  // CHECK:   br i1 {{.*}}, label %[[for_body:.*]], label %[[for_end:.*]]
+  // CHECK: [[for_body]]:
+  // CHECK:   br label %[[for_cond]]
+  // CHECK: [[for_end]]:
+  // CHECK:   ret void
+  // CHECK: }
+  for (; int b = 0;) continue;
+}
Index: clang/lib/CodeGen/CGStmt.cpp
===
--- clang/lib/CodeGen/CGStmt.cpp
+++ clang/lib/CodeGen/CGStmt.cpp
@@ -992,7 +992,7 @@
 
   // We have entered the condition variable's scope, so we're now able to
   // jump to the continue block.
-  Continue = getJumpDestInCurrentScope("for.inc");
+  Continue = S.getInc() ? getJumpDestInCurrentScope("for.inc") : CondDest;
   BreakContinueStack.back().ContinueBlock = Continue;
 }
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D92297: [CodeGen] -fno-delete-null-pointer-checks: change dereferenceable to dereferenceable_or_null

2020-11-30 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

While it would be nice for `dereferenceable` to not imply nonnull, the 
implementation currently assumes it does and will speculate loads based on 
that. See `llvm::Value::getPointerDereferenceableBytes` and its users.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92297

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


[PATCH] D17993: [CodeGen] Apply 'nonnull' and 'dereferenceable(N)' to 'this' pointer arguments.

2020-11-21 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added a comment.

In D17993#2409401 , @brooksmoses wrote:

> So, I have bad news: This causes OpenJDK to segfault.  The relevant code is 
> here:
> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/memory/arena.cpp#L311
>
>   void Arena::destruct_contents() {
> if (UseMallocOnly && _first != NULL) {
>   char* end = _first->next() ? _first->top() : _hwm;
>   free_malloced_objects(_first, _first->bottom(), end, _hwm);
> }
> // reset size before chop to avoid a rare racing condition
> // that can have total arena memory exceed total chunk memory
> set_size_in_bytes(0);
> _first->chop();
> reset();
>   }
>
> I've also seen a segfault in Verilator that root-causes to this patch, though 
> I haven't yet tracked that down to the source code.
>
> I hate to say it, but is this a significant enough problem to call for a 
> (temporary, I hope) rollback?

I don't see why this would be enough for a rollback, jdk is supposed to build 
with `-fno-delete-null-pointer-checks`, which disables this optimization:
https://github.com/openjdk/jdk/blob/master/make/autoconf/flags-cflags.m4#L842

Is the build system not setting this when using Clang?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D17993

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


[PATCH] D89708: Move clang/Tooling/Core/Lookup.h to clang/Tooling/Refactoring/Lookup.h

2020-10-19 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

thanks


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89708

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


[PATCH] D81865: [clang] Use string tables for static diagnostic descriptions

2020-07-27 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

Nice, those relocations have annoyed me for years. I'm worried about whether 
the way you're accessing StaticDiagInfoDescriptionStringTable might be 
undefined behavior. I won't block this change on that though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81865



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


[PATCH] D78213: [libclang]: visit BindingDecl in DecompositionDecl

2020-05-02 Thread Benjamin Kramer via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4597e3bd475b: [libclang]: visit BindingDecl in 
DecompositionDecl (authored by milianw, committed by bkramer).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78213

Files:
  clang/test/Index/cxx17-structured-binding.cpp
  clang/tools/libclang/CIndex.cpp
  clang/tools/libclang/CursorVisitor.h


Index: clang/tools/libclang/CursorVisitor.h
===
--- clang/tools/libclang/CursorVisitor.h
+++ clang/tools/libclang/CursorVisitor.h
@@ -241,6 +241,7 @@
   bool VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D);
   bool VisitStaticAssertDecl(StaticAssertDecl *D);
   bool VisitFriendDecl(FriendDecl *D);
+  bool VisitDecompositionDecl(DecompositionDecl *D);
 
   // Name visitor
   bool VisitDeclarationNameInfo(DeclarationNameInfo Name);
Index: clang/tools/libclang/CIndex.cpp
===
--- clang/tools/libclang/CIndex.cpp
+++ clang/tools/libclang/CIndex.cpp
@@ -1295,6 +1295,14 @@
   return false;
 }
 
+bool CursorVisitor::VisitDecompositionDecl(DecompositionDecl *D) {
+  for (auto *B : D->bindings()) {
+if (Visit(MakeCXCursor(B, TU, RegionOfInterest)))
+  return true;
+  }
+  return VisitVarDecl(D);
+}
+
 bool CursorVisitor::VisitDeclarationNameInfo(DeclarationNameInfo Name) {
   switch (Name.getName().getNameKind()) {
   case clang::DeclarationName::Identifier:
Index: clang/test/Index/cxx17-structured-binding.cpp
===
--- /dev/null
+++ clang/test/Index/cxx17-structured-binding.cpp
@@ -0,0 +1,25 @@
+// Test is line- and column-sensitive; see below.
+int main() {
+  int a[2] = {1, 2};
+  auto [x, y] = a;
+}
+
+// RUN: c-index-test -test-load-source all -std=c++17 %s | FileCheck 
-check-prefix=CHECK-LOAD %s
+// CHECK-LOAD: cxx17-structured-binding.cpp:2:5: FunctionDecl=main:2:5 
(Definition) Extent=[2:1 - 5:2]
+// CHECK-LOAD: cxx17-structured-binding.cpp:2:12: CompoundStmt= Extent=[2:12 - 
5:2]
+// CHECK-LOAD: cxx17-structured-binding.cpp:3:3: DeclStmt= Extent=[3:3 - 3:21]
+// CHECK-LOAD: cxx17-structured-binding.cpp:3:7: VarDecl=a:3:7 (Definition) 
Extent=[3:3 - 3:20]
+// CHECK-LOAD: cxx17-structured-binding.cpp:3:9: IntegerLiteral= Extent=[3:9 - 
3:10]
+// CHECK-LOAD: cxx17-structured-binding.cpp:3:14: InitListExpr= Extent=[3:14 - 
3:20]
+// CHECK-LOAD: cxx17-structured-binding.cpp:3:15: IntegerLiteral= Extent=[3:15 
- 3:16]
+// CHECK-LOAD: cxx17-structured-binding.cpp:3:18: IntegerLiteral= Extent=[3:18 
- 3:19]
+// CHECK-LOAD: cxx17-structured-binding.cpp:4:3: DeclStmt= Extent=[4:3 - 4:19]
+// CHECK-LOAD: cxx17-structured-binding.cpp:4:8: UnexposedDecl=[x, y]:4:8 
(Definition) Extent=[4:3 - 4:18]
+// CHECK-LOAD: cxx17-structured-binding.cpp:4:9: UnexposedDecl=x:4:9 
(Definition) Extent=[4:9 - 4:10]
+// CHECK-LOAD: cxx17-structured-binding.cpp:4:12: UnexposedDecl=y:4:12 
(Definition) Extent=[4:12 - 4:13]
+// CHECK-LOAD: cxx17-structured-binding.cpp:4:17: UnexposedExpr= Extent=[4:17 
- 4:18]
+// CHECK-LOAD: cxx17-structured-binding.cpp:4:17: DeclRefExpr=a:3:7 
Extent=[4:17 - 4:18]
+// CHECK-LOAD: cxx17-structured-binding.cpp:4:17: UnexposedExpr= Extent=[4:17 
- 4:9]
+// CHECK-LOAD: cxx17-structured-binding.cpp:4:17: ArraySubscriptExpr= 
Extent=[4:17 - 4:9]
+// CHECK-LOAD: cxx17-structured-binding.cpp:4:17: UnexposedExpr=a:3:7 
Extent=[4:17 - 4:18]
+// CHECK-LOAD: cxx17-structured-binding.cpp:4:17: DeclRefExpr=a:3:7 
Extent=[4:17 - 4:18]


Index: clang/tools/libclang/CursorVisitor.h
===
--- clang/tools/libclang/CursorVisitor.h
+++ clang/tools/libclang/CursorVisitor.h
@@ -241,6 +241,7 @@
   bool VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D);
   bool VisitStaticAssertDecl(StaticAssertDecl *D);
   bool VisitFriendDecl(FriendDecl *D);
+  bool VisitDecompositionDecl(DecompositionDecl *D);
 
   // Name visitor
   bool VisitDeclarationNameInfo(DeclarationNameInfo Name);
Index: clang/tools/libclang/CIndex.cpp
===
--- clang/tools/libclang/CIndex.cpp
+++ clang/tools/libclang/CIndex.cpp
@@ -1295,6 +1295,14 @@
   return false;
 }
 
+bool CursorVisitor::VisitDecompositionDecl(DecompositionDecl *D) {
+  for (auto *B : D->bindings()) {
+if (Visit(MakeCXCursor(B, TU, RegionOfInterest)))
+  return true;
+  }
+  return VisitVarDecl(D);
+}
+
 bool CursorVisitor::VisitDeclarationNameInfo(DeclarationNameInfo Name) {
   switch (Name.getName().getNameKind()) {
   case clang::DeclarationName::Identifier:
Index: clang/test/Index/cxx17-structured-binding.cpp
===
--- /dev/null
+++ clang/test/Index/cxx17-structured-binding.cpp
@@ -0,0 +1,25 @@
+// Test is 

[PATCH] D78214: [libclang]: visit C++17 if init statements

2020-05-02 Thread Benjamin Kramer via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG08e181264318: [libclang]: visit C++17 if init statements 
(authored by milianw, committed by bkramer).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78214

Files:
  clang/test/Index/cxx17-if-with-initializer.cpp
  clang/tools/libclang/CIndex.cpp


Index: clang/tools/libclang/CIndex.cpp
===
--- clang/tools/libclang/CIndex.cpp
+++ clang/tools/libclang/CIndex.cpp
@@ -2680,6 +2680,7 @@
   AddStmt(If->getElse());
   AddStmt(If->getThen());
   AddStmt(If->getCond());
+  AddStmt(If->getInit());
   AddDecl(If->getConditionVariable());
 }
 void EnqueueVisitor::VisitInitListExpr(const InitListExpr *IE) {
Index: clang/test/Index/cxx17-if-with-initializer.cpp
===
--- /dev/null
+++ clang/test/Index/cxx17-if-with-initializer.cpp
@@ -0,0 +1,17 @@
+// Test is line- and column-sensitive; see below.
+
+void foo() {
+  if (bool bar = true; bar) {
+  }
+}
+
+// RUN: c-index-test -test-load-source all -std=c++17 %s | FileCheck 
-check-prefix=CHECK-LOAD %s
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:3:6: FunctionDecl=foo:3:6 
(Definition) Extent=[3:1 - 6:2]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:3:12: CompoundStmt= Extent=[3:12 
- 6:2]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:4:3: IfStmt= Extent=[4:3 - 5:4]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:4:7: DeclStmt= Extent=[4:7 - 4:23]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:4:12: VarDecl=bar:4:12 
(Definition) Extent=[4:7 - 4:22]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:4:18: CXXBoolLiteralExpr= 
Extent=[4:18 - 4:22]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:4:24: UnexposedExpr=bar:4:12 
Extent=[4:24 - 4:27]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:4:24: DeclRefExpr=bar:4:12 
Extent=[4:24 - 4:27]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:4:29: CompoundStmt= Extent=[4:29 
- 5:4]


Index: clang/tools/libclang/CIndex.cpp
===
--- clang/tools/libclang/CIndex.cpp
+++ clang/tools/libclang/CIndex.cpp
@@ -2680,6 +2680,7 @@
   AddStmt(If->getElse());
   AddStmt(If->getThen());
   AddStmt(If->getCond());
+  AddStmt(If->getInit());
   AddDecl(If->getConditionVariable());
 }
 void EnqueueVisitor::VisitInitListExpr(const InitListExpr *IE) {
Index: clang/test/Index/cxx17-if-with-initializer.cpp
===
--- /dev/null
+++ clang/test/Index/cxx17-if-with-initializer.cpp
@@ -0,0 +1,17 @@
+// Test is line- and column-sensitive; see below.
+
+void foo() {
+  if (bool bar = true; bar) {
+  }
+}
+
+// RUN: c-index-test -test-load-source all -std=c++17 %s | FileCheck -check-prefix=CHECK-LOAD %s
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:3:6: FunctionDecl=foo:3:6 (Definition) Extent=[3:1 - 6:2]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:3:12: CompoundStmt= Extent=[3:12 - 6:2]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:4:3: IfStmt= Extent=[4:3 - 5:4]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:4:7: DeclStmt= Extent=[4:7 - 4:23]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:4:12: VarDecl=bar:4:12 (Definition) Extent=[4:7 - 4:22]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:4:18: CXXBoolLiteralExpr= Extent=[4:18 - 4:22]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:4:24: UnexposedExpr=bar:4:12 Extent=[4:24 - 4:27]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:4:24: DeclRefExpr=bar:4:12 Extent=[4:24 - 4:27]
+// CHECK-LOAD: cxx17-if-with-initializer.cpp:4:29: CompoundStmt= Extent=[4:29 - 5:4]
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D78214: [libclang]: visit C++17 if init statements

2020-05-02 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

looks good


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78214



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


[PATCH] D78213: [libclang]: visit BindingDecl in DecompositionDecl

2020-05-02 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

looks good


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78213



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


[PATCH] D77420: Also look for devtoolset-9 gcc toolchain

2020-04-16 Thread Benjamin Kramer via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7b9c6c16c33d: Also look for devtoolset-9 gcc toolchain 
(authored by stephan.dollberg, committed by bkramer).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77420

Files:
  clang/lib/Driver/ToolChains/Gnu.cpp


Index: clang/lib/Driver/ToolChains/Gnu.cpp
===
--- clang/lib/Driver/ToolChains/Gnu.cpp
+++ clang/lib/Driver/ToolChains/Gnu.cpp
@@ -1977,6 +1977,7 @@
   // Non-Solaris is much simpler - most systems just go with "/usr".
   if (SysRoot.empty() && TargetTriple.getOS() == llvm::Triple::Linux) {
 // Yet, still look for RHEL devtoolsets.
+Prefixes.push_back("/opt/rh/devtoolset-9/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-8/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-7/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-6/root/usr");


Index: clang/lib/Driver/ToolChains/Gnu.cpp
===
--- clang/lib/Driver/ToolChains/Gnu.cpp
+++ clang/lib/Driver/ToolChains/Gnu.cpp
@@ -1977,6 +1977,7 @@
   // Non-Solaris is much simpler - most systems just go with "/usr".
   if (SysRoot.empty() && TargetTriple.getOS() == llvm::Triple::Linux) {
 // Yet, still look for RHEL devtoolsets.
+Prefixes.push_back("/opt/rh/devtoolset-9/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-8/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-7/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-6/root/usr");
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D77420: Also look for devtoolset-9 gcc toolchain

2020-04-15 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

looks good


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77420



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


[PATCH] D76703: [ARM][CMSE] Fix clang/test/Driver/save-temps.c test.

2020-03-24 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

looks good


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76703



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


[PATCH] D76272: Fix memtag test.

2020-03-17 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

Right, we don't have names for values in release builds.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76272



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


[PATCH] D74954: Add a basic tiling pass for parallel loops

2020-02-24 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer updated this revision to Diff 246167.
bkramer added a comment.
Herald added a subscriber: wuzish.
Herald added a reviewer: mclow.lists.

- WTF phab?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74954

Files:
  mlir/include/mlir/Dialect/LoopOps/Passes.h
  mlir/include/mlir/InitAllPasses.h
  mlir/lib/Dialect/LoopOps/Transforms/CMakeLists.txt
  mlir/lib/Dialect/LoopOps/Transforms/ParallelLoopTiling.cpp
  mlir/test/Dialect/Loops/parallel-loop-tiling.mlir

Index: mlir/test/Dialect/Loops/parallel-loop-tiling.mlir
===
--- /dev/null
+++ mlir/test/Dialect/Loops/parallel-loop-tiling.mlir
@@ -0,0 +1,80 @@
+// RUN: mlir-opt %s -pass-pipeline='func(parallel-loop-tiling{parallel-loop-tile-sizes=1,4})' -split-input-file | FileCheck %s --dump-input-on-failure
+
+func @parallel_loop(%arg0 : index, %arg1 : index, %arg2 : index,
+%arg3 : index, %arg4 : index, %arg5 : index,
+		%A: memref, %B: memref,
+%C: memref, %result: memref) {
+  loop.parallel (%i0, %i1) = (%arg0, %arg1) to (%arg2, %arg3) step (%arg4, %arg5) {
+%B_elem = load %B[%i0, %i1] : memref
+%C_elem = load %C[%i0, %i1] : memref
+%sum_elem = addf %B_elem, %C_elem : f32
+store %sum_elem, %result[%i0, %i1] : memref
+  }
+  return
+}
+
+// CHECK:   #map0 = affine_map<(d0, d1, d2) -> (d0, d1 - d2)>
+// CHECK-LABEL:   func @parallel_loop(
+// CHECK-SAME:[[VAL_0:%.*]]: index, [[VAL_1:%.*]]: index, [[VAL_2:%.*]]: index, [[VAL_3:%.*]]: index, [[VAL_4:%.*]]: index, [[VAL_5:%.*]]: index, [[VAL_6:%.*]]: memref, [[VAL_7:%.*]]: memref, [[VAL_8:%.*]]: memref, [[VAL_9:%.*]]: memref) {
+// CHECK:   [[VAL_10:%.*]] = constant 0 : index
+// CHECK:   [[VAL_11:%.*]] = constant 1 : index
+// CHECK:   [[VAL_12:%.*]] = constant 4 : index
+// CHECK:   [[VAL_13:%.*]] = muli [[VAL_4]], [[VAL_11]] : index
+// CHECK:   [[VAL_14:%.*]] = muli [[VAL_5]], [[VAL_12]] : index
+// CHECK:   loop.parallel ([[VAL_15:%.*]], [[VAL_16:%.*]]) = ([[VAL_0]], [[VAL_1]]) to ([[VAL_2]], [[VAL_3]]) step ([[VAL_13]], [[VAL_14]]) {
+// CHECK: [[VAL_17:%.*]] = affine.min #map0([[VAL_11]], [[VAL_2]], [[VAL_15]])
+// CHECK: [[VAL_18:%.*]] = affine.min #map0([[VAL_12]], [[VAL_3]], [[VAL_16]])
+// CHECK: loop.parallel ([[VAL_19:%.*]], [[VAL_20:%.*]]) = ([[VAL_10]], [[VAL_10]]) to ([[VAL_17]], [[VAL_18]]) step ([[VAL_4]], [[VAL_5]]) {
+// CHECK:   [[VAL_21:%.*]] = load [[VAL_7]]{{\[}}[[VAL_19]], [[VAL_20]]] : memref
+// CHECK:   [[VAL_22:%.*]] = load [[VAL_8]]{{\[}}[[VAL_19]], [[VAL_20]]] : memref
+// CHECK:   [[VAL_23:%.*]] = addf [[VAL_21]], [[VAL_22]] : f32
+// CHECK:   store [[VAL_23]], [[VAL_9]]{{\[}}[[VAL_19]], [[VAL_20]]] : memref
+// CHECK: }
+// CHECK:   }
+// CHECK:   return
+
+// -
+
+func @tile_nested_innermost() {
+  %c2 = constant 2 : index
+  %c0 = constant 0 : index
+  %c1 = constant 1 : index
+  loop.parallel (%i, %j) = (%c0, %c0) to (%c2, %c2) step (%c1, %c1) {
+loop.parallel (%k, %l) = (%c0, %c0) to (%c2, %c2) step (%c1, %c1) {
+}
+  }
+  loop.parallel (%i, %j) = (%c0, %c0) to (%c2, %c2) step (%c1, %c1) {
+  }
+  return
+}
+
+// CHECK-LABEL:   func @tile_nested_innermost() {
+// CHECK:   [[VAL_24:%.*]] = constant 2 : index
+// CHECK:   [[VAL_25:%.*]] = constant 0 : index
+// CHECK:   [[VAL_26:%.*]] = constant 1 : index
+// CHECK:   loop.parallel ([[VAL_27:%.*]], [[VAL_28:%.*]]) = ([[VAL_25]], [[VAL_25]]) to ([[VAL_24]], [[VAL_24]]) step ([[VAL_26]], [[VAL_26]]) {
+// CHECK: [[VAL_29:%.*]] = constant 0 : index
+// CHECK: [[VAL_30:%.*]] = constant 1 : index
+// CHECK: [[VAL_31:%.*]] = constant 4 : index
+// CHECK: [[VAL_32:%.*]] = muli [[VAL_26]], [[VAL_30]] : index
+// CHECK: [[VAL_33:%.*]] = muli [[VAL_26]], [[VAL_31]] : index
+// CHECK: loop.parallel ([[VAL_34:%.*]], [[VAL_35:%.*]]) = ([[VAL_25]], [[VAL_25]]) to ([[VAL_24]], [[VAL_24]]) step ([[VAL_32]], [[VAL_33]]) {
+// CHECK:   [[VAL_36:%.*]] = affine.min #map0([[VAL_30]], [[VAL_24]], [[VAL_34]])
+// CHECK:   [[VAL_37:%.*]] = affine.min #map0([[VAL_31]], [[VAL_24]], [[VAL_35]])
+// CHECK:   loop.parallel ([[VAL_38:%.*]], [[VAL_39:%.*]]) = ([[VAL_29]], [[VAL_29]]) to ([[VAL_36]], [[VAL_37]]) step ([[VAL_26]], [[VAL_26]]) {
+// CHECK:   }
+// CHECK: }
+// CHECK:   }
+// CHECK:   [[VAL_40:%.*]] = constant 0 : index
+// CHECK:   [[VAL_41:%.*]] = constant 1 : index
+// CHECK:   [[VAL_42:%.*]] = constant 4 : index
+// CHECK:   [[VAL_43:%.*]] = muli [[VAL_26]], [[VAL_41]] : index
+// CHECK:   [[VAL_44:%.*]] = muli [[VAL_26]], 

[PATCH] D74954: Add a basic tiling pass for parallel loops

2020-02-24 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer updated this revision to Diff 246166.
bkramer marked 4 inline comments as done.
bkramer added a comment.
Herald added subscribers: libc-commits, libcxx-commits, lldb-commits, 
Sanitizers, cfe-commits, bader, kerbowa, csigg, usaxena95, jdoerfert, ormris, 
jsji, kadircet, rupprecht, jfb, arphaman, dexonsmith, mgrang, jkorous, MaskRay, 
kbarton, aheejin, hiraditya, jgravelle-google, krytarowski, arichardson, 
sbc100, nhaehnle, jvesely, nemanjai, emaste, dschuff, arsenm.
Herald added a reviewer: espindola.
Herald added a reviewer: alexshap.
Herald added a reviewer: rupprecht.
Herald added a reviewer: jhenderson.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
Herald added a reviewer: mravishankar.
Herald added a reviewer: antiagainst.
Herald added a reviewer: rriddle.
Herald added a reviewer: antiagainst.
Herald added a reviewer: uenoku.
Herald added projects: clang, Sanitizers, LLDB, libc++, libc-project.

- Address moar comments


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74954

Files:
  clang-tools-extra/clangd/ClangdServer.cpp
  clang-tools-extra/clangd/ClangdServer.h
  clang-tools-extra/clangd/Hover.cpp
  clang-tools-extra/clangd/Selection.cpp
  clang-tools-extra/clangd/Selection.h
  clang-tools-extra/clangd/SemanticSelection.cpp
  clang-tools-extra/clangd/XRefs.cpp
  clang-tools-extra/clangd/refactor/Rename.cpp
  clang-tools-extra/clangd/refactor/Tweak.cpp
  clang-tools-extra/clangd/refactor/Tweak.h
  clang-tools-extra/clangd/unittests/FindTargetTests.cpp
  clang-tools-extra/clangd/unittests/HoverTests.cpp
  clang-tools-extra/clangd/unittests/SelectionTests.cpp
  clang-tools-extra/clangd/unittests/TweakTesting.cpp
  clang-tools-extra/clangd/unittests/TweakTests.cpp
  clang/include/clang/Driver/CC1Options.td
  clang/include/clang/Driver/Options.td
  clang/include/clang/Parse/Parser.h
  clang/lib/Basic/Targets/AArch64.cpp
  clang/lib/Basic/Targets/X86.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Driver/ToolChains/Darwin.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/lib/Sema/SemaCast.cpp
  clang/test/CodeGen/codemodels.c
  clang/test/Driver/clang_f_opts.c
  clang/test/Driver/code-model.c
  clang/test/Driver/mbackchain.c
  clang/test/Driver/mcmodel.c
  clang/test/Preprocessor/aarch64-target-features.c
  clang/test/Preprocessor/init-aarch64.c
  clang/test/Preprocessor/init.c
  clang/test/Sema/MicrosoftExtensions.c
  clang/test/Sema/cast.c
  clang/test/SemaCXX/cstyle-cast.cpp
  compiler-rt/lib/profile/GCDAProfiling.c
  libc/CMakeLists.txt
  libc/cmake/modules/LLVMLibCRules.cmake
  libc/docs/fuzzing.rst
  libc/docs/source_layout.rst
  libc/fuzzing/CMakeLists.txt
  libc/fuzzing/string/CMakeLists.txt
  libc/fuzzing/string/strcpy_fuzz.cpp
  libc/src/signal/linux/raise.cpp
  libc/utils/CPP/README.md
  libc/utils/HdrGen/README.md
  libc/utils/UnitTest/README.md
  libcxx/test/support/count_new.h
  libcxx/test/support/type_id.h
  lld/ELF/Writer.cpp
  lld/test/ELF/shuffle-sections-init-fini.s
  lld/test/ELF/shuffle-sections.s
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
  
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
  lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
  lldb/test/API/lang/cpp/operators/main.cpp
  lldb/test/Shell/SymbolFile/Breakpad/Inputs/basic-elf.yaml
  lldb/test/Shell/SymbolFile/DWARF/dwp-debug-types.s
  lldb/test/Shell/SymbolFile/DWARF/dwp.s
  lldb/test/Shell/lit-lldb-init.in
  llvm/docs/Extensions.rst
  llvm/docs/LangRef.rst
  llvm/docs/LoopTerminology.rst
  llvm/include/llvm/ADT/STLExtras.h
  llvm/include/llvm/Analysis/CFGPrinter.h
  llvm/include/llvm/Analysis/LoopInfo.h
  llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h
  llvm/include/llvm/CodeGen/ISDOpcodes.h
  llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h
  llvm/include/llvm/CodeGen/SelectionDAG.h
  llvm/include/llvm/CodeGen/TargetLowering.h
  llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
  llvm/include/llvm/ExecutionEngine/JITLink/MachO_x86_64.h
  llvm/include/llvm/ExecutionEngine/Orc/Core.h
  llvm/include/llvm/ExecutionEngine/Orc/OrcError.h
  llvm/include/llvm/IR/Intrinsics.td
  

[PATCH] D74423: Use C++14-style return type deduction in clang.

2020-02-11 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74423



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


[PATCH] D74414: Use std::foo_t rather than std::foo in clang.

2020-02-11 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74414



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


[PATCH] D74412: Fix SFINAE in CFG.cpp.

2020-02-11 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74412



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


[PATCH] D74384: Use std::foo_t rather than std::foo in LLVM.

2020-02-11 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.

Push and watch the bots


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74384



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


[PATCH] D70902: Fix compatibility with python3 of clang-include-fixer.py

2019-12-03 Thread Benjamin Kramer via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGaa189ed25fbd: Fix compatibility with python3 of 
clang-include-fixer.py (authored by Yannick Brehon yanni...@google.com, 
committed by bkramer).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70902

Files:
  clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py


Index: clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py
===
--- clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py
+++ clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py
@@ -211,7 +211,7 @@
 InsertHeaderToVimBuffer(include_fixer_context, text)
 print("Added #include {0} for {1}.".format(selected, symbol))
   except Exception as error:
-print(error.message, file=sys.stderr)
+print(error, file=sys.stderr)
   return
 
 


Index: clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py
===
--- clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py
+++ clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py
@@ -211,7 +211,7 @@
 InsertHeaderToVimBuffer(include_fixer_context, text)
 print("Added #include {0} for {1}.".format(selected, symbol))
   except Exception as error:
-print(error.message, file=sys.stderr)
+print(error, file=sys.stderr)
   return
 
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70902: Fix compatibility with python3 of clang-include-fixer.py

2019-12-03 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70902



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


[PATCH] D70488: [InstCombine] Infer fast math flags on fadd/fsub/fmul/fcmp

2019-11-21 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added a comment.

In D70488#1753897 , @mcberg2017 wrote:

> For us this would be an impediment as we have math models that want ieee 
> behavior while relaxing precision.  Adding nnan or ninf would obstruct those 
> choices.


Mind elaborating why nnan/ninf are problematic for you? They're supposed to be 
a hint to the optimizer and can be dropped any time.

In D70488#1753832 , @spatel wrote:

> I like the idea, but I'd be more comfortable reviewing the diffs in stages, 
> so we know that the test coverage for the value tracking calls is good. So 
> I'd prefer if we split this somehow - either by the opcode callers (fadd, 
> fsub, fmul...) or the the FMF analysis (nnan, nsz, ninf). That raises a few 
> questions:
>
> 1. Why aren't fdiv and frem included?


We currently cannot infer anything for fdiv/frem in isKnownNeverNaN/Inf so 
there's no way to test it.

> 2. Can we infer FMF for FP intrinsics/libcalls/select/phi? (follow-on patches)

Yeah, that's a logical followup

> 3. We're moving away from FMF on fcmp (recent step: rGebf9bf2cbc8f 
> ), so is 
> it worth including starting from fcmp, or can we wait for that part to 
> settle? (Side question may be if/when we're going to allow FMF on 
> fptrunc/fpextend).

I'll drop fcmp then and split this up once we know that it's actually a 
direction we want to pursue.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70488



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


[PATCH] D70518: [clang-include-fixer] Suppress cmd prompt from Vim on Windows

2019-11-21 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70518



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


[PATCH] D70488: [InstCombine] Infer fast math flags on fadd/fsub/fmul/fcmp

2019-11-20 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer updated this revision to Diff 230245.
bkramer added a comment.

Fix condition


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70488

Files:
  clang/test/CodeGen/builtins-systemz-zvector.c
  llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/lib/Transforms/InstCombine/InstCombineInternal.h
  llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/test/Transforms/InstCombine/add-sitofp.ll
  llvm/test/Transforms/InstCombine/cast-int-fcmp-eq-0.ll
  llvm/test/Transforms/InstCombine/fadd-fsub-factor.ll
  llvm/test/Transforms/InstCombine/fast-math.ll
  llvm/test/Transforms/InstCombine/fcmp.ll
  llvm/test/Transforms/InstCombine/known-never-nan.ll
  llvm/test/Transforms/InstCombine/minmax-fp.ll
  llvm/test/Transforms/InstCombine/pow_fp_int.ll

Index: llvm/test/Transforms/InstCombine/pow_fp_int.ll
===
--- llvm/test/Transforms/InstCombine/pow_fp_int.ll
+++ llvm/test/Transforms/InstCombine/pow_fp_int.ll
@@ -91,7 +91,7 @@
 define double @pow_uitofp_const_base_power_of_2_fast(i31 %x) {
 ; CHECK-LABEL: @pow_uitofp_const_base_power_of_2_fast(
 ; CHECK-NEXT:[[SUBFP:%.*]] = uitofp i31 [[X:%.*]] to float
-; CHECK-NEXT:[[MUL:%.*]] = fmul afn float [[SUBFP]], 4.00e+00
+; CHECK-NEXT:[[MUL:%.*]] = fmul nnan afn float [[SUBFP]], 4.00e+00
 ; CHECK-NEXT:[[EXP2:%.*]] = call afn float @llvm.exp2.f32(float [[MUL]])
 ; CHECK-NEXT:[[RES:%.*]] = fpext float [[EXP2]] to double
 ; CHECK-NEXT:ret double [[RES]]
@@ -383,7 +383,7 @@
 define double @pow_uitofp_const_base_power_of_2_no_fast(i32 %x) {
 ; CHECK-LABEL: @pow_uitofp_const_base_power_of_2_no_fast(
 ; CHECK-NEXT:[[SUBFP:%.*]] = uitofp i32 [[X:%.*]] to float
-; CHECK-NEXT:[[MUL:%.*]] = fmul float [[SUBFP]], 4.00e+00
+; CHECK-NEXT:[[MUL:%.*]] = fmul nnan float [[SUBFP]], 4.00e+00
 ; CHECK-NEXT:[[EXP2:%.*]] = call float @llvm.exp2.f32(float [[MUL]])
 ; CHECK-NEXT:[[RES:%.*]] = fpext float [[EXP2]] to double
 ; CHECK-NEXT:ret double [[RES]]
Index: llvm/test/Transforms/InstCombine/minmax-fp.ll
===
--- llvm/test/Transforms/InstCombine/minmax-fp.ll
+++ llvm/test/Transforms/InstCombine/minmax-fp.ll
@@ -273,7 +273,7 @@
 ; CHECK-LABEL: define {{[^@]+}}@fsub_fmax(
 ; CHECK-NEXT:[[COND_INV:%.*]] = fcmp nnan nsz ogt <2 x float> [[X:%.*]], [[Y:%.*]]
 ; CHECK-NEXT:[[TMP1:%.*]] = select nnan nsz <2 x i1> [[COND_INV]], <2 x float> [[Y]], <2 x float> [[X]]
-; CHECK-NEXT:[[MAX:%.*]] = fsub <2 x float> , [[TMP1]]
+; CHECK-NEXT:[[MAX:%.*]] = fsub nnan <2 x float> , [[TMP1]]
 ; CHECK-NEXT:ret <2 x float> [[MAX]]
 ;
   %n1 = fsub <2 x float> , %x
Index: llvm/test/Transforms/InstCombine/known-never-nan.ll
===
--- llvm/test/Transforms/InstCombine/known-never-nan.ll
+++ llvm/test/Transforms/InstCombine/known-never-nan.ll
@@ -11,7 +11,7 @@
 ; CHECK-LABEL: @fabs_sqrt_src_maybe_nan(
 ; CHECK-NEXT:[[FABS:%.*]] = call double @llvm.fabs.f64(double [[ARG0:%.*]])
 ; CHECK-NEXT:[[OP:%.*]] = call double @llvm.sqrt.f64(double [[FABS]])
-; CHECK-NEXT:[[TMP:%.*]] = fcmp ord double [[OP]], 0.00e+00
+; CHECK-NEXT:[[TMP:%.*]] = fcmp nsz ord double [[OP]], 0.00e+00
 ; CHECK-NEXT:ret i1 [[TMP]]
 ;
   %fabs = call double @llvm.fabs.f64(double %arg0)
Index: llvm/test/Transforms/InstCombine/fcmp.ll
===
--- llvm/test/Transforms/InstCombine/fcmp.ll
+++ llvm/test/Transforms/InstCombine/fcmp.ll
@@ -535,11 +535,11 @@
 ; Do not fold 1.0 / X > 0.0 when ninf is missing
 define i1 @test24_recipX_noninf_cmp(float %X) {
 ; CHECK-LABEL: @test24_recipX_noninf_cmp(
-; CHECK-NEXT:[[DIV:%.*]] = fdiv ninf float 2.00e+00, [[X:%.*]]
+; CHECK-NEXT:[[DIV:%.*]] = fdiv float 2.00e+00, [[X:%.*]]
 ; CHECK-NEXT:[[CMP:%.*]] = fcmp ogt float [[DIV]], 0.00e+00
 ; CHECK-NEXT:ret i1 [[CMP]]
 ;
-  %div = fdiv ninf float 2.0, %X
+  %div = fdiv float 2.0, %X
   %cmp = fcmp ogt float %div, 0.0
   ret i1 %cmp
 }
Index: llvm/test/Transforms/InstCombine/fast-math.ll
===
--- llvm/test/Transforms/InstCombine/fast-math.ll
+++ llvm/test/Transforms/InstCombine/fast-math.ll
@@ -18,7 +18,7 @@
 define float @notfold(float %a) {
 ; CHECK-LABEL: @notfold(
 ; CHECK-NEXT:[[MUL:%.*]] = fmul fast float [[A:%.*]], 0x3FF34000
-; CHECK-NEXT:[[MUL1:%.*]] = fmul float [[MUL]], 0x40026000
+; CHECK-NEXT:[[MUL1:%.*]] = fmul nnan float [[MUL]], 0x40026000
 ; CHECK-NEXT:ret float [[MUL1]]
 ;
   %mul = fmul fast float %a, 0x3FF34000
Index: 

[PATCH] D70488: [InstCombine] Infer fast math flags on fadd/fsub/fmul/fcmp

2019-11-20 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer created this revision.
bkramer added a reviewer: spatel.
Herald added subscribers: cfe-commits, hiraditya.
Herald added projects: clang, LLVM.

Applies nnan, ninf and nsz. This allows more instructions to be folded
away even with no fast math flags, e.g. (int)x * (b ? 1.0 : 0.0) -> b ? x : 0.0

As a side effect this will propagate fast math flags out of inlined fast
math code into surrounding functions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70488

Files:
  clang/test/CodeGen/builtins-systemz-zvector.c
  llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/lib/Transforms/InstCombine/InstCombineInternal.h
  llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/test/Transforms/InstCombine/add-sitofp.ll
  llvm/test/Transforms/InstCombine/cast-int-fcmp-eq-0.ll
  llvm/test/Transforms/InstCombine/fadd-fsub-factor.ll
  llvm/test/Transforms/InstCombine/fast-math.ll
  llvm/test/Transforms/InstCombine/fcmp.ll
  llvm/test/Transforms/InstCombine/known-never-nan.ll
  llvm/test/Transforms/InstCombine/minmax-fp.ll
  llvm/test/Transforms/InstCombine/pow_fp_int.ll

Index: llvm/test/Transforms/InstCombine/pow_fp_int.ll
===
--- llvm/test/Transforms/InstCombine/pow_fp_int.ll
+++ llvm/test/Transforms/InstCombine/pow_fp_int.ll
@@ -91,7 +91,7 @@
 define double @pow_uitofp_const_base_power_of_2_fast(i31 %x) {
 ; CHECK-LABEL: @pow_uitofp_const_base_power_of_2_fast(
 ; CHECK-NEXT:[[SUBFP:%.*]] = uitofp i31 [[X:%.*]] to float
-; CHECK-NEXT:[[MUL:%.*]] = fmul afn float [[SUBFP]], 4.00e+00
+; CHECK-NEXT:[[MUL:%.*]] = fmul nnan afn float [[SUBFP]], 4.00e+00
 ; CHECK-NEXT:[[EXP2:%.*]] = call afn float @llvm.exp2.f32(float [[MUL]])
 ; CHECK-NEXT:[[RES:%.*]] = fpext float [[EXP2]] to double
 ; CHECK-NEXT:ret double [[RES]]
@@ -383,7 +383,7 @@
 define double @pow_uitofp_const_base_power_of_2_no_fast(i32 %x) {
 ; CHECK-LABEL: @pow_uitofp_const_base_power_of_2_no_fast(
 ; CHECK-NEXT:[[SUBFP:%.*]] = uitofp i32 [[X:%.*]] to float
-; CHECK-NEXT:[[MUL:%.*]] = fmul float [[SUBFP]], 4.00e+00
+; CHECK-NEXT:[[MUL:%.*]] = fmul nnan float [[SUBFP]], 4.00e+00
 ; CHECK-NEXT:[[EXP2:%.*]] = call float @llvm.exp2.f32(float [[MUL]])
 ; CHECK-NEXT:[[RES:%.*]] = fpext float [[EXP2]] to double
 ; CHECK-NEXT:ret double [[RES]]
Index: llvm/test/Transforms/InstCombine/minmax-fp.ll
===
--- llvm/test/Transforms/InstCombine/minmax-fp.ll
+++ llvm/test/Transforms/InstCombine/minmax-fp.ll
@@ -273,7 +273,7 @@
 ; CHECK-LABEL: define {{[^@]+}}@fsub_fmax(
 ; CHECK-NEXT:[[COND_INV:%.*]] = fcmp nnan nsz ogt <2 x float> [[X:%.*]], [[Y:%.*]]
 ; CHECK-NEXT:[[TMP1:%.*]] = select nnan nsz <2 x i1> [[COND_INV]], <2 x float> [[Y]], <2 x float> [[X]]
-; CHECK-NEXT:[[MAX:%.*]] = fsub <2 x float> , [[TMP1]]
+; CHECK-NEXT:[[MAX:%.*]] = fsub nnan <2 x float> , [[TMP1]]
 ; CHECK-NEXT:ret <2 x float> [[MAX]]
 ;
   %n1 = fsub <2 x float> , %x
Index: llvm/test/Transforms/InstCombine/known-never-nan.ll
===
--- llvm/test/Transforms/InstCombine/known-never-nan.ll
+++ llvm/test/Transforms/InstCombine/known-never-nan.ll
@@ -11,7 +11,7 @@
 ; CHECK-LABEL: @fabs_sqrt_src_maybe_nan(
 ; CHECK-NEXT:[[FABS:%.*]] = call double @llvm.fabs.f64(double [[ARG0:%.*]])
 ; CHECK-NEXT:[[OP:%.*]] = call double @llvm.sqrt.f64(double [[FABS]])
-; CHECK-NEXT:[[TMP:%.*]] = fcmp ord double [[OP]], 0.00e+00
+; CHECK-NEXT:[[TMP:%.*]] = fcmp nsz ord double [[OP]], 0.00e+00
 ; CHECK-NEXT:ret i1 [[TMP]]
 ;
   %fabs = call double @llvm.fabs.f64(double %arg0)
Index: llvm/test/Transforms/InstCombine/fcmp.ll
===
--- llvm/test/Transforms/InstCombine/fcmp.ll
+++ llvm/test/Transforms/InstCombine/fcmp.ll
@@ -535,11 +535,11 @@
 ; Do not fold 1.0 / X > 0.0 when ninf is missing
 define i1 @test24_recipX_noninf_cmp(float %X) {
 ; CHECK-LABEL: @test24_recipX_noninf_cmp(
-; CHECK-NEXT:[[DIV:%.*]] = fdiv ninf float 2.00e+00, [[X:%.*]]
+; CHECK-NEXT:[[DIV:%.*]] = fdiv float 2.00e+00, [[X:%.*]]
 ; CHECK-NEXT:[[CMP:%.*]] = fcmp ogt float [[DIV]], 0.00e+00
 ; CHECK-NEXT:ret i1 [[CMP]]
 ;
-  %div = fdiv ninf float 2.0, %X
+  %div = fdiv float 2.0, %X
   %cmp = fcmp ogt float %div, 0.0
   ret i1 %cmp
 }
Index: llvm/test/Transforms/InstCombine/fast-math.ll
===
--- llvm/test/Transforms/InstCombine/fast-math.ll
+++ llvm/test/Transforms/InstCombine/fast-math.ll
@@ -18,7 +18,7 @@
 define float @notfold(float %a) {
 ; CHECK-LABEL: @notfold(
 ; CHECK-NEXT:[[MUL:%.*]] = fmul fast float [[A:%.*]], 0x3FF34000
-; 

[PATCH] D60201: Make clangd-fuzzer use the normal add_llvm_fuzzer() machinery

2019-04-03 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


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

https://reviews.llvm.org/D60201



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


[PATCH] D59750: Rename directory housing clang-include-fixer to be eponymous

2019-03-24 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg. Is the reference from libclang still around? Might need an update.


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

https://reviews.llvm.org/D59750



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


[PATCH] D59387: Make getFullyQualifiedName qualify both the pointee and class type for member ptr types

2019-03-14 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer created this revision.
bkramer added reviewers: saugustine, ilya-biryukov.
Herald added a subscriber: jlebar.
Herald added a project: clang.

We already handle pointers and references, member ptrs are just another
special case. Fixes PR40732.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D59387

Files:
  clang/lib/AST/QualTypeNames.cpp
  clang/unittests/Tooling/QualTypeNamesTest.cpp


Index: clang/unittests/Tooling/QualTypeNamesTest.cpp
===
--- clang/unittests/Tooling/QualTypeNamesTest.cpp
+++ clang/unittests/Tooling/QualTypeNamesTest.cpp
@@ -194,6 +194,7 @@
   GlobalNsPrefix.ExpectedQualTypeNames["ZVal"] = "::A::B::Y::Z";
   GlobalNsPrefix.ExpectedQualTypeNames["GlobalZVal"] = "::Z";
   GlobalNsPrefix.ExpectedQualTypeNames["CheckK"] = "D::aStruct";
+  GlobalNsPrefix.ExpectedQualTypeNames["YZMPtr"] = "::A::B::X ::A::B::Y::Z::*";
   GlobalNsPrefix.runOver(
   "namespace A {\n"
   "  namespace B {\n"
@@ -205,8 +206,9 @@
   "template \n"
   "using Alias = CCC;\n"
   "Alias IntAliasVal;\n"
-  "struct Y { struct Z {}; };\n"
+  "struct Y { struct Z { X YZIPtr; }; };\n"
   "Y::Z ZVal;\n"
+  "X Y::Z::*YZMPtr;\n"
   "  }\n"
   "}\n"
   "struct Z {};\n"
Index: clang/lib/AST/QualTypeNames.cpp
===
--- clang/lib/AST/QualTypeNames.cpp
+++ clang/lib/AST/QualTypeNames.cpp
@@ -379,6 +379,19 @@
 return QT;
   }
 
+  if (auto *MemberPT = dyn_cast(QT.getTypePtr())) {
+// Get the qualifiers.
+Qualifiers Quals = QT.getQualifiers();
+// Fully qualify the pointee and class types.
+QT = getFullyQualifiedType(QT->getPointeeType(), Ctx, WithGlobalNsPrefix);
+QualType Class = getFullyQualifiedType(QualType(MemberPT->getClass(), 0),
+   Ctx, WithGlobalNsPrefix);
+QT = Ctx.getMemberPointerType(QT, Class.getTypePtr());
+// Add back the qualifiers.
+QT = Ctx.getQualifiedType(QT, Quals);
+return QT;
+  }
+
   // In case of myType& we need to strip the reference first, fully
   // qualify and attach the reference once again.
   if (isa(QT.getTypePtr())) {


Index: clang/unittests/Tooling/QualTypeNamesTest.cpp
===
--- clang/unittests/Tooling/QualTypeNamesTest.cpp
+++ clang/unittests/Tooling/QualTypeNamesTest.cpp
@@ -194,6 +194,7 @@
   GlobalNsPrefix.ExpectedQualTypeNames["ZVal"] = "::A::B::Y::Z";
   GlobalNsPrefix.ExpectedQualTypeNames["GlobalZVal"] = "::Z";
   GlobalNsPrefix.ExpectedQualTypeNames["CheckK"] = "D::aStruct";
+  GlobalNsPrefix.ExpectedQualTypeNames["YZMPtr"] = "::A::B::X ::A::B::Y::Z::*";
   GlobalNsPrefix.runOver(
   "namespace A {\n"
   "  namespace B {\n"
@@ -205,8 +206,9 @@
   "template \n"
   "using Alias = CCC;\n"
   "Alias IntAliasVal;\n"
-  "struct Y { struct Z {}; };\n"
+  "struct Y { struct Z { X YZIPtr; }; };\n"
   "Y::Z ZVal;\n"
+  "X Y::Z::*YZMPtr;\n"
   "  }\n"
   "}\n"
   "struct Z {};\n"
Index: clang/lib/AST/QualTypeNames.cpp
===
--- clang/lib/AST/QualTypeNames.cpp
+++ clang/lib/AST/QualTypeNames.cpp
@@ -379,6 +379,19 @@
 return QT;
   }
 
+  if (auto *MemberPT = dyn_cast(QT.getTypePtr())) {
+// Get the qualifiers.
+Qualifiers Quals = QT.getQualifiers();
+// Fully qualify the pointee and class types.
+QT = getFullyQualifiedType(QT->getPointeeType(), Ctx, WithGlobalNsPrefix);
+QualType Class = getFullyQualifiedType(QualType(MemberPT->getClass(), 0),
+   Ctx, WithGlobalNsPrefix);
+QT = Ctx.getMemberPointerType(QT, Class.getTypePtr());
+// Add back the qualifiers.
+QT = Ctx.getQualifiedType(QT, Quals);
+return QT;
+  }
+
   // In case of myType& we need to strip the reference first, fully
   // qualify and attach the reference once again.
   if (isa(QT.getTypePtr())) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D57442: [OpenGL] Fix test on PPC after r352540

2019-01-30 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rC Clang

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

https://reviews.llvm.org/D57442



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


[PATCH] D57150: [HeaderSearch] don't immediately request that headers are opened in getFileAndSuggestModule().

2019-01-24 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added inline comments.



Comment at: lib/Lex/HeaderSearch.cpp:313
   // check whether we'll have a suggestion for a module.
-  const FileEntry *File = getFileMgr().getFile(FileName, /*OpenFile=*/true);
+  const FileEntry *File = getFileMgr().getFile(FileName, /*OpenFile=*/false);
   if (!File)

This deserves a comment that we don't open it because we might not need it. If 
we would use it the file would be closed after reading the contents.


Repository:
  rC Clang

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

https://reviews.llvm.org/D57150



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


[PATCH] D56665: [AST] Fix double-traversal of code in top-level lambdas in RAV(implicit = yes).

2019-01-14 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

This makes sense to me.


Repository:
  rC Clang

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

https://reviews.llvm.org/D56665



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


[PATCH] D55415: Revert removal of tidy plugin support from libclang

2018-12-09 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

I think that's a fair point for bringing it back for now. It's not supported 
though and we will get rid of it eventually.


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

https://reviews.llvm.org/D55415



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


[PATCH] D55484: ComputeLineNumbers: delete SSE2 vectorization

2018-12-09 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

The performance difference on preprocessing huge files was tiny back then, 
doesn't surprise me that it disappeared. What did you test this on?

Dropping it is fine with me.


Repository:
  rC Clang

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

https://reviews.llvm.org/D55484



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


[PATCH] D55415: Revert removal of tidy plugin support from libclang

2018-12-07 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added a comment.

I'd be interested in hearing how this is used. I added this feature as an 
experiment a while back but it simply didn't work as I envisioned it to. Some 
checks do work but the overall latency makes it unusable in an IDE setting. 
People repeatedly asked me to remove it because it slows down builds while not 
adding value.


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

https://reviews.llvm.org/D55415



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


[PATCH] D52264: Deduplicate replacements from diagnostics.

2018-09-24 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52264



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


[PATCH] D51921: [VFS] vfs::directory_iterator yields path and file type instead of full Status

2018-09-14 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rC Clang

https://reviews.llvm.org/D51921



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


[PATCH] D51921: [VFS] vfs::directory_iterator yields path and file type instead of full Status

2018-09-13 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added inline comments.



Comment at: include/clang/Basic/VirtualFileSystem.h:135
+  // For compatibility with old Status-based API. Prefer using Path directly.
+  StringRef getName() const { return Path; }
+};

sammccall wrote:
> sammccall wrote:
> > bkramer wrote:
> > > sammccall wrote:
> > > > Backwards-compatibility notes:
> > > > 
> > > >  - Almost all users of `directory_iterator` require no source changes 
> > > > (with this change)
> > > >  - Implementations of VFS require changes if they support directory 
> > > > iteration and do not merely wrap other VFSes. Anecdotally, most do not 
> > > > require changes. 
> > > > 
> > > > So this weird API seems worth having to make out-of-tree breakages less 
> > > > painful.
> > > > Happy to update the internal uses though if that seems worthwhile.
> > > Can we mirror llvm::sys::fs::directory_entry's interface? I want the APIs 
> > > to be as close as possible. Upgrading users is not a big deal.
> > How much of the interface are you talking about? :-)
> > 
> > Making these private and calling the accessors `file()` and `type()` is 
> > easy of course, and consistency is nice.
> > 
> > Supporting status() with similar semantics+performance is both complicated 
> > and... not a good idea, I think. See the other patch where I added a 
> > comment like "this interface is wrong" and didn't fix it :-)
> > 
> > The other random functions on fs::directory_entry seem like random 
> > implementation cruft to me.
> I've done the `path()` and `type()` rename, so now we're consistent with 
> fs::directory_entry.
> And inconsistent with clang::vfs::Status, and with clang::DirectoryEntry 
> (from FileManager).
> Can't win em all!
Not exposing random fields and having the same names as the other 
directory_entry is what I wanted :)

status() is deep in YAGNI territory.


Repository:
  rC Clang

https://reviews.llvm.org/D51921



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


[PATCH] D51921: [VFS] vfs::directory_iterator yields path and file type instead of full Status

2018-09-12 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added inline comments.



Comment at: include/clang/Basic/VirtualFileSystem.h:135
+  // For compatibility with old Status-based API. Prefer using Path directly.
+  StringRef getName() const { return Path; }
+};

sammccall wrote:
> Backwards-compatibility notes:
> 
>  - Almost all users of `directory_iterator` require no source changes (with 
> this change)
>  - Implementations of VFS require changes if they support directory iteration 
> and do not merely wrap other VFSes. Anecdotally, most do not require changes. 
> 
> So this weird API seems worth having to make out-of-tree breakages less 
> painful.
> Happy to update the internal uses though if that seems worthwhile.
Can we mirror llvm::sys::fs::directory_entry's interface? I want the APIs to be 
as close as possible. Upgrading users is not a big deal.


Repository:
  rC Clang

https://reviews.llvm.org/D51921



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


[PATCH] D51729: [Tooling] JSONCompilationDatabasePlugin infers compile commands for missing files

2018-09-12 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

I like it


Repository:
  rC Clang

https://reviews.llvm.org/D51729



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


[PATCH] D50168: [Builtins] Implement __builtin_clrsb to be compatible with gcc

2018-08-08 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


https://reviews.llvm.org/D50168



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


[PATCH] D50168: [Builtins] Implement __builtin_clrsb to be compatible with gcc

2018-08-07 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added a comment.

Test case?




Comment at: lib/CodeGen/CGBuiltin.cpp:1563
+Value *Result = Builder.CreateCall(F, {Tmp, Builder.getTrue()});
+if (Result->getType() != ResultType)
+  Result = Builder.CreateIntCast(Result, ResultType, /*isSigned*/true,

CreateIntCast just does nothing if the types match, so this check isn't needed.


https://reviews.llvm.org/D50168



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


[PATCH] D50156: [test] Fix %hmaptool path for standalone builds

2018-08-01 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg, thanks


Repository:
  rC Clang

https://reviews.llvm.org/D50156



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


[PATCH] D48873: [AST] Use llvm::TrailingObjects in CXXTryStmt

2018-07-23 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rC Clang

https://reviews.llvm.org/D48873



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


[PATCH] D49274: [CUDA] Provide integer SIMD functions for CUDA-9.2

2018-07-20 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


https://reviews.llvm.org/D49274



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


[PATCH] D49274: [CUDA] Provide integer SIMD functions for CUDA-9.2

2018-07-18 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added inline comments.
This revision is now accepted and ready to land.



Comment at: clang/lib/Headers/__clang_cuda_device_functions.h:1080
+  unsigned int r;
+  asm("vabsdiff2.u32.u32.u32.sat %0,%1,%2,0;" : "=r"(r) : "r"(__a), "r"(__b));
+  return r;

Should this really saturate?



Comment at: clang/lib/Headers/__clang_cuda_device_functions.h:1095
+  unsigned int r;
+  asm("vabsdiff2.s32.s32.s32.sat %0,%1,0,0;" : "=r"(r) : "r"(__a));
+  return r;

vabsdiff4?


https://reviews.llvm.org/D49274



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


[PATCH] D49302: [AST] Various micro-optimizations in CXXInheritance

2018-07-18 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

cool


Repository:
  rC Clang

https://reviews.llvm.org/D49302



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


[PATCH] D49484: [CodeComplete] Allow getDeclaration on RK_Pattern result.

2018-07-18 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rC Clang

https://reviews.llvm.org/D49484



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


[PATCH] D48845: [Sema] Add fixit for unused lambda captures

2018-07-03 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added inline comments.



Comment at: test/FixIt/fixit-unused-lambda-capture.cpp:31
+  // CHECK: [=,] { return i; };
+}

This needs tests for:

* capture initializers `[c = foo()] {};`
* Capturing this `[this] {};`
* Capturing *this `[*this] {};`
* VLA capture `int a; int c[a]; [] {};`


Repository:
  rC Clang

https://reviews.llvm.org/D48845



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


[PATCH] D47864: [python] Fix most Python binding unittests on Windows

2018-06-07 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

I don't know much about the python bindings, but this is probably fine.


Repository:
  rC Clang

https://reviews.llvm.org/D47864



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


[PATCH] D47262: [VFS] Implement getRealPath in InMemoryFileSystem.

2018-05-24 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rC Clang

https://reviews.llvm.org/D47262



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


[PATCH] D47074: [Tooling] Add an overload of runToolOnCodeWithArgs that takes VFS

2018-05-18 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rC Clang

https://reviews.llvm.org/D47074



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


[PATCH] D47060: [VFS] Implement getRealPath for OverlayFileSystem.

2018-05-18 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg




Comment at: lib/Basic/VirtualFileSystem.cpp:387
+   SmallVectorImpl ) const {
+  // Not using overlays_begin/end because this method is const.
+  for (auto I = FSList.rbegin(), E = FSList.rend(); I != E; ++I) {

Those should probably get const overloads. Doesn't have to be in this change 
though.


Repository:
  rC Clang

https://reviews.llvm.org/D47060



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


[PATCH] D46942: Add vfs::FileSystem::getRealPath

2018-05-17 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

Looks good. Please watch the windows buildbots carefully after landing this.




Comment at: lib/Basic/FileManager.cpp:537
 
-#ifdef LLVM_ON_UNIX
-  char CanonicalNameBuf[PATH_MAX];
-  if (realpath(Dir->getName().str().c_str(), CanonicalNameBuf))
+  SmallString CanonicalNameBuf;
+  if (!FS->getRealPath(Dir->getName(), CanonicalNameBuf))

PATH_MAX is not a standard thing and probably not there on windows. I'd just 
hardcode it to 256.


Repository:
  rC Clang

https://reviews.llvm.org/D46942



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


[PATCH] D46148: [CUDA] Added -f[no-]cuda-short-ptr option

2018-04-27 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lgtm


https://reviews.llvm.org/D46148



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


[PATCH] D45603: Fix evaluation of `__has_include_next` during -frewrite-includes.

2018-04-13 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


https://reviews.llvm.org/D45603



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


[PATCH] D44695: [clang-format] Partially revert r322749, replacing array with DenseSet

2018-03-20 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

I wouldn't say that this is more maintainable, but I'm not the maintainer of 
clang-format.


Repository:
  rC Clang

https://reviews.llvm.org/D44695



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


[PATCH] D23130: [Clang-tidy] Add a check for definitions in the global namespace.

2018-03-14 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added a comment.

I'd like to, but I don't know when I find time to rebase this thing after more 
than a year of waiting for review.


https://reviews.llvm.org/D23130



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


[PATCH] D43567: [ASTMatchers] isTemplateInstantiation: also match explicit instantiation declaration.

2018-02-21 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rC Clang

https://reviews.llvm.org/D43567



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


[PATCH] D43371: [clang-include-fixer] Use add_clang_tool instead of add_clang_executable

2018-02-16 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D43371



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


[PATCH] D42361: [Tooling] Returns non-zero status code when files are skipped.

2018-02-02 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

Removing FIXME seems right to me.


Repository:
  rC Clang

https://reviews.llvm.org/D42361



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


[PATCH] D42810: [Sema] Add implicit members even for invalid CXXRecordDecls

2018-02-01 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rC Clang

https://reviews.llvm.org/D42810



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


[PATCH] D42361: [Tooling] Returns non-zero status code when files are skipped.

2018-02-01 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added inline comments.



Comment at: lib/Tooling/Tooling.cpp:404
 if (CompileCommandsForFile.empty()) {
   // FIXME: There are two use cases here: doing a fuzzy
   // "find . -name '*.cc' |xargs tool" match, where as a user I don't care

ioeric wrote:
> bkramer wrote:
> > This comment explains why the implementation doesn't error. Can you make 
> > sure the xargs use case is still working properly?
> I somehow missed the big `FIXME`... thanks for the catch! 
> 
> I don't think this is a very typical use case that should affect design 
> decision here, and I would expect `xargs` users to do something like `xargs 
> tool $@ || true` if they really want to ignore errors. WDYT?
Yeah. I think the only important thing is that xargs doesn't stop after the 
first error. But that seems to be the default behavior of xargs?


Repository:
  rC Clang

https://reviews.llvm.org/D42361



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


[PATCH] D42577: [Lexer] Support adding working directory to relative search dir for #include shortening in HeaderSearch.

2018-01-29 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added inline comments.
This revision is now accepted and ready to land.



Comment at: include/clang/Lex/HeaderSearch.h:708
+  ///
+  /// \param WorkingDir If non-empty, this will be prepend to search directory
+  /// paths that are relative.

prepended



Comment at: lib/Lex/HeaderSearch.cpp:1584
+  // the most appropriate one for this analysis (and that it's spelled the
+  // same
   // way as the corresponding header search path).

Reflow comment.


Repository:
  rC Clang

https://reviews.llvm.org/D42577



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


[PATCH] D42241: [CodeComplete] Fix completion in the middle of idents in macro calls

2018-01-22 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

I think we can go ahead with this. I expect code completion in the middle of a 
token not to be used much though, so there might be more broken cases.


Repository:
  rC Clang

https://reviews.llvm.org/D42241



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


[PATCH] D42361: [Tooling] Returns non-zero status code when files are skipped.

2018-01-22 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added inline comments.



Comment at: lib/Tooling/Tooling.cpp:404
 if (CompileCommandsForFile.empty()) {
   // FIXME: There are two use cases here: doing a fuzzy
   // "find . -name '*.cc' |xargs tool" match, where as a user I don't care

This comment explains why the implementation doesn't error. Can you make sure 
the xargs use case is still working properly?


Repository:
  rC Clang

https://reviews.llvm.org/D42361



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


[PATCH] D42298: [clang-format] Fix shortening blocks in macros causing merged next line

2018-01-19 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lgtm




Comment at: lib/Format/UnwrappedLineFormatter.cpp:310
+MergedLines = tryMergeSimpleBlock(I - 1, E, Limit);
+// If we managed to merge the block, discard the first  merged line
+// since we are merging starting from I.

double space in comment


Repository:
  rC Clang

https://reviews.llvm.org/D42298



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


[PATCH] D42187: [clang-format] Adds a canonical delimiter to raw string formatting

2018-01-18 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg




Comment at: lib/Format/ContinuationIndenter.cpp:1336
+  unsigned OldSuffixSize = 2 + OldDelimiter.size();
+  std::string RawText =
+  Current.TokenText.substr(OldPrefixSize).drop_back(OldSuffixSize);

Can this be a StringRef? Can RawText outlive the Current token?


Repository:
  rC Clang

https://reviews.llvm.org/D42187



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


[PATCH] D42189: [clang-format] Replace unordered_set with an array

2018-01-17 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.

lgtm


Repository:
  rC Clang

https://reviews.llvm.org/D42189



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


[PATCH] D42189: [clang-format] Replace unordered_set with an array

2018-01-17 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added inline comments.



Comment at: lib/Format/Format.cpp:1424
   const AdditionalKeywords ) {
-static const std::unordered_set FoundationIdentifiers = {
+static const llvm::ArrayRef FoundationIdentifiers = {
 "CGFloat",

The ArrayRef doesn't own its contents, so this is a use-after-scope.

I'd prefer `static constexpr llvm::StringLiteral FoundationIdentifiers[] = {`


Repository:
  rC Clang

https://reviews.llvm.org/D42189



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


[PATCH] D42185: [ASTMatcher] Add isScoped matcher for enumDecl.

2018-01-17 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer requested changes to this revision.
bkramer added a comment.

dump_ast_matchers.py should be working again now.


Repository:
  rC Clang

https://reviews.llvm.org/D42185



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


[PATCH] D42185: [ASTMatcher] Add isScoped matcher for enumDecl.

2018-01-17 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rC Clang

https://reviews.llvm.org/D42185



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


[PATCH] D42167: [clang-format] adds enclosing function detection to raw string formatting

2018-01-17 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lgtm


Repository:
  rC Clang

https://reviews.llvm.org/D42167



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


[PATCH] D42174: [clangd] Refactored threading in ClangdServer

2018-01-17 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added inline comments.



Comment at: clangd/ClangdServer.h:107
+/// A simple fixed-size thread pool implementation.
+class SimpleThreadPool {
 public:

What's so simple about it? Why not `clangd::ThreadPool`?

Also there's `llvm::ThreadPool`, what's the difference between them?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D42174



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


[PATCH] D42167: [clang-format] adds enclosing function detection to raw string formatting

2018-01-17 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added inline comments.



Comment at: lib/Format/ContinuationIndenter.cpp:1454
+// found.
+static StringRef getEnclosingFunctionName(const FormatToken& Current) {
+  // Look for: 'function(' or 'function(' before Current.

This function doesn't look clang-formatted.


Repository:
  rC Clang

https://reviews.llvm.org/D42167



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


[PATCH] D42111: [Tooling] Don't deduplicate tool results in the All-TUs executor.

2018-01-17 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rC Clang

https://reviews.llvm.org/D42111



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


[PATCH] D41788: [DeclPrinter] Fix two cases that crash clang -ast-print.

2018-01-17 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

This should be fine.


https://reviews.llvm.org/D41788



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


[PATCH] D42098: [clang-format] Reorganize RawStringFormat based on language

2018-01-16 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

lg


Repository:
  rC Clang

https://reviews.llvm.org/D42098



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


[PATCH] D41991: [clangd] Always use preamble (even stale) for code completion

2018-01-16 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added inline comments.



Comment at: clangd/Compiler.h:39
+/// be consumed by the FrontendAction as it will have a pointer to the MainFile
+/// buffer that will only be deleted if BeginSourceFile is called.
 std::unique_ptr prepareCompilerInstance(

This comment is somewhat messy now. Can you rephrase it a bit?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D41991



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


[PATCH] D42071: [Sema] Add a callback in VisibleDeclConsumer allowing client to know which DeclContext is going to visit.

2018-01-15 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added a comment.

We should have a unit test for this, otherwise it's dead code.




Comment at: include/clang/Sema/Lookup.h:791
+  /// \param Ctx the context which Sema begins to visit.
+  virtual void BeginVisitContext(DeclContext *Ctx) {};
 };

ilya-biryukov wrote:
> Maybe rename it to `VisitedContext` ? Seems more in-line with `FoundDecl`.
> `BeginVisitContext` also suggest there should be `EndVisitContext`
Semicolon is not needed here.


Repository:
  rC Clang

https://reviews.llvm.org/D42071



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


  1   2   3   >