[PATCH] D62115: fix a issue that clang is incompatible with gcc with -H option.

2019-05-21 Thread Kim Gräsman via Phabricator via cfe-commits
kimgr added a comment.

Also, consider `././Inputs/empty.h`.


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

https://reviews.llvm.org/D62115



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


[PATCH] D62115: fix a issue that clang is incompatible with gcc with -H option.

2019-05-21 Thread Kim Gräsman via Phabricator via cfe-commits
kimgr added a comment.

I was thinking about a testcase like:

  // RUN: %clang -H -fsyntax-only %s 2>&1 | FileCheck %s
  
  #include "..\Index\Inputs\empty.h"
  #include ".\Inputs\empty.h"
  
  // CHECK: .
  // CHECK-SAME: ???
  // CHECK: .
  // CHECK-NOT: ???
  // CHECK-SAME: ???

with some provision for running it in a Windows environment.

Not sure what the expected behavior should be, hence the `???`


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

https://reviews.llvm.org/D62115



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


[PATCH] D61809: [BPF] Preserve debuginfo array/union/struct type/access index

2019-05-21 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 200639.
yonghong-song retitled this revision from "[BPF] Preserve debuginfo 
array/union/struct type name/access index" to "[BPF] Preserve debuginfo 
array/union/struct type/access index".
yonghong-song edited the summary of this revision.
yonghong-song added a comment.

add clang builtin __builtin_preserve_access_index


Repository:
  rC Clang

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

https://reviews.llvm.org/D61809

Files:
  include/clang/Basic/Builtins.def
  lib/Basic/Targets/BPF.h
  lib/CodeGen/CGBuilder.h
  lib/CodeGen/CGBuiltin.cpp
  lib/CodeGen/CGExpr.cpp
  lib/CodeGen/CodeGenFunction.h
  lib/Sema/SemaChecking.cpp
  test/CodeGen/bpf-offsetreloc.c

Index: test/CodeGen/bpf-offsetreloc.c
===
--- /dev/null
+++ test/CodeGen/bpf-offsetreloc.c
@@ -0,0 +1,19 @@
+// RUN: %clang -target bpf -emit-llvm -S -g -O2 -o - %s > %t1
+// RUN: grep "llvm.preserve.struct.access.index" %t1
+// RUN: grep "llvm.preserve.array.access.index" %t1
+// RUN: grep "llvm.preserve.union.access.index" %t1
+
+struct t {
+  int i:1;
+  int j:2;
+  union {
+   int a;
+   int b;
+  } c[4];
+};
+
+#define _(x) (__builtin_preserve_access_index(x))
+
+void *test(struct t *arg) {
+  return _(>c[3].b);
+}
Index: lib/Sema/SemaChecking.cpp
===
--- lib/Sema/SemaChecking.cpp
+++ lib/Sema/SemaChecking.cpp
@@ -190,6 +190,16 @@
   return false;
 }
 
+/// Check the number of arguments, and set the result type to
+/// the argument type.
+static bool SemaBuiltinPreserveAI(Sema , CallExpr *TheCall) {
+  if (checkArgCount(S, TheCall, 1))
+return true;
+
+  TheCall->setType(TheCall->getArg(0)->getType());
+  return false;
+}
+
 static bool SemaBuiltinOverflow(Sema , CallExpr *TheCall) {
   if (checkArgCount(S, TheCall, 3))
 return true;
@@ -1407,6 +1417,10 @@
 TheCall->setType(Context.IntTy);
 break;
   }
+  case Builtin::BI__builtin_preserve_access_index:
+if (SemaBuiltinPreserveAI(*this, TheCall))
+  return ExprError();
+break;
   case Builtin::BI__builtin_call_with_static_chain:
 if (SemaBuiltinCallWithStaticChain(*this, TheCall))
   return ExprError();
Index: lib/CodeGen/CodeGenFunction.h
===
--- lib/CodeGen/CodeGenFunction.h
+++ lib/CodeGen/CodeGenFunction.h
@@ -1027,6 +1027,10 @@
 store->setAlignment(addr.getAlignment().getQuantity());
   }
 
+  /// isPreserveDIAccessIndexNeeded - Return true if it is needed to
+  /// preserve the Debuginfo access index.
+  bool isPreserveDIAccessIndexNeeded(const Expr *E);
+
   /// An RAII object to record that we're evaluating a statement
   /// expression.
   class StmtExprEvaluation {
@@ -3545,7 +3549,8 @@
 
   llvm::Value *EmitIvarOffset(const ObjCInterfaceDecl *Interface,
   const ObjCIvarDecl *Ivar);
-  LValue EmitLValueForField(LValue Base, const FieldDecl* Field);
+  LValue EmitLValueForField(LValue Base, const FieldDecl* Field,
+const Expr *E = nullptr);
   LValue EmitLValueForLambdaField(const FieldDecl *Field);
 
   /// EmitLValueForFieldInitialization - Like EmitLValueForField, except that
Index: lib/CodeGen/CGExpr.cpp
===
--- lib/CodeGen/CGExpr.cpp
+++ lib/CodeGen/CGExpr.cpp
@@ -25,6 +25,7 @@
 #include "clang/AST/Attr.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/NSAPI.h"
+#include "clang/Basic/Builtins.h"
 #include "clang/Basic/CodeGenOptions.h"
 #include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/StringExtras.h"
@@ -649,6 +650,52 @@
  SanOpts.has(SanitizerKind::Vptr);
 }
 
+/// The expression E is a candidate for preserving debuginfo access index
+/// if it is inside an __builtin_preserve_access_index intrinsic call.
+bool CodeGenFunction::isPreserveDIAccessIndexNeeded(const Expr *E) {
+  if (!E)
+return false;
+
+  if (!getDebugInfo())
+return false;
+
+  while (true) {
+const auto  = getContext().getParents(*E);
+if (Parents.size() != 1)
+  return false;
+
+E = Parents[0].get();
+if (!E)
+  return false;
+
+// Check whether E is a BI__builtin_preserve_access_index
+// intrinsic call.
+const auto *CE = dyn_cast(E);
+if (CE) {
+  // Callee must a builtin function.
+  const Expr *Callee = CE->getCallee()->IgnoreParens();
+  auto ICE = dyn_cast(Callee);
+  if (!ICE)
+return false;
+  if (ICE->getCastKind() != CK_BuiltinFnToFnPtr)
+return false;
+
+  auto DRE = dyn_cast(ICE->getSubExpr());
+  if (!DRE)
+return false;
+
+  if (auto FD = dyn_cast(DRE->getDecl())) {
+if (FD->getBuiltinID() == Builtin::BI__builtin_preserve_access_index)
+  return true;
+  }
+
+  break;
+}
+  }
+
+  return false;
+}
+
 void 

[PATCH] D62045: Revise the google-objc-global-variable-declaration check to match the style guide.

2019-05-21 Thread Yaqi Ji via Phabricator via cfe-commits
yaqiji updated this revision to Diff 200637.
yaqiji edited the summary of this revision.
yaqiji added a comment.

Removed other mdodified file.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62045

Files:
  clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp
  clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m

Index: clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m
===
--- clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m
+++ clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m
@@ -1,10 +1,14 @@
 // RUN: %check_clang_tidy %s google-objc-global-variable-declaration %t
 
 @class NSString;
+
 static NSString* const myConstString = @"hello";
 // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'myConstString' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
 // CHECK-FIXES: static NSString* const kMyConstString = @"hello";
 
+extern NSString* const GlobalConstant = @"hey";
+// CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'GlobalConstant' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
+
 static NSString* MyString = @"hi";
 // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: non-const global variable 'MyString' must have a name which starts with 'g[A-Z]' [google-objc-global-variable-declaration]
 // CHECK-FIXES: static NSString* gMyString = @"hi";
@@ -25,13 +29,21 @@
 // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable '_notAlpha' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
 // CHECK-FIXES: static NSString* const _notAlpha = @"NotBeginWithAlpha";
 
+static NSString* const notCap = @"NotBeginWithCap";
+// CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'notCap' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
+
 static NSString* const k_Alpha = @"SecondNotAlpha";
 // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'k_Alpha' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
 // CHECK-FIXES: static NSString* const k_Alpha = @"SecondNotAlpha";
 
+static NSString* const SecondNotCap = @"SecondNotCapOrNumber";
+// CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'SecondNotCap' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
+
 static NSString* const kGood = @"hello";
 static NSString* const XYGood = @"hello";
+static NSString* const X1Good = @"hello";
 static NSString* gMyIntGood = 0;
+extern NSString* Y2Good;
 
 extern NSString* const GTLServiceErrorDomain;
 
@@ -42,8 +54,8 @@
 
 @implementation Foo
 - (void)f {
-int x = 0;
-static int bar;
-static const int baz = 42;
+  int x = 0;
+  static int bar;
+  static const int baz = 42;
 }
 @end
Index: clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp
===
--- clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp
+++ clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp
@@ -23,29 +23,35 @@
 
 namespace {
 
-AST_MATCHER(VarDecl, isLocalVariable) {
-  return Node.isLocalVarDecl();
-}
+AST_MATCHER(VarDecl, isLocalVariable) { return Node.isLocalVarDecl(); }
 
 FixItHint generateFixItHint(const VarDecl *Decl, bool IsConst) {
+  if (IsConst && Decl->hasExternalStorage()) {
+// No fix available if it is a extern global constant, since it is difficult
+// to determine the proper fix in this case.
+return FixItHint();
+  }
+
   char FC = Decl->getName()[0];
   if (!llvm::isAlpha(FC) || Decl->getName().size() == 1) {
 // No fix available if first character is not alphabetical character, or it
-// is a single-character variable, since it is difficult to determine the 
+// is a single-character variable, since it is difficult to determine the
 // proper fix in this case. Users should create a proper variable name by
 // their own.
 return FixItHint();
   }
   char SC = Decl->getName()[1];
   if ((FC == 'k' || FC == 'g') && !llvm::isAlpha(SC)) {
-// No fix available if the prefix is correct but the second character is not
-// alphabetical, since it is difficult to determine the proper fix in this
-// case.
+// No fix available if the prefix is correct but the second character is
+// not alphabetical, since it is difficult to determine the proper fix in
+// this case.
 return FixItHint();
   }
+
   auto NewName = (IsConst ? "k" : "g") +
  llvm::StringRef(std::string(1, FC)).upper() +
  

[PATCH] D60543: [clang] Update isDerivedFrom to support Objective-C classes 

2019-05-21 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore planned changes to this revision.
stephanemoore added a comment.

> Out of curiosity, how invasive is Option 2 within our own code base?

I am still working on getting something working but I don't anticipate anything 
notably invasive.

> Does that option require fixing a lot of code?

I believe it doesn't require fixing a lot of code within our codebase. I think 
we just need to fix the overloaded `isDerivedFrom` matcher and both 
`isSameOrDerivedFrom` matchers.

> Are the breakages loud or silent?

I expect that the breakages should be loud compilation failures.

> Is the code easy to modify, or are there corner cases where this option 
> becomes problematic?

I am still working on putting together something that works. I am still getting 
familiar with polymorphic matchers so I probably can't give a reliable 
assessment of the ease of the code changes just yet. I imagine that the changes 
in this commit to convert the overloaded `isDerivedFrom` matcher and the two 
`isSameOrDerivedFrom` matchers could be demonstrative to others as to how to 
resolve breakages. I am not confident enough to state that with certainty 
though.

> I prefer Option 2 because it is a cleaner, more understandable design for the 
> matchers. If it turns out that this option causes a hard break (rather than 
> silently changing matcher behavior) and the changes needed to get old code to 
> compile again are minimal, I think it may be a reasonable choice.

I agree that Option 2 is preferable if we are allowed to require a non-zero 
amount of migration work from downstream clients. I will continue working on 
Option 2 and will return once I have something working.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60543



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


[PATCH] D62232: [Clang][Driver] recheck for nullptr

2019-05-21 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers created this revision.
nickdesaulniers added reviewers: rsmith, sfantao.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No.
47".

Looks like TC is checked for nullptr once, but not the second time.
Fixes r275645.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D62232

Files:
  clang/lib/Driver/Driver.cpp


Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -1821,7 +1821,8 @@
   else
 os << "host";
   os << " (";
-  os << TC->getTriple().normalize();
+  if (TC)
+os << TC->getTriple().normalize();
 
   if (BoundArch)
 os << ":" << BoundArch;


Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -1821,7 +1821,8 @@
   else
 os << "host";
   os << " (";
-  os << TC->getTriple().normalize();
+  if (TC)
+os << TC->getTriple().normalize();
 
   if (BoundArch)
 os << ":" << BoundArch;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D62115: fix a issue that clang is incompatible with gcc with -H option.

2019-05-21 Thread Kan Shengchen via Phabricator via cfe-commits
skan marked an inline comment as done.
skan added inline comments.



Comment at: lib/Frontend/HeaderIncludeGen.cpp:55
+  // Simplify Filename that starts with "./"
+  if (Filename.startswith("./"));
+Filename=Filename.substr(2);

lebedev.ri wrote:
> skan wrote:
> > lebedev.ri wrote:
> > > skan wrote:
> > > > craig.topper wrote:
> > > > > skan wrote:
> > > > > > lebedev.ri wrote:
> > > > > > > xiangzhangllvm wrote:
> > > > > > > > Need remove ";" ? 
> > > > > > > This was fixed but no test was added?
> > > > > > > Was some existing test failing previously? Which one?
> > > > > > The test is in the file 'clang_H_opt.c'  which is included in this 
> > > > > > patch.
> > > > > The extra semicolon would have caused the body of the 'if' to execute 
> > > > > unconditionally. Did any existing test case fail for that in your 
> > > > > local testing? Or did you not test with that mistake?
> > > > i fixed the mistake in the updated patch.  I ran the test in 
> > > > 'clang_H_opt.c' alone for this patch. The extra semicolon caused the 
> > > > body of `if` to exeute always, which didn't cause the test to fail. 
> > > > The extra semicolon caused the body of if to exeute always, which 
> > > > didn't cause the test to fail.
> > > 
> > > That is the question.
> > > Is there test coverage with that error?
> > No. I just run alll the tests for clang, and all of them can pass even if 
> > the extra semicolon exits. If we want to add  a test to cover that error, 
> > we have to add a headerfile outside the 'test/Driver' directory. Do we need 
> > to add the test to cover that error?
> Then yes please, do add test coverage for that bug :)
test for that bug has been added in the new patch


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

https://reviews.llvm.org/D62115



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


[PATCH] D62115: fix a issue that clang is incompatible with gcc with -H option.

2019-05-21 Thread Kan Shengchen via Phabricator via cfe-commits
skan updated this revision to Diff 200634.
skan added a comment.

add a test for including headfile outside current directory.


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

https://reviews.llvm.org/D62115

Files:
  lib/Frontend/HeaderIncludeGen.cpp
  test/Frontend/clang_H_opt.c


Index: test/Frontend/clang_H_opt.c
===
--- /dev/null
+++ test/Frontend/clang_H_opt.c
@@ -0,0 +1,10 @@
+// RUN: %clang -H -fsyntax-only %s 2>&1 | FileCheck %s
+
+#include "../Index/Inputs/empty.h"
+#include "Inputs/empty.h"
+
+// CHECK: .
+// CHECK-SAME: ../Index/Inputs/empty.h
+// CHECK: .
+// CHECK-NOT: ./
+// CHECK-SAME: Inputs/empty.h
Index: lib/Frontend/HeaderIncludeGen.cpp
===
--- lib/Frontend/HeaderIncludeGen.cpp
+++ lib/Frontend/HeaderIncludeGen.cpp
@@ -51,6 +51,10 @@
 static void PrintHeaderInfo(raw_ostream *OutputFile, StringRef Filename,
 bool ShowDepth, unsigned CurrentIncludeDepth,
 bool MSStyle) {
+  // Simplify Filename that starts with "./"
+  if (Filename.startswith("./"))
+Filename = Filename.substr(2);
+
   // Write to a temporary string to avoid unnecessary flushing on errs().
   SmallString<512> Pathname(Filename);
   if (!MSStyle)


Index: test/Frontend/clang_H_opt.c
===
--- /dev/null
+++ test/Frontend/clang_H_opt.c
@@ -0,0 +1,10 @@
+// RUN: %clang -H -fsyntax-only %s 2>&1 | FileCheck %s
+
+#include "../Index/Inputs/empty.h"
+#include "Inputs/empty.h"
+
+// CHECK: .
+// CHECK-SAME: ../Index/Inputs/empty.h
+// CHECK: .
+// CHECK-NOT: ./
+// CHECK-SAME: Inputs/empty.h
Index: lib/Frontend/HeaderIncludeGen.cpp
===
--- lib/Frontend/HeaderIncludeGen.cpp
+++ lib/Frontend/HeaderIncludeGen.cpp
@@ -51,6 +51,10 @@
 static void PrintHeaderInfo(raw_ostream *OutputFile, StringRef Filename,
 bool ShowDepth, unsigned CurrentIncludeDepth,
 bool MSStyle) {
+  // Simplify Filename that starts with "./"
+  if (Filename.startswith("./"))
+Filename = Filename.substr(2);
+
   // Write to a temporary string to avoid unnecessary flushing on errs().
   SmallString<512> Pathname(Filename);
   if (!MSStyle)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D62230: [CGDebugInfo] return early on failed dyn_cast

2019-05-21 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment.

Also of note is that no existing test covers this case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62230



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


[PATCH] D62230: [CGDebugInfo] return early on failed dyn_cast

2019-05-21 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers created this revision.
nickdesaulniers added a reviewer: rsmith.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
nickdesaulniers added a comment.

Also of note is that no existing test covers this case.


This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No.
39".

I looked at making CGDebugInfo::getFunctionFwdDeclOrStub take a
FunctionDecl as its first argument, but this quickly became untenable.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D62230

Files:
  clang/lib/CodeGen/CGDebugInfo.cpp


Index: clang/lib/CodeGen/CGDebugInfo.cpp
===
--- clang/lib/CodeGen/CGDebugInfo.cpp
+++ clang/lib/CodeGen/CGDebugInfo.cpp
@@ -3280,6 +3280,10 @@
 
 llvm::DISubprogram *CGDebugInfo::getFunctionFwdDeclOrStub(GlobalDecl GD,
   bool Stub) {
+  auto *FD = dyn_cast(GD.getDecl());
+  if (!FD)
+return nullptr;
+
   llvm::DINodeArray TParamsArray;
   StringRef Name, LinkageName;
   llvm::DINode::DIFlags Flags = llvm::DINode::FlagZero;
@@ -3290,13 +3294,10 @@
   unsigned Line = getLineNumber(Loc);
   collectFunctionDeclProps(GD, Unit, Name, LinkageName, DContext, TParamsArray,
Flags);
-  auto *FD = dyn_cast(GD.getDecl());
-
   // Build function type.
   SmallVector ArgTypes;
-  if (FD)
-for (const ParmVarDecl *Parm : FD->parameters())
-  ArgTypes.push_back(Parm->getType());
+  for (const ParmVarDecl *Parm : FD->parameters())
+ArgTypes.push_back(Parm->getType());
   CallingConv CC = FD->getType()->castAs()->getCallConv();
   QualType FnType = CGM.getContext().getFunctionType(
   FD->getReturnType(), ArgTypes, FunctionProtoType::ExtProtoInfo(CC));


Index: clang/lib/CodeGen/CGDebugInfo.cpp
===
--- clang/lib/CodeGen/CGDebugInfo.cpp
+++ clang/lib/CodeGen/CGDebugInfo.cpp
@@ -3280,6 +3280,10 @@
 
 llvm::DISubprogram *CGDebugInfo::getFunctionFwdDeclOrStub(GlobalDecl GD,
   bool Stub) {
+  auto *FD = dyn_cast(GD.getDecl());
+  if (!FD)
+return nullptr;
+
   llvm::DINodeArray TParamsArray;
   StringRef Name, LinkageName;
   llvm::DINode::DIFlags Flags = llvm::DINode::FlagZero;
@@ -3290,13 +3294,10 @@
   unsigned Line = getLineNumber(Loc);
   collectFunctionDeclProps(GD, Unit, Name, LinkageName, DContext, TParamsArray,
Flags);
-  auto *FD = dyn_cast(GD.getDecl());
-
   // Build function type.
   SmallVector ArgTypes;
-  if (FD)
-for (const ParmVarDecl *Parm : FD->parameters())
-  ArgTypes.push_back(Parm->getType());
+  for (const ParmVarDecl *Parm : FD->parameters())
+ArgTypes.push_back(Parm->getType());
   CallingConv CC = FD->getType()->castAs()->getCallConv();
   QualType FnType = CGM.getContext().getFunctionType(
   FD->getReturnType(), ArgTypes, FunctionProtoType::ExtProtoInfo(CC));
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D61508: [clang-tidy] bugprone-header-guard : a simple version of llvm-header-guard

2019-05-21 Thread Tom Rix via Phabricator via cfe-commits
trixirt marked an inline comment as done.
trixirt added inline comments.



Comment at: clang-tidy/bugprone/HeaderGuardCheck.cpp:30
+}
+std::string BugproneHeaderGuardCheck::getHeaderGuard(StringRef Filename,
+ StringRef OldGuard) {

aaron.ballman wrote:
> Can you add a newline for some visual separation?
I did not think ment a empty newline in the param-list, so  I assumed you ment 
the function above and this function could use a new line.  


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D61508



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


[PATCH] D61508: [clang-tidy] bugprone-header-guard : a simple version of llvm-header-guard

2019-05-21 Thread Tom Rix via Phabricator via cfe-commits
trixirt updated this revision to Diff 200630.
trixirt added a comment.

Add a newline to separate functions


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D61508

Files:
  clang-tidy/bugprone/BugproneTidyModule.cpp
  clang-tidy/bugprone/CMakeLists.txt
  clang-tidy/bugprone/HeaderGuardCheck.cpp
  clang-tidy/bugprone/HeaderGuardCheck.h
  clang-tidy/llvm/CMakeLists.txt
  clang-tidy/llvm/HeaderGuardCheck.cpp
  clang-tidy/llvm/HeaderGuardCheck.h
  clang-tidy/llvm/LLVMTidyModule.cpp
  docs/ReleaseNotes.rst
  docs/clang-tidy/checks/bugprone-header-guard.rst
  docs/clang-tidy/checks/google-build-namespaces.rst
  docs/clang-tidy/checks/google-global-names-in-headers.rst
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/checks/llvm-header-guard.rst
  docs/clang-tidy/checks/misc-definitions-in-headers.rst
  test/clang-tidy/bugprone-header-guard.cpp
  test/clang-tidy/llvm-header-guard.cpp
  unittests/clang-tidy/CMakeLists.txt
  unittests/clang-tidy/LLVMModuleTest.cpp

Index: unittests/clang-tidy/LLVMModuleTest.cpp
===
--- unittests/clang-tidy/LLVMModuleTest.cpp
+++ unittests/clang-tidy/LLVMModuleTest.cpp
@@ -1,9 +1,10 @@
 #include "ClangTidyTest.h"
-#include "llvm/HeaderGuardCheck.h"
+#include "bugprone/HeaderGuardCheck.h"
 #include "llvm/IncludeOrderCheck.h"
 #include "gtest/gtest.h"
 
 using namespace clang::tidy::llvm_check;
+using namespace clang::tidy::bugprone;
 
 namespace clang {
 namespace tidy {
@@ -14,8 +15,10 @@
 static std::string runHeaderGuardCheck(StringRef Code, const Twine ,
Optional ExpectedWarning) {
   std::vector Errors;
-  std::string Result = test::runCheckOnCode(
-  Code, , Filename, std::string("-xc++-header"));
+  ClangTidyOptions Options;
+  Options.CheckOptions["test-check-0.GuardStyle"] = "llvm";
+  std::string Result = test::runCheckOnCode(
+  Code, , Filename, std::string("-xc++-header"), Options);
   if (Errors.size() != (size_t)ExpectedWarning.hasValue())
 return "invalid error count";
   if (ExpectedWarning && *ExpectedWarning != Errors.back().Message.Message)
@@ -25,9 +28,9 @@
 }
 
 namespace {
-struct WithEndifComment : public LLVMHeaderGuardCheck {
+struct WithEndifComment : public BugproneHeaderGuardCheck {
   WithEndifComment(StringRef Name, ClangTidyContext *Context)
-  : LLVMHeaderGuardCheck(Name, Context) {}
+  : BugproneHeaderGuardCheck(Name, Context) {}
   bool shouldSuggestEndifComment(StringRef Filename) override { return true; }
 };
 } // namespace
@@ -36,8 +39,10 @@
 runHeaderGuardCheckWithEndif(StringRef Code, const Twine ,
  Optional ExpectedWarning) {
   std::vector Errors;
+  ClangTidyOptions Options;
+  Options.CheckOptions["test-check-0.GuardStyle"] = "llvm";
   std::string Result = test::runCheckOnCode(
-  Code, , Filename, std::string("-xc++-header"));
+  Code, , Filename, std::string("-xc++-header"), Options);
   if (Errors.size() != (size_t)ExpectedWarning.hasValue())
 return "invalid error count";
   if (ExpectedWarning && *ExpectedWarning != Errors.back().Message.Message)
Index: unittests/clang-tidy/CMakeLists.txt
===
--- unittests/clang-tidy/CMakeLists.txt
+++ unittests/clang-tidy/CMakeLists.txt
@@ -29,6 +29,7 @@
   clangSerialization
   clangTidy
   clangTidyAndroidModule
+  clangTidyBugproneModule
   clangTidyGoogleModule
   clangTidyLLVMModule
   clangTidyObjCModule
Index: test/clang-tidy/llvm-header-guard.cpp
===
--- /dev/null
+++ test/clang-tidy/llvm-header-guard.cpp
@@ -0,0 +1,9 @@
+// RUN: %check_clang_tidy %s llvm-header-guard %t -- \
+// RUN:   -config="{CheckOptions: [{key: llvm-header-guard.HeaderFileExtensions, value: 'cpp'}]}" \
+// RUN:   -header-filter=.* --
+
+// CHECK-MESSAGES: 1:1: warning:  header is missing header guard
+
+// CHECK-FIXES: #ifndef LLVM_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_OUTPUT_LLVM_HEADER_GUARD_CPP_TMP_CPP
+// CHECK-FIXES-NEXT: #define LLVM_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_OUTPUT_LLVM_HEADER_GUARD_CPP_TMP_CPP
+// CHECK-FIXES: #endif
Index: test/clang-tidy/bugprone-header-guard.cpp
===
--- /dev/null
+++ test/clang-tidy/bugprone-header-guard.cpp
@@ -0,0 +1,21 @@
+// GuardStyle=default (minimal), HeaderFileExtension=cpp
+// RUN: %check_clang_tidy %s bugprone-header-guard %t -- -config="{CheckOptions: [{key: bugprone-header-guard.HeaderFileExtensions, value: 'cpp'}]}" -header-filter=.* --
+// GuardStyle=llvm,  HeaderFileExtension=cpp
+// RUN: %check_clang_tidy -check-suffix=LLVM %s bugprone-header-guard %t -- -config="{CheckOptions: [{key: bugprone-header-guard.HeaderFileExtensions, value: 'cpp'}, {key: bugprone-header-guard.GuardStyle, value: 'llvm'}]}" -header-filter=.* --
+// 

[PATCH] D62202: Work around a Visual C++ bug

2019-05-21 Thread Paul Robinson via Phabricator via cfe-commits
probinson added a comment.

  // FIXME: Change the following functions from anonymous namespace to static
  // after the minimum _MSC_VER >= 1915 (equivalent to Visual Studio version
  // of 15.8 or higher).  Works around a bug in earlier versions.

?

Also happy to include the hyperlink to the bug report (given in a previous 
reply) in the commit log.


Repository:
  rC Clang

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

https://reviews.llvm.org/D62202



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


[PATCH] D62045: Do not emit fixes for extern global constants in google-objc-global-variable-declaration check.

2019-05-21 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore requested changes to this revision.
stephanemoore added a comment.
This revision now requires changes to proceed.

Many thanks for being patient with me  I think there are just two more things 
✌️

❧

Sorry, I think my earlier description was understated. Maybe this would be a 
better commit description:
"""
Revise the google-objc-global-variable-declaration check to match the style 
guide.

This commit updates the check as follows:
(1) Do not emit fixes for extern global constants.
(2) Allow the second character of prefixes for constants to be numeric (the new 
guideline is that global constants should generally be named with a prefix that 
begins with a capital letter followed by one or more capital letters or 
numbers).

https://google.github.io/styleguide/objcguide.html#prefixes
"""

(sorry I am a bit disorganized since I have been juggling various things today)




Comment at: clang-tools-extra/clang-tidy/google/CMakeLists.txt:17
   OverloadedUnaryAndCheck.cpp
+  TestCheck.cpp
   TodoCommentCheck.cpp

This change doesn't look like it belongs in this commit? Please revert.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62045



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


Re: r361278 - [clang][Darwin] Refactor header search path logic into the driver

2019-05-21 Thread Galina Kistanova via cfe-commits
Hello Louis,

This commit broke few tests on the next builder:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/17776
Please have a look ASAP?

. . .
Failing Tests (4):
Clang :: Driver/darwin-header-search-libcxx.cpp
Clang :: Driver/darwin-header-search-libstdcxx.cpp
Clang :: Driver/darwin-header-search-system.cpp
LLVM :: CodeGen/AMDGPU/regbank-reassign.mir

The builder was already red and did not send any notifications.

Thanks

Galina

On Tue, May 21, 2019 at 10:45 AM Louis Dionne via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: ldionne
> Date: Tue May 21 10:48:04 2019
> New Revision: 361278
>
> URL: http://llvm.org/viewvc/llvm-project?rev=361278=rev
> Log:
> [clang][Darwin] Refactor header search path logic into the driver
>
> Summary:
> This commit moves the logic for determining system, resource and C++
> header search paths from CC1 to the driver. This refactor has already
> been made for several platforms, but Darwin had been left behind.
>
> This refactor tries to implement the previous search path logic with
> perfect accuracy. In particular, the order of all include paths inside
> CC1 and all paths that were skipped because nonexistent are conserved
> after the refactor. This change was also tested against a code base
> of significant size and revealed no problems.
>
> Reviewers: jfb, arphaman
>
> Subscribers: nemanjai, javed.absar, kbarton, christof, jkorous,
> dexonsmith, jsji, cfe-commits
>
> Tags: #clang
>
> Differential Revision: https://reviews.llvm.org/D61963
>
> Added:
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/arm64-apple-darwin10/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/arm64-apple-darwin10/.keep
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/lib/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/lib/.keep
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v6/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v6/.keep
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v7/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v7/.keep
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/lib/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/lib/.keep
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/ppc64/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/ppc64/.keep
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/ppc64/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/ppc64/.keep
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/lib/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/lib/.keep
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/
>
> 

[PATCH] D55463: Introduce a source minimizer that reduces source to directives that might affect the dependency list for a compilation

2019-05-21 Thread Michael Spencer via Phabricator via cfe-commits
Bigcheese accepted this revision.
Bigcheese added a comment.
This revision is now accepted and ready to land.

LGTM.


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

https://reviews.llvm.org/D55463



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


[PATCH] D61747: [clang-tidy] remove default header-filter for run-clang-tidy

2019-05-21 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE361344: [clang-tidy] remove default header-filter for 
run-clang-tidy (authored by dhinton, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61747?vs=198877=200620#toc

Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D61747

Files:
  clang-tidy/tool/run-clang-tidy.py


Index: clang-tidy/tool/run-clang-tidy.py
===
--- clang-tidy/tool/run-clang-tidy.py
+++ clang-tidy/tool/run-clang-tidy.py
@@ -84,9 +84,6 @@
   start = [clang_tidy_binary]
   if header_filter is not None:
 start.append('-header-filter=' + header_filter)
-  else:
-# Show warnings in all in-project headers by default.
-start.append('-header-filter=^' + build_path + '/.*')
   if checks:
 start.append('-checks=' + checks)
   if tmpdir is not None:


Index: clang-tidy/tool/run-clang-tidy.py
===
--- clang-tidy/tool/run-clang-tidy.py
+++ clang-tidy/tool/run-clang-tidy.py
@@ -84,9 +84,6 @@
   start = [clang_tidy_binary]
   if header_filter is not None:
 start.append('-header-filter=' + header_filter)
-  else:
-# Show warnings in all in-project headers by default.
-start.append('-header-filter=^' + build_path + '/.*')
   if checks:
 start.append('-checks=' + checks)
   if tmpdir is not None:
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] r361344 - [clang-tidy] remove default header-filter for run-clang-tidy

2019-05-21 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Tue May 21 18:01:11 2019
New Revision: 361344

URL: http://llvm.org/viewvc/llvm-project?rev=361344=rev
Log:
[clang-tidy] remove default header-filter for run-clang-tidy

Summary:
run-clang-tidy.py was enforcing '-header-filter' parameter with an
unfortunate default value when none was given. Thus, leading to
overwritten clang-tidy configuration (e.g. from .clang-tidy).

This change removes the default value for '-header-filter' resulting in
the default behaviour of clang-tidy itself.

Fixes PR#41426

Reviewed By: hintonda

Patch by Torbjörn Klatt!

Tags: #clang-tools-extra, #clang

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

Modified:
clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py

Modified: clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py?rev=361344=361343=361344=diff
==
--- clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py (original)
+++ clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py Tue May 21 
18:01:11 2019
@@ -84,9 +84,6 @@ def get_tidy_invocation(f, clang_tidy_bi
   start = [clang_tidy_binary]
   if header_filter is not None:
 start.append('-header-filter=' + header_filter)
-  else:
-# Show warnings in all in-project headers by default.
-start.append('-header-filter=^' + build_path + '/.*')
   if checks:
 start.append('-checks=' + checks)
   if tmpdir is not None:


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


[PATCH] D62138: [Docs] Increase Doxygen cache size

2019-05-21 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rC361343: [Docs] Increase Doxygen cache size (authored by 
dhinton, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D62138?vs=200261=200617#toc

Repository:
  rC Clang

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

https://reviews.llvm.org/D62138

Files:
  docs/doxygen.cfg.in


Index: docs/doxygen.cfg.in
===
--- docs/doxygen.cfg.in
+++ docs/doxygen.cfg.in
@@ -384,7 +384,7 @@
 # the optimal cache size from a speed point of view.
 # Minimum value: 0, maximum value: 9, default value: 0.
 
-LOOKUP_CACHE_SIZE  = 2
+LOOKUP_CACHE_SIZE  = 3
 
 #---
 # Build related configuration options


Index: docs/doxygen.cfg.in
===
--- docs/doxygen.cfg.in
+++ docs/doxygen.cfg.in
@@ -384,7 +384,7 @@
 # the optimal cache size from a speed point of view.
 # Minimum value: 0, maximum value: 9, default value: 0.
 
-LOOKUP_CACHE_SIZE  = 2
+LOOKUP_CACHE_SIZE  = 3
 
 #---
 # Build related configuration options
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r361343 - [Docs] Increase Doxygen cache size

2019-05-21 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Tue May 21 17:56:42 2019
New Revision: 361343

URL: http://llvm.org/viewvc/llvm-project?rev=361343=rev
Log:
[Docs] Increase Doxygen cache size

Summary:
When building Doxygen docs for llvm and clang, it helpfully prints a warning at
the end noting that the `LOOKUP_CACHE_SIZE` value was too small to keep all
symbols in memory.

By increasing to the size it recommends, Doxygen builds have greatly improved
performance. On my machine, time to run `doxygen-llvm` changes from 34 minutes
to 22 minutes, which is a decent amount of time saved by changing a single
number.

Reviewed By: hintonda

Patch by J. Ryan Stinnett!

Tags: #clang, #llvm

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

Modified:
cfe/trunk/docs/doxygen.cfg.in

Modified: cfe/trunk/docs/doxygen.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/doxygen.cfg.in?rev=361343=361342=361343=diff
==
--- cfe/trunk/docs/doxygen.cfg.in (original)
+++ cfe/trunk/docs/doxygen.cfg.in Tue May 21 17:56:42 2019
@@ -384,7 +384,7 @@ TYPEDEF_HIDES_STRUCT   = NO
 # the optimal cache size from a speed point of view.
 # Minimum value: 0, maximum value: 9, default value: 0.
 
-LOOKUP_CACHE_SIZE  = 2
+LOOKUP_CACHE_SIZE  = 3
 
 #---
 # Build related configuration options


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


[PATCH] D62174: [Analysis] Link library dependencies to Analysis plugins

2019-05-21 Thread Petr Hosek via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rC361340: [Analysis] Link library dependencies to Analysis 
plugins (authored by phosek, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D62174?vs=200405=200615#toc

Repository:
  rC Clang

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

https://reviews.llvm.org/D62174

Files:
  test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
  test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
  test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt


Index: test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
===
--- test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
+++ test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
@@ -1,11 +1,12 @@
 set(LLVM_EXPORTED_SYMBOL_FILE 
${CMAKE_CURRENT_SOURCE_DIR}/CheckerDependencyHandlingAnalyzerPlugin.exports)
 add_llvm_library(CheckerDependencyHandlingAnalyzerPlugin MODULE 
CheckerDependencyHandling.cpp PLUGIN_TOOL clang)
 
-if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+if(LLVM_ENABLE_PLUGINS)
   target_link_libraries(CheckerDependencyHandlingAnalyzerPlugin PRIVATE
 clangAnalysis
 clangAST
 clangStaticAnalyzerCore
+clangStaticAnalyzerFrontend
 LLVMSupport
 )
 endif()
Index: test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
===
--- test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
+++ test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
@@ -1,11 +1,12 @@
 set(LLVM_EXPORTED_SYMBOL_FILE 
${CMAKE_CURRENT_SOURCE_DIR}/SampleAnalyzerPlugin.exports)
 add_llvm_library(SampleAnalyzerPlugin MODULE MainCallChecker.cpp PLUGIN_TOOL 
clang)
 
-if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+if(LLVM_ENABLE_PLUGINS)
   target_link_libraries(SampleAnalyzerPlugin PRIVATE
 clangAnalysis
 clangAST
 clangStaticAnalyzerCore
+clangStaticAnalyzerFrontend
 LLVMSupport
 )
 endif()
Index: test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
===
--- test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
+++ test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
@@ -1,11 +1,12 @@
 set(LLVM_EXPORTED_SYMBOL_FILE 
${CMAKE_CURRENT_SOURCE_DIR}/CheckerOptionHandlingAnalyzerPlugin.exports)
 add_llvm_library(CheckerOptionHandlingAnalyzerPlugin MODULE 
CheckerOptionHandling.cpp PLUGIN_TOOL clang)
 
-if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+if(LLVM_ENABLE_PLUGINS)
   target_link_libraries(CheckerOptionHandlingAnalyzerPlugin PRIVATE
 clangAnalysis
 clangAST
 clangStaticAnalyzerCore
+clangStaticAnalyzerFrontend
 LLVMSupport
 )
 endif()


Index: test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
===
--- test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
+++ test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
@@ -1,11 +1,12 @@
 set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CheckerDependencyHandlingAnalyzerPlugin.exports)
 add_llvm_library(CheckerDependencyHandlingAnalyzerPlugin MODULE CheckerDependencyHandling.cpp PLUGIN_TOOL clang)
 
-if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+if(LLVM_ENABLE_PLUGINS)
   target_link_libraries(CheckerDependencyHandlingAnalyzerPlugin PRIVATE
 clangAnalysis
 clangAST
 clangStaticAnalyzerCore
+clangStaticAnalyzerFrontend
 LLVMSupport
 )
 endif()
Index: test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
===
--- test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
+++ test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
@@ -1,11 +1,12 @@
 set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/SampleAnalyzerPlugin.exports)
 add_llvm_library(SampleAnalyzerPlugin MODULE MainCallChecker.cpp PLUGIN_TOOL clang)
 
-if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+if(LLVM_ENABLE_PLUGINS)
   target_link_libraries(SampleAnalyzerPlugin PRIVATE
 clangAnalysis
 clangAST
 clangStaticAnalyzerCore
+clangStaticAnalyzerFrontend
 LLVMSupport
 )
 endif()
Index: test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
===
--- test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
+++ test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
@@ -1,11 +1,12 @@
 set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CheckerOptionHandlingAnalyzerPlugin.exports)
 add_llvm_library(CheckerOptionHandlingAnalyzerPlugin MODULE CheckerOptionHandling.cpp PLUGIN_TOOL clang)
 
-if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+if(LLVM_ENABLE_PLUGINS)
   target_link_libraries(CheckerOptionHandlingAnalyzerPlugin PRIVATE
 clangAnalysis
 clangAST
 clangStaticAnalyzerCore

r361340 - [Analysis] Link library dependencies to Analysis plugins

2019-05-21 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue May 21 17:47:37 2019
New Revision: 361340

URL: http://llvm.org/viewvc/llvm-project?rev=361340=rev
Log:
[Analysis] Link library dependencies to Analysis plugins

These are needed to avoid undefined symbols which aren't satisfied
by Clang itself.

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

Modified:
cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
cfe/trunk/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
cfe/trunk/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt

Modified: 
cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt?rev=361340=361339=361340=diff
==
--- cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt 
(original)
+++ cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt 
Tue May 21 17:47:37 2019
@@ -1,11 +1,12 @@
 set(LLVM_EXPORTED_SYMBOL_FILE 
${CMAKE_CURRENT_SOURCE_DIR}/CheckerDependencyHandlingAnalyzerPlugin.exports)
 add_llvm_library(CheckerDependencyHandlingAnalyzerPlugin MODULE 
CheckerDependencyHandling.cpp PLUGIN_TOOL clang)
 
-if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+if(LLVM_ENABLE_PLUGINS)
   target_link_libraries(CheckerDependencyHandlingAnalyzerPlugin PRIVATE
 clangAnalysis
 clangAST
 clangStaticAnalyzerCore
+clangStaticAnalyzerFrontend
 LLVMSupport
 )
 endif()

Modified: cfe/trunk/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt?rev=361340=361339=361340=diff
==
--- cfe/trunk/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt 
(original)
+++ cfe/trunk/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt Tue 
May 21 17:47:37 2019
@@ -1,11 +1,12 @@
 set(LLVM_EXPORTED_SYMBOL_FILE 
${CMAKE_CURRENT_SOURCE_DIR}/CheckerOptionHandlingAnalyzerPlugin.exports)
 add_llvm_library(CheckerOptionHandlingAnalyzerPlugin MODULE 
CheckerOptionHandling.cpp PLUGIN_TOOL clang)
 
-if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+if(LLVM_ENABLE_PLUGINS)
   target_link_libraries(CheckerOptionHandlingAnalyzerPlugin PRIVATE
 clangAnalysis
 clangAST
 clangStaticAnalyzerCore
+clangStaticAnalyzerFrontend
 LLVMSupport
 )
 endif()

Modified: cfe/trunk/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt?rev=361340=361339=361340=diff
==
--- cfe/trunk/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt (original)
+++ cfe/trunk/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt Tue May 21 
17:47:37 2019
@@ -1,11 +1,12 @@
 set(LLVM_EXPORTED_SYMBOL_FILE 
${CMAKE_CURRENT_SOURCE_DIR}/SampleAnalyzerPlugin.exports)
 add_llvm_library(SampleAnalyzerPlugin MODULE MainCallChecker.cpp PLUGIN_TOOL 
clang)
 
-if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+if(LLVM_ENABLE_PLUGINS)
   target_link_libraries(SampleAnalyzerPlugin PRIVATE
 clangAnalysis
 clangAST
 clangStaticAnalyzerCore
+clangStaticAnalyzerFrontend
 LLVMSupport
 )
 endif()


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


RE: r361278 - [clang][Darwin] Refactor header search path logic into the driver

2019-05-21 Thread via cfe-commits
Hi Louis,

The three tests you added all seem to be failing when run on Windows. I suspect 
the reason is because you define TOOLCHAIN as an argument to FileCheck, which 
causes the line separators to be escaped, which then causes the FileCheck to 
fail.

For example, see this test output 
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/25983/steps/test/logs/stdio:

FAIL: Clang :: Driver/darwin-header-search-libstdcxx.cpp (8570 of 49179)
...
$ 
"c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\filecheck.exe"
 
"-DTOOLCHAIN=C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Driver/Inputs/basic_darwin_toolchain"
 "--check-prefix=CHECK-LIBCXX-TOOLCHAIN-1" 
"C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Driver\darwin-header-search-libcxx.cpp"
# command stderr:
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Driver\darwin-header-search-libcxx.cpp:23:30:
 error: CHECK-LIBCXX-TOOLCHAIN-1: expected string not found in input
...
:5:107: note: with variable "TOOLCHAIN" equal to 
"C:ps4-buildslave2llvm-clang-lld-x86_64-scei-ps4-windows10pro-fastllvm\\.srctoolsclangtestDriver/Inputs/basic_darwin_toolchain"
...
:5:901: note: possible intended match here

 
"c:\\ps4-buildslave2\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.obj\\bin\\clang.exe"
 "-cc1" "-triple" "x86_64-apple-macosx10.4.0" "-Wdeprecated-objc-isa-usage" 
"-Werror=deprecated-objc-isa-usage" "-fsyntax-only" "-disable-free" 
"-main-file-name" "darwin-header-search-libcxx.cpp" "-mrelocation-model" "pic" 
"-pic-level" "2" "-mthread-model" "posix" "-mdisable-fp-elim" "-masm-verbose" 
"-munwind-tables" "-faligned-alloc-unavailable" "-target-cpu" "core2" 
"-dwarf-column-info" "-debugger-tuning=lldb" "-ggnu-pubnames" "-resource-dir" 
"c:\\ps4-buildslave2\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.obj\\lib\\clang\\9.0.0"
 "-stdlib=libc++" "-internal-isystem" 
"C:\\ps4-buildslave2\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.src\\tools\\clang\\test\\Driver/Inputs/basic_darwin_toolchain/usr/bin\\..\\include\\c++\\v1"
 "-internal-isystem" "/usr\\include\\c++\\v1" "-internal-isystem" 
"/usr\\local\\include" "-internal-isystem" 
"c:\\ps4-buildslave2\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.obj\\lib\\clang\\9.0.0\\include"
 "-internal-externc-isystem" "/usr\\include" "-fdeprecated-macro" 
"-fdebug-compilation-dir" 
"C:\\ps4-buildslave2\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.obj\\tools\\clang\\test\\Driver"
 "-ferror-limit" "19" "-fmessage-length" "0" "-fblocks" 
"-fblocks-runtime-optional" "-fencode-extended-block-signature" 
"-fregister-global-dtors-with-atexit" "-fobjc-runtime=macosx-10.4.0" 
"-fobjc-dispatch-method=non-legacy" "-fcxx-exceptions" "-fexceptions" 
"-fmax-type-align=16" "-fdiagnostics-show-option" "-x" "c++" 
"C:\\ps4-buildslave2\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.src\\tools\\clang\\test\\Driver\\darwin-header-search-libcxx.cpp"


Note that the path as passed as an argument to FileCheck is 
"C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Driver/Inputs/basic_darwin_toolchain",
 the value of TOOLCHAIN as expected by FileCheck is 
"C:ps4-buildslave2llvm-clang-lld-x86_64-scei-ps4-windows10pro-fastllvm\\.srctoolsclangtestDriver/Inputs/basic_darwin_toolchain",
 but the value in what it likely would match is " 
C:\\ps4-buildslave2\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.src\\tools\\clang\\test\\Driver/Inputs/basic_darwin_toolchain".

Can you take a look and fix the test on Windows please?

Douglas Yung

-Original Message-
From: cfe-commits  On Behalf Of Louis 
Dionne via cfe-commits
Sent: Tuesday, May 21, 2019 10:48
To: cfe-commits@lists.llvm.org
Subject: r361278 - [clang][Darwin] Refactor header search path logic into the 
driver

Author: ldionne
Date: Tue May 21 10:48:04 2019
New Revision: 361278

URL: http://llvm.org/viewvc/llvm-project?rev=361278=rev
Log:
[clang][Darwin] Refactor header search path logic into the driver

Summary:
This commit moves the logic for determining system, resource and C++
header search paths from CC1 to the driver. This refactor has already
been made for several platforms, but Darwin had been left behind.

This refactor tries to implement the previous search path logic with
perfect accuracy. In particular, the order of all include paths inside
CC1 and all paths that were skipped because nonexistent are conserved
after the refactor. This change was also tested against a code base
of significant size and revealed no problems.

Reviewers: jfb, arphaman

Subscribers: nemanjai, javed.absar, kbarton, christof, jkorous, dexonsmith, 
jsji, cfe-commits

Tags: #clang

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


[PATCH] D62045: Do not emit fixes for extern global constants in google-objc-global-variable-declaration check.

2019-05-21 Thread Yaqi Ji via Phabricator via cfe-commits
yaqiji updated this revision to Diff 200614.
yaqiji added a comment.

Removed extra space.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62045

Files:
  clang-tools-extra/clang-tidy/google/CMakeLists.txt
  clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp
  clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m

Index: clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m
===
--- clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m
+++ clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m
@@ -1,10 +1,14 @@
 // RUN: %check_clang_tidy %s google-objc-global-variable-declaration %t
 
 @class NSString;
+
 static NSString* const myConstString = @"hello";
 // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'myConstString' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
 // CHECK-FIXES: static NSString* const kMyConstString = @"hello";
 
+extern NSString* const GlobalConstant = @"hey";
+// CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'GlobalConstant' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
+
 static NSString* MyString = @"hi";
 // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: non-const global variable 'MyString' must have a name which starts with 'g[A-Z]' [google-objc-global-variable-declaration]
 // CHECK-FIXES: static NSString* gMyString = @"hi";
@@ -25,13 +29,21 @@
 // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable '_notAlpha' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
 // CHECK-FIXES: static NSString* const _notAlpha = @"NotBeginWithAlpha";
 
+static NSString* const notCap = @"NotBeginWithCap";
+// CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'notCap' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
+
 static NSString* const k_Alpha = @"SecondNotAlpha";
 // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'k_Alpha' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
 // CHECK-FIXES: static NSString* const k_Alpha = @"SecondNotAlpha";
 
+static NSString* const SecondNotCap = @"SecondNotCapOrNumber";
+// CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'SecondNotCap' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
+
 static NSString* const kGood = @"hello";
 static NSString* const XYGood = @"hello";
+static NSString* const X1Good = @"hello";
 static NSString* gMyIntGood = 0;
+extern NSString* Y2Good;
 
 extern NSString* const GTLServiceErrorDomain;
 
@@ -42,8 +54,8 @@
 
 @implementation Foo
 - (void)f {
-int x = 0;
-static int bar;
-static const int baz = 42;
+  int x = 0;
+  static int bar;
+  static const int baz = 42;
 }
 @end
Index: clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp
===
--- clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp
+++ clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp
@@ -23,29 +23,35 @@
 
 namespace {
 
-AST_MATCHER(VarDecl, isLocalVariable) {
-  return Node.isLocalVarDecl();
-}
+AST_MATCHER(VarDecl, isLocalVariable) { return Node.isLocalVarDecl(); }
 
 FixItHint generateFixItHint(const VarDecl *Decl, bool IsConst) {
+  if (IsConst && Decl->hasExternalStorage()) {
+// No fix available if it is a extern global constant, since it is difficult
+// to determine the proper fix in this case.
+return FixItHint();
+  }
+
   char FC = Decl->getName()[0];
   if (!llvm::isAlpha(FC) || Decl->getName().size() == 1) {
 // No fix available if first character is not alphabetical character, or it
-// is a single-character variable, since it is difficult to determine the 
+// is a single-character variable, since it is difficult to determine the
 // proper fix in this case. Users should create a proper variable name by
 // their own.
 return FixItHint();
   }
   char SC = Decl->getName()[1];
   if ((FC == 'k' || FC == 'g') && !llvm::isAlpha(SC)) {
-// No fix available if the prefix is correct but the second character is not
-// alphabetical, since it is difficult to determine the proper fix in this
-// case.
+// No fix available if the prefix is correct but the second character is
+// not alphabetical, since it is difficult to determine the proper fix in
+// this case.
 return FixItHint();
   }
+
   auto NewName = (IsConst ? "k" : "g") +
  llvm::StringRef(std::string(1, FC)).upper() +
  

[PATCH] D62045: Do not emit fixes for extern global constants in google-objc-global-variable-declaration check.

2019-05-21 Thread Yaqi Ji via Phabricator via cfe-commits
yaqiji updated this revision to Diff 200613.
yaqiji marked 4 inline comments as done.
yaqiji added a comment.

Restored fix.
Added test case for extern Cap+Number prefixes.
Restored reformatting.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62045

Files:
  clang-tools-extra/clang-tidy/google/CMakeLists.txt
  clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp
  clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m

Index: clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m
===
--- clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m
+++ clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m
@@ -1,10 +1,14 @@
 // RUN: %check_clang_tidy %s google-objc-global-variable-declaration %t
 
 @class NSString;
+
 static NSString* const myConstString = @"hello";
 // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'myConstString' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
 // CHECK-FIXES: static NSString* const kMyConstString = @"hello";
 
+extern NSString* const GlobalConstant = @"hey";
+// CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'GlobalConstant' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
+
 static NSString* MyString = @"hi";
 // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: non-const global variable 'MyString' must have a name which starts with 'g[A-Z]' [google-objc-global-variable-declaration]
 // CHECK-FIXES: static NSString* gMyString = @"hi";
@@ -25,13 +29,21 @@
 // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable '_notAlpha' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
 // CHECK-FIXES: static NSString* const _notAlpha = @"NotBeginWithAlpha";
 
+static NSString* const notCap = @"NotBeginWithCap";
+// CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'notCap' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
+
 static NSString* const k_Alpha = @"SecondNotAlpha";
 // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'k_Alpha' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
 // CHECK-FIXES: static NSString* const k_Alpha = @"SecondNotAlpha";
 
+static NSString* const SecondNotCap = @"SecondNotCapOrNumber";
+// CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'SecondNotCap' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
+
 static NSString* const kGood = @"hello";
 static NSString* const XYGood = @"hello";
+static NSString* const X1Good = @"hello";
 static NSString* gMyIntGood = 0;
+extern NSString* Y2Good;
 
 extern NSString* const GTLServiceErrorDomain;
 
@@ -42,8 +54,8 @@
 
 @implementation Foo
 - (void)f {
-int x = 0;
-static int bar;
-static const int baz = 42;
+  int x = 0;
+  static int bar;
+  static const int baz = 42;
 }
 @end
Index: clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp
===
--- clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp
+++ clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp
@@ -23,34 +23,40 @@
 
 namespace {
 
-AST_MATCHER(VarDecl, isLocalVariable) {
-  return Node.isLocalVarDecl();
-}
+AST_MATCHER(VarDecl, isLocalVariable) { return Node.isLocalVarDecl(); }
 
 FixItHint generateFixItHint(const VarDecl *Decl, bool IsConst) {
+  if (IsConst && Decl->hasExternalStorage()) {
+// No fix available if it is a extern global constant, since it is difficult
+// to determine the proper fix in this case.
+return FixItHint();
+  }
+
   char FC = Decl->getName()[0];
   if (!llvm::isAlpha(FC) || Decl->getName().size() == 1) {
 // No fix available if first character is not alphabetical character, or it
-// is a single-character variable, since it is difficult to determine the 
+// is a single-character variable, since it is difficult to determine the
 // proper fix in this case. Users should create a proper variable name by
 // their own.
 return FixItHint();
   }
   char SC = Decl->getName()[1];
   if ((FC == 'k' || FC == 'g') && !llvm::isAlpha(SC)) {
-// No fix available if the prefix is correct but the second character is not
-// alphabetical, since it is difficult to determine the proper fix in this
-// case.
+// No fix available if the prefix is correct but the second character is
+// not alphabetical, since it is difficult to determine the proper fix in
+// this case.
 return FixItHint();
   }
+
   auto NewName = (IsConst ? "k" : "g") +
   

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2019-05-21 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments.



Comment at: clang/include/clang/Sema/DeclSpec.h:1753-1758
+// Describes whether the current context is a context where an implicit
+// typename is allowed (C++2a [temp.res]p5]).
+enum ImplicitTypenameContext {
+  ITC_Never,
+  ITC_Yes,
+};

Consider using an `enum class` here.



Comment at: clang/lib/Parse/ParseDecl.cpp:2652-2654
+  // But only if we are not in a function prototype scope.
+  if (getCurScope()->isFunctionPrototypeScope())
+break;

rsmith wrote:
> Can you split out this error recovery improvement and commit it separately 
> before the rest of this work? It doesn't appear to have any dependency on the 
> rest of the change.
Looks like you need to rebase; the change was committed but is still in the 
latest version of this patch.



Comment at: clang/lib/Parse/ParseDecl.cpp:4321
+ isCXXDeclarationSpecifier(ITC_Never, TPResult::True) !=
+ TPResult::True) ||
+(!getLangOpts().CPlusPlus && !isDeclarationSpecifier(ITC_Yes))) {

It seems like a wording oversight that we don't assume `typename` in an 
//enum-base//. Probably would be good to raise this on the core reflector.



Comment at: clang/lib/Parse/ParseDecl.cpp:4322
+ TPResult::True) ||
+(!getLangOpts().CPlusPlus && !isDeclarationSpecifier(ITC_Yes))) {
   // We'll parse this as a bitfield later.

Using a different `ITC` value for non-C++ compilations seems surprising. (It 
should never make any difference outside of C++, but leaves the reader 
wondering why the two are different.) Can we use `ITC_Never` here for 
consistency?



Comment at: clang/lib/Parse/ParseDecl.cpp:5100-5101
   bool IsConstructor = false;
-  if (isDeclarationSpecifier())
+  if (isDeclarationSpecifier(ITC_Never))
 IsConstructor = true;
   else if (Tok.is(tok::identifier) ||

Oh, this could be a problem.

If this *is* a constructor declaration, then this is implicit typename context: 
this is either a "//parameter-declaration// in a //member-declaration//" 
([temp.res]/5.2.3) or a "//parameter-declaration// in a //declarator// of a 
function or function template declaration whose //declarator-id// is 
qualified". But if it's *not* a constructor declaration, then this is either 
the //declarator-id// of a declaration or the //nested-name-specifier// of a 
pointer-to-member declarator:

```
template
struct C {
  C(T::type); // implicit typename context
  friend C (T::fn)(); // not implicit typename context, declarator-id of friend 
declaration
  C(T::type::*x)[3]; // not implicit typename context, pointer-to-member type
};
```

I think we need to use `ITC_Yes` here, in order to correctly disambiguate the 
first example above. Please add tests for the other two cases to make sure this 
doesn't break them -- but I'm worried this **will** break the second case, 
because it will incorrectly annotate `T::fn` as a type.



Comment at: clang/lib/Sema/Sema.cpp:2219
+  
+  D.setPrevLookupResult(llvm::make_unique(std::move(LR)));
+  return Result;

Consider moving the `make_unique` earlier (directly before 
`LookupQualifiedName`) to avoid needing to move the `LookupResult` object into 
different storage here.



Comment at: clang/lib/Sema/SemaTemplate.cpp:3369
 if (!LookupCtx && isDependentScopeSpecifier(SS)) {
-  Diag(SS.getBeginLoc(), diag::err_typename_missing_template)
-<< SS.getScopeRep() << TemplateII->getName();
-  // Recover as if 'typename' were specified.
+  // C++2a relaxes some of those restrictinos in [temp.res]p5.
+  if (getLangOpts().CPlusPlus2a)

Are there any cases where we would call this for which C++20 still requires a 
`typename` keyword? Should this function be passed an `ImplicitTypenameContext`?



Comment at: clang/lib/Sema/SemaTemplate.cpp:3377-3379
   // FIXME: This is not quite correct recovery as we don't transform SS
   // into the corresponding dependent form (and we don't diagnose missing
   // 'template' keywords within SS as a result).

This FIXME is concerning. Is this a problem with this patch? (Is the FIXME 
wrong now?)



Comment at: clang/test/CXX/drs/dr5xx.cpp:485
 namespace dr542 { // dr542: yes
-#if __cplusplus >= 201103L
+#if __cplusplus >= 201103L && __cplusplus <= 201703L
   struct A { A() = delete; int n; };

A comment here explaining that `A` and `B` stop being aggregates in C++20 would 
be nice. (Nicer would be changing the testcase so it still tests the relevant 
rule in C++20 mode, if that's possible...)



Comment at: clang/test/CXX/temp/temp.res/p5.cpp:1
+// RUN: %clang_cc1 -std=c++2a -pedantic -verify %s
+

Please add tests for enum-base and 

[PATCH] D62225: [clang][NewPM] Fixing -O0 tests that are broken under new PM

2019-05-21 Thread Eric Christopher via Phabricator via cfe-commits
echristo added inline comments.



Comment at: clang/lib/CodeGen/BackendUtil.cpp:1104-1105
   // which is just that always inlining occurs.
-  MPM.addPass(AlwaysInlinerPass());
+  // We always pass false here since according to the legacy PM logic for
+  // enabling lifetime intrinsics, we should not be compiling with O0.
+  MPM.addPass(AlwaysInlinerPass(/*InsertLifetimeIntrinsics=*/false));

Can you elaborate more here? We do turn on the always inliner at O0 which makes 
this comment a bit confusing.



Comment at: clang/test/CodeGen/aarch64-neon-fma.c:235
 // CHECK: attributes #1 ={{.*}}"min-legal-vector-width"="128"
+// CHECK: attributes [[NOUNWIND_ATTR]] = { nounwind }

Do we really need to check for it or does the autogeneration of testcases do 
some of this?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62225



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


[PATCH] D61923: [GWP-ASan] Mutex implementation [2].

2019-05-21 Thread Evgenii Stepanov via Phabricator via cfe-commits
eugenis added inline comments.



Comment at: compiler-rt/lib/gwp_asan/platform_specific/mutex_posix.cpp:43
+
+Mutex::Mutex() : PImpl(new Impl) {}
+Mutex::~Mutex() { delete PImpl; }

This is a dependency on libc++ / libstdc++.

I'm not sure about using malloc() inside mutex constructor, either.

We will probably want the mutex to be linker-initialized, too. AFAIK, gwp-asan 
would not have any clear initialization entry point, and would need to do this 
lazily in malloc, which can there be several of, concurrently.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61923



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


[PATCH] D62045: Modified global variable declaration to fit updated objc guide.

2019-05-21 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore requested changes to this revision.
stephanemoore added a comment.
This revision now requires changes to proceed.

Almost there. I think everything looks good after we resolve this last round of 
comments.

Can you also update the commit description. I believe that the current changes 
can be described roughly as follows:
"""
Do not emit fixes for extern global constants in 
google-objc-global-variable-declaration check.
"""




Comment at: 
clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m:26
 // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable '_notAlpha' 
must have a name which starts with an appropriate prefix 
[google-objc-global-variable-declaration]
-// CHECK-FIXES: static NSString* const _notAlpha = @"NotBeginWithAlpha";
 

stephanemoore wrote:
> Thanks for removing the fixit on this case  The fix was not compliant with 
> Google Objective-C style.
Oh wait. I believe this was here to verify that no fix was recommended. We 
should restore this.

(sorry for the error on my part 臘)



Comment at: 
clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m:30
-// CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'k_Alpha' 
must have a name which starts with an appropriate prefix 
[google-objc-global-variable-declaration]
-// CHECK-FIXES: static NSString* const k_Alpha = @"SecondNotAlpha";
 

stephanemoore wrote:
> Thanks for removing the fixit on this case  The fix was not compliant with 
> Google Objective-C style.
Oh wait. I believe this was here to verify that no fix was recommended. We 
should restore this.

(sorry for the error on my part 臘)



Comment at: 
clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m:5
+
+static NSString *const myConstString = @"hello";
 // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 
'myConstString' must have a name which starts with an appropriate prefix 
[google-objc-global-variable-declaration]

In general I recommend splitting stylistic changes independently of functional 
changes so that it's easy to identify changes that actually affected behavior.

I recommend one of the two following actions:
(1) Expand the commit description to describe the reformatting changes to 
`google-objc-global-variable-declaration.m` so that it's clear to readers that 
these were intentional changes included in this commit.
(2) Split out the reformatting changes unrelated to resolving the inconsistency 
between the check and the Objective-C style guide into an independent commit 
and submit that for independent review.



Comment at: 
clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m:45
 
-extern NSString* const GTLServiceErrorDomain;
+extern NSString *const GTLServiceErrorDomain;
 

Can we add a test case as follows:
```
extern NSString *Y2Good;
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62045



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


[PATCH] D61643: [PragmaHandler] Expose `#pragma` location

2019-05-21 Thread Joel E. Denny via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rC361335: [PragmaHandler] Expose `#pragma` location (authored 
by jdenny, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61643?vs=198489=200608#toc

Repository:
  rC Clang

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

https://reviews.llvm.org/D61643

Files:
  docs/ClangPlugins.rst
  examples/AnnotateFunctions/AnnotateFunctions.cpp
  include/clang/Lex/Pragma.h
  include/clang/Lex/Preprocessor.h
  lib/Frontend/PrintPreprocessedOutput.cpp
  lib/Lex/PPDirectives.cpp
  lib/Lex/Pragma.cpp
  lib/Parse/ParsePragma.cpp

Index: docs/ClangPlugins.rst
===
--- docs/ClangPlugins.rst
+++ docs/ClangPlugins.rst
@@ -55,7 +55,7 @@
   class ExamplePragmaHandler : public PragmaHandler {
   public:
 ExamplePragmaHandler() : PragmaHandler("example_pragma") { }
-void HandlePragma(Preprocessor , PragmaIntroducerKind Introducer,
+void HandlePragma(Preprocessor , PragmaIntroducer Introducer,
   Token ) {
   // Handle the pragma
 }
Index: include/clang/Lex/Preprocessor.h
===
--- include/clang/Lex/Preprocessor.h
+++ include/clang/Lex/Preprocessor.h
@@ -2291,8 +2291,7 @@
   void HandleElifDirective(Token , const Token );
 
   // Pragmas.
-  void HandlePragmaDirective(SourceLocation IntroducerLoc,
- PragmaIntroducerKind Introducer);
+  void HandlePragmaDirective(PragmaIntroducer Introducer);
 
 public:
   void HandlePragmaOnce(Token );
Index: include/clang/Lex/Pragma.h
===
--- include/clang/Lex/Pragma.h
+++ include/clang/Lex/Pragma.h
@@ -14,6 +14,7 @@
 #define LLVM_CLANG_LEX_PRAGMA_H
 
 #include "clang/Basic/LLVM.h"
+#include "clang/Basic/SourceLocation.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include 
@@ -46,6 +47,12 @@
 PIK___pragma
   };
 
+  /// Describes how and where the pragma was introduced.
+  struct PragmaIntroducer {
+PragmaIntroducerKind Kind;
+SourceLocation Loc;
+  };
+
 /// PragmaHandler - Instances of this interface defined to handle the various
 /// pragmas that the language front-end uses.  Each handler optionally has a
 /// name (e.g. "pack") and the HandlePragma method is invoked when a pragma with
@@ -64,7 +71,7 @@
   virtual ~PragmaHandler();
 
   StringRef getName() const { return Name; }
-  virtual void HandlePragma(Preprocessor , PragmaIntroducerKind Introducer,
+  virtual void HandlePragma(Preprocessor , PragmaIntroducer Introducer,
 Token ) = 0;
 
   /// getIfNamespace - If this is a namespace, return it.  This is equivalent to
@@ -78,7 +85,7 @@
 public:
   explicit EmptyPragmaHandler(StringRef Name = StringRef());
 
-  void HandlePragma(Preprocessor , PragmaIntroducerKind Introducer,
+  void HandlePragma(Preprocessor , PragmaIntroducer Introducer,
 Token ) override;
 };
 
@@ -111,7 +118,7 @@
 
   bool IsEmpty() const { return Handlers.empty(); }
 
-  void HandlePragma(Preprocessor , PragmaIntroducerKind Introducer,
+  void HandlePragma(Preprocessor , PragmaIntroducer Introducer,
 Token ) override;
 
   PragmaNamespace *getIfNamespace() override { return this; }
Index: examples/AnnotateFunctions/AnnotateFunctions.cpp
===
--- examples/AnnotateFunctions/AnnotateFunctions.cpp
+++ examples/AnnotateFunctions/AnnotateFunctions.cpp
@@ -58,7 +58,7 @@
 public:
   PragmaAnnotateHandler() : PragmaHandler("enable_annotate") { }
 
-  void HandlePragma(Preprocessor , PragmaIntroducerKind Introducer,
+  void HandlePragma(Preprocessor , PragmaIntroducer Introducer,
 Token ) override {
 
 Token Tok;
Index: lib/Parse/ParsePragma.cpp
===
--- lib/Parse/ParsePragma.cpp
+++ lib/Parse/ParsePragma.cpp
@@ -26,71 +26,72 @@
 
 struct PragmaAlignHandler : public PragmaHandler {
   explicit PragmaAlignHandler() : PragmaHandler("align") {}
-  void HandlePragma(Preprocessor , PragmaIntroducerKind Introducer,
+  void HandlePragma(Preprocessor , PragmaIntroducer Introducer,
 Token ) override;
 };
 
 struct PragmaGCCVisibilityHandler : public PragmaHandler {
   explicit PragmaGCCVisibilityHandler() : PragmaHandler("visibility") {}
-  void HandlePragma(Preprocessor , PragmaIntroducerKind Introducer,
+  void HandlePragma(Preprocessor , PragmaIntroducer Introducer,
 Token ) override;
 };
 
 struct PragmaOptionsHandler : public PragmaHandler {
   explicit PragmaOptionsHandler() : PragmaHandler("options") {}
-  void HandlePragma(Preprocessor , PragmaIntroducerKind Introducer,
+  void HandlePragma(Preprocessor , PragmaIntroducer Introducer,
 

[PATCH] D61643: [PragmaHandler] Expose `#pragma` location

2019-05-21 Thread Joel E. Denny via Phabricator via cfe-commits
jdenny added a comment.

In D61643#1510815 , @Meinersbur wrote:

> +1
>
> Such a solution also came up in https://bugs.llvm.org/show_bug.cgi?id=41514#c1


Cool.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61643



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


r361335 - [PragmaHandler] Expose `#pragma` location

2019-05-21 Thread Joel E. Denny via cfe-commits
Author: jdenny
Date: Tue May 21 16:51:38 2019
New Revision: 361335

URL: http://llvm.org/viewvc/llvm-project?rev=361335=rev
Log:
[PragmaHandler] Expose `#pragma` location

Currently, a pragma AST node's recorded location starts at the
namespace token (such as `omp` in the case of OpenMP) after the
`#pragma` token, and the `#pragma` location isn't available.  However,
the `#pragma` location can be useful when, for example, rewriting a
directive using Clang's Rewrite facility.

This patch makes `#pragma` locations available in any `PragmaHandler`
but it doesn't yet make use of them.

This patch also uses the new `struct PragmaIntroducer` to simplify
`Preprocessor::HandlePragmaDirective`.  It doesn't do the same for
`PPCallbacks::PragmaDirective` because that changes the API documented
in `clang-tools-extra/docs/pp-trace.rst`, and I'm not sure about
backward compatibility guarantees there.

Reviewed By: ABataev, lebedev.ri, aaron.ballman

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

Modified:
cfe/trunk/docs/ClangPlugins.rst
cfe/trunk/examples/AnnotateFunctions/AnnotateFunctions.cpp
cfe/trunk/include/clang/Lex/Pragma.h
cfe/trunk/include/clang/Lex/Preprocessor.h
cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp
cfe/trunk/lib/Lex/PPDirectives.cpp
cfe/trunk/lib/Lex/Pragma.cpp
cfe/trunk/lib/Parse/ParsePragma.cpp

Modified: cfe/trunk/docs/ClangPlugins.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ClangPlugins.rst?rev=361335=361334=361335=diff
==
--- cfe/trunk/docs/ClangPlugins.rst (original)
+++ cfe/trunk/docs/ClangPlugins.rst Tue May 21 16:51:38 2019
@@ -55,7 +55,7 @@ registering it using ``PragmaHandlerRegi
   class ExamplePragmaHandler : public PragmaHandler {
   public:
 ExamplePragmaHandler() : PragmaHandler("example_pragma") { }
-void HandlePragma(Preprocessor , PragmaIntroducerKind Introducer,
+void HandlePragma(Preprocessor , PragmaIntroducer Introducer,
   Token ) {
   // Handle the pragma
 }

Modified: cfe/trunk/examples/AnnotateFunctions/AnnotateFunctions.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/AnnotateFunctions/AnnotateFunctions.cpp?rev=361335=361334=361335=diff
==
--- cfe/trunk/examples/AnnotateFunctions/AnnotateFunctions.cpp (original)
+++ cfe/trunk/examples/AnnotateFunctions/AnnotateFunctions.cpp Tue May 21 
16:51:38 2019
@@ -58,7 +58,7 @@ class PragmaAnnotateHandler : public Pra
 public:
   PragmaAnnotateHandler() : PragmaHandler("enable_annotate") { }
 
-  void HandlePragma(Preprocessor , PragmaIntroducerKind Introducer,
+  void HandlePragma(Preprocessor , PragmaIntroducer Introducer,
 Token ) override {
 
 Token Tok;

Modified: cfe/trunk/include/clang/Lex/Pragma.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Pragma.h?rev=361335=361334=361335=diff
==
--- cfe/trunk/include/clang/Lex/Pragma.h (original)
+++ cfe/trunk/include/clang/Lex/Pragma.h Tue May 21 16:51:38 2019
@@ -14,6 +14,7 @@
 #define LLVM_CLANG_LEX_PRAGMA_H
 
 #include "clang/Basic/LLVM.h"
+#include "clang/Basic/SourceLocation.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include 
@@ -46,6 +47,12 @@ class Token;
 PIK___pragma
   };
 
+  /// Describes how and where the pragma was introduced.
+  struct PragmaIntroducer {
+PragmaIntroducerKind Kind;
+SourceLocation Loc;
+  };
+
 /// PragmaHandler - Instances of this interface defined to handle the various
 /// pragmas that the language front-end uses.  Each handler optionally has a
 /// name (e.g. "pack") and the HandlePragma method is invoked when a pragma 
with
@@ -64,7 +71,7 @@ public:
   virtual ~PragmaHandler();
 
   StringRef getName() const { return Name; }
-  virtual void HandlePragma(Preprocessor , PragmaIntroducerKind Introducer,
+  virtual void HandlePragma(Preprocessor , PragmaIntroducer Introducer,
 Token ) = 0;
 
   /// getIfNamespace - If this is a namespace, return it.  This is equivalent 
to
@@ -78,7 +85,7 @@ class EmptyPragmaHandler : public Pragma
 public:
   explicit EmptyPragmaHandler(StringRef Name = StringRef());
 
-  void HandlePragma(Preprocessor , PragmaIntroducerKind Introducer,
+  void HandlePragma(Preprocessor , PragmaIntroducer Introducer,
 Token ) override;
 };
 
@@ -111,7 +118,7 @@ public:
 
   bool IsEmpty() const { return Handlers.empty(); }
 
-  void HandlePragma(Preprocessor , PragmaIntroducerKind Introducer,
+  void HandlePragma(Preprocessor , PragmaIntroducer Introducer,
 Token ) override;
 
   PragmaNamespace *getIfNamespace() override { return this; }

Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: 

r361334 - Fix target property to make BUILD_SHARED_LIBS work

2019-05-21 Thread Chris Bieneman via cfe-commits
Author: cbieneman
Date: Tue May 21 16:50:15 2019
New Revision: 361334

URL: http://llvm.org/viewvc/llvm-project?rev=361334=rev
Log:
Fix target property to make BUILD_SHARED_LIBS work

Public and Private link libraries get merged in the LINK_LIBRARIES property 
instead of being kept separate.

With any luck this will get `BUILD_SHARED_LIBS` working again on Linux.

Modified:
cfe/trunk/tools/clang-shlib/CMakeLists.txt

Modified: cfe/trunk/tools/clang-shlib/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-shlib/CMakeLists.txt?rev=361334=361333=361334=diff
==
--- cfe/trunk/tools/clang-shlib/CMakeLists.txt (original)
+++ cfe/trunk/tools/clang-shlib/CMakeLists.txt Tue May 21 16:50:15 2019
@@ -8,7 +8,7 @@ get_property(clang_libs GLOBAL PROPERTY
 foreach (lib ${clang_libs})
   list(APPEND _OBJECTS $)
   list(APPEND _DEPS $)
-  list(APPEND _DEPS $)
+  list(APPEND _DEPS $)
 endforeach ()
 
 add_clang_library(clang_shared


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


[PATCH] D62116: [Sema] raise nullptr check to cover additional uses

2019-05-21 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments.



Comment at: clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:557-558
+dyn_cast_or_null(ND->getDeclContext());
+CXXThisScopeRAII ThisScope(*this, ThisContext, Qualifiers(),
+   ND->isCXXInstanceMember());
+  }

rsmith wrote:
> The purpose of creating this is to change the type of `this` in the scope of 
> the instantiation below, so this change is incorrect. The right fix would be 
> to change the initializer of `ThisContext` to handle `ND` being null. (I 
> suspect that actually can't happen at the moment because we happen to only 
> attach late-parsed attributes to `NamedDecl`s, but I don't think there's any 
> fundamental reason why that should be the case so it makes some sense to 
> retain the check here.)
> The purpose of creating this is to change the type of this in the scope of 
> the instantiation below, so this change is incorrect. 

In this case I agree.  The `}` added on L559 should be extended to L564.

> so it makes some sense to retain the check here

I assume PVS studio is complaining about dereferencing ND on L556, then doing 
what looks like a `nullptr` check on L558 (reminiscent of 
`-fno-delete-null-pointer-checks`).  I assume `dyn_cast` on L554 can fail at 
runtime and return `nullptr`?  Should that happen, how should we proceed?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62116



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


[PATCH] D62225: [clang][NewPM] Fixing -O0 tests that are broken under new PM

2019-05-21 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision.
leonardchan added reviewers: chandlerc, echristo, phosek, serge-sans-paille.
leonardchan added a project: clang.
Herald added subscribers: kristof.beyls, javed.absar.

This is a patch that should go on top of D58375 
 which addresses/fixes tests that fail under 
new PM with -O0.

This is still ongoing and will ask for reviews once all of them are fixed. 
These are currently the latest ones I have updated so far.

Current reasons for fixes:

- Some aarch64 tests specified attribute numbers explicitly where as new pm 
uses the same attributes but different numbers.
- `CodeGen/aarch64-neon-perm.c` failed because new PM would insert lifetime 
start/end intrinsics even under -O0.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D62225

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  clang/test/CodeGen/aarch64-neon-across.c
  clang/test/CodeGen/aarch64-neon-fcvt-intrinsics.c
  clang/test/CodeGen/aarch64-neon-fma.c
  clang/test/CodeGen/aarch64-neon-perm.c

Index: clang/test/CodeGen/aarch64-neon-perm.c
===
--- clang/test/CodeGen/aarch64-neon-perm.c
+++ clang/test/CodeGen/aarch64-neon-perm.c
@@ -1,5 +1,3 @@
-// UNSUPPORTED: experimental-new-pass-manager
-
 // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
 // RUN: -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
 
Index: clang/test/CodeGen/aarch64-neon-fma.c
===
--- clang/test/CodeGen/aarch64-neon-fma.c
+++ clang/test/CodeGen/aarch64-neon-fma.c
@@ -1,5 +1,3 @@
-// UNSUPPORTED: experimental-new-pass-manager
-
 // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon -S -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
 
 // Test new aarch64 intrinsics and types
@@ -226,7 +224,7 @@
 // CHECK:   [[SUB_I:%.*]] = fsub <2 x double> , %b
 // CHECK:   [[VECINIT_I:%.*]] = insertelement <2 x double> undef, double %c, i32 0
 // CHECK:   [[VECINIT1_I:%.*]] = insertelement <2 x double> [[VECINIT_I]], double %c, i32 1
-// CHECK:   [[TMP6:%.*]] = call <2 x double> @llvm.fma.v2f64(<2 x double> [[SUB_I]], <2 x double> [[VECINIT1_I]], <2 x double> %a) #3
+// CHECK:   [[TMP6:%.*]] = call <2 x double> @llvm.fma.v2f64(<2 x double> [[SUB_I]], <2 x double> [[VECINIT1_I]], <2 x double> %a) [[NOUNWIND_ATTR:#[0-9]+]]
 // CHECK:   ret <2 x double> [[TMP6]]
 float64x2_t test_vfmsq_n_f64(float64x2_t a, float64x2_t b, float64_t c) {
   return vfmsq_n_f64(a, b, c);
@@ -234,3 +232,4 @@
 
 // CHECK: attributes #0 ={{.*}}"min-legal-vector-width"="64"
 // CHECK: attributes #1 ={{.*}}"min-legal-vector-width"="128"
+// CHECK: attributes [[NOUNWIND_ATTR]] = { nounwind }
Index: clang/test/CodeGen/aarch64-neon-fcvt-intrinsics.c
===
--- clang/test/CodeGen/aarch64-neon-fcvt-intrinsics.c
+++ clang/test/CodeGen/aarch64-neon-fcvt-intrinsics.c
@@ -1,5 +1,3 @@
-// UNSUPPORTED: experimental-new-pass-manager
-
 // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
 // RUN:  -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
 
@@ -8,119 +6,119 @@
 #include 
 
 // CHECK-LABEL: define float @test_vcvtxd_f32_f64(double %a) #0 {
-// CHECK:   [[VCVTXD_F32_F64_I:%.*]] = call float @llvm.aarch64.sisd.fcvtxn(double %a) #2
+// CHECK:   [[VCVTXD_F32_F64_I:%.*]] = call float @llvm.aarch64.sisd.fcvtxn(double %a) [[NOUNWIND_ATTR:#[0-9]+]]
 // CHECK:   ret float [[VCVTXD_F32_F64_I]]
 float32_t test_vcvtxd_f32_f64(float64_t a) {
   return (float32_t)vcvtxd_f32_f64(a);
 }
 
 // CHECK-LABEL: define i32 @test_vcvtas_s32_f32(float %a) #0 {
-// CHECK:   [[VCVTAS_S32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtas.i32.f32(float %a) #2
+// CHECK:   [[VCVTAS_S32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtas.i32.f32(float %a) [[NOUNWIND_ATTR]]
 // CHECK:   ret i32 [[VCVTAS_S32_F32_I]]
 int32_t test_vcvtas_s32_f32(float32_t a) {
   return (int32_t)vcvtas_s32_f32(a);
 }
 
 // CHECK-LABEL: define i64 @test_test_vcvtad_s64_f64(double %a) #0 {
-// CHECK:   [[VCVTAD_S64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtas.i64.f64(double %a) #2
+// CHECK:   [[VCVTAD_S64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtas.i64.f64(double %a) [[NOUNWIND_ATTR]]
 // CHECK:   ret i64 [[VCVTAD_S64_F64_I]]
 int64_t test_test_vcvtad_s64_f64(float64_t a) {
   return (int64_t)vcvtad_s64_f64(a);
 }
 
 // CHECK-LABEL: define i32 @test_vcvtas_u32_f32(float %a) #0 {
-// CHECK:   [[VCVTAS_U32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtau.i32.f32(float %a) #2
+// CHECK:   [[VCVTAS_U32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtau.i32.f32(float %a) [[NOUNWIND_ATTR]]
 // CHECK:   ret i32 [[VCVTAS_U32_F32_I]]
 uint32_t test_vcvtas_u32_f32(float32_t a) {
   return (uint32_t)vcvtas_u32_f32(a);
 }
 
 // CHECK-LABEL: define i64 @test_vcvtad_u64_f64(double %a) #0 {
-// CHECK:   

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-21 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment.

In D61909#1510975 , @E5ten wrote:

> @beanz But if libclang_shared is intended to be a shippable binary and 
> BUILD_SHARED_LIBS is only intended to be an option used in developer builds, 
> and libclang_shared while not causing conflicts (thanks for the info on how 
> that works by the way) would be redundant in a local developer build one 
> would see BUILD_SHARED_LIBS enabled in wouldn't it? And also to me it doesn't 
> really make sense to enable the intended shippable binary in a build that is 
> specifically enabling a developer option, and so is obviously not intended 
> for shipment (I get that in the arch case it is intended for shipment but 
> that case is them using an option they shouldn't not the option being one 
> that should be used when the built products are intended for redistribution).


Best way to make sure a shippable binary builds and works is for developers to 
be building it. In general we should avoid developers doing things that aren't 
representative of what we expect to be in the hands of users. 
`BUILD_SHARED_LIBS` is an unusual exception to this that I wish would go away. 
The reason we keep it around is because of how significant of a workflow 
improvement it provides.


Repository:
  rC Clang

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

https://reviews.llvm.org/D61909



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


r361328 - Refactor: split Uninitialized state on APValue into an "Absent" state

2019-05-21 Thread Richard Smith via cfe-commits
Author: rsmith
Date: Tue May 21 16:15:18 2019
New Revision: 361328

URL: http://llvm.org/viewvc/llvm-project?rev=361328=rev
Log:
Refactor: split Uninitialized state on APValue into an "Absent" state
representing no such object, and an "Indeterminate" state representing
an uninitialized object. The latter is not yet used, but soon will be.

Modified:
cfe/trunk/include/clang/AST/APValue.h
cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td
cfe/trunk/lib/AST/APValue.cpp
cfe/trunk/lib/AST/Decl.cpp
cfe/trunk/lib/AST/ExprConstant.cpp
cfe/trunk/lib/CodeGen/CGExprConstant.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/lib/Sema/SemaTemplate.cpp

Modified: cfe/trunk/include/clang/AST/APValue.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/APValue.h?rev=361328=361327=361328=diff
==
--- cfe/trunk/include/clang/AST/APValue.h (original)
+++ cfe/trunk/include/clang/AST/APValue.h Tue May 21 16:15:18 2019
@@ -78,7 +78,10 @@ class APValue {
   typedef llvm::APFloat APFloat;
 public:
   enum ValueKind {
-Uninitialized,
+/// There is no such object (it's outside its lifetime).
+None,
+/// This object has an indeterminate value (C++ [basic.indet]).
+Indeterminate,
 Int,
 Float,
 FixedPoint,
@@ -231,58 +234,59 @@ private:
   DataType Data;
 
 public:
-  APValue() : Kind(Uninitialized) {}
-  explicit APValue(APSInt I) : Kind(Uninitialized) {
+  APValue() : Kind(None) {}
+  explicit APValue(APSInt I) : Kind(None) {
 MakeInt(); setInt(std::move(I));
   }
-  explicit APValue(APFloat F) : Kind(Uninitialized) {
+  explicit APValue(APFloat F) : Kind(None) {
 MakeFloat(); setFloat(std::move(F));
   }
-  explicit APValue(APFixedPoint FX) : Kind(Uninitialized) {
+  explicit APValue(APFixedPoint FX) : Kind(None) {
 MakeFixedPoint(std::move(FX));
   }
-  explicit APValue(const APValue *E, unsigned N) : Kind(Uninitialized) {
+  explicit APValue(const APValue *E, unsigned N) : Kind(None) {
 MakeVector(); setVector(E, N);
   }
-  APValue(APSInt R, APSInt I) : Kind(Uninitialized) {
+  APValue(APSInt R, APSInt I) : Kind(None) {
 MakeComplexInt(); setComplexInt(std::move(R), std::move(I));
   }
-  APValue(APFloat R, APFloat I) : Kind(Uninitialized) {
+  APValue(APFloat R, APFloat I) : Kind(None) {
 MakeComplexFloat(); setComplexFloat(std::move(R), std::move(I));
   }
   APValue(const APValue );
-  APValue(APValue &) : Kind(Uninitialized) { swap(RHS); }
+  APValue(APValue &) : Kind(None) { swap(RHS); }
   APValue(LValueBase B, const CharUnits , NoLValuePath N,
   bool IsNullPtr = false)
-  : Kind(Uninitialized) {
+  : Kind(None) {
 MakeLValue(); setLValue(B, O, N, IsNullPtr);
   }
   APValue(LValueBase B, const CharUnits , ArrayRef Path,
   bool OnePastTheEnd, bool IsNullPtr = false)
-  : Kind(Uninitialized) {
+  : Kind(None) {
 MakeLValue(); setLValue(B, O, Path, OnePastTheEnd, IsNullPtr);
   }
-  APValue(UninitArray, unsigned InitElts, unsigned Size) : Kind(Uninitialized) 
{
+  APValue(UninitArray, unsigned InitElts, unsigned Size) : Kind(None) {
 MakeArray(InitElts, Size);
   }
-  APValue(UninitStruct, unsigned B, unsigned M) : Kind(Uninitialized) {
+  APValue(UninitStruct, unsigned B, unsigned M) : Kind(None) {
 MakeStruct(B, M);
   }
   explicit APValue(const FieldDecl *D, const APValue  = APValue())
-  : Kind(Uninitialized) {
+  : Kind(None) {
 MakeUnion(); setUnion(D, V);
   }
   APValue(const ValueDecl *Member, bool IsDerivedMember,
-  ArrayRef Path) : Kind(Uninitialized) {
+  ArrayRef Path) : Kind(None) {
 MakeMemberPointer(Member, IsDerivedMember, Path);
   }
   APValue(const AddrLabelExpr* LHSExpr, const AddrLabelExpr* RHSExpr)
-  : Kind(Uninitialized) {
+  : Kind(None) {
 MakeAddrLabelDiff(); setAddrLabelDiff(LHSExpr, RHSExpr);
   }
 
   ~APValue() {
-MakeUninit();
+if (Kind != None && Kind != Indeterminate)
+  DestroyDataAndMakeUninit();
   }
 
   /// Returns whether the object performed allocations.
@@ -296,7 +300,11 @@ public:
   void swap(APValue );
 
   ValueKind getKind() const { return Kind; }
-  bool isUninit() const { return Kind == Uninitialized; }
+
+  bool isAbsent() const { return Kind == None; }
+  bool isIndeterminate() const { return Kind == Indeterminate; }
+  bool hasValue() const { return Kind != None && Kind != Indeterminate; }
+
   bool isInt() const { return Kind == Int; }
   bool isFloat() const { return Kind == Float; }
   bool isFixedPoint() const { return Kind == FixedPoint; }
@@ -536,56 +544,52 @@ public:
 
 private:
   void DestroyDataAndMakeUninit();
-  void MakeUninit() {
-if (Kind != Uninitialized)
-  DestroyDataAndMakeUninit();
-  }
   void MakeInt() {
-assert(isUninit() && "Bad state change");
+assert(isAbsent() && "Bad state change");
 new 

r361329 - [c++20] P1330R0: permit simple-assignments that change the active member

2019-05-21 Thread Richard Smith via cfe-commits
Author: rsmith
Date: Tue May 21 16:15:20 2019
New Revision: 361329

URL: http://llvm.org/viewvc/llvm-project?rev=361329=rev
Log:
[c++20] P1330R0: permit simple-assignments that change the active member
of a union within constant expression evaluation.

Modified:
cfe/trunk/include/clang/AST/APValue.h
cfe/trunk/include/clang/AST/Expr.h
cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td
cfe/trunk/include/clang/Basic/DiagnosticIDs.h
cfe/trunk/lib/AST/ExprConstant.cpp
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp
cfe/trunk/test/SemaCXX/constant-expression-cxx2a.cpp
cfe/trunk/www/cxx_status.html

Modified: cfe/trunk/include/clang/AST/APValue.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/APValue.h?rev=361329=361328=361329=diff
==
--- cfe/trunk/include/clang/AST/APValue.h (original)
+++ cfe/trunk/include/clang/AST/APValue.h Tue May 21 16:15:20 2019
@@ -283,6 +283,11 @@ public:
   : Kind(None) {
 MakeAddrLabelDiff(); setAddrLabelDiff(LHSExpr, RHSExpr);
   }
+  static APValue IndeterminateValue() {
+APValue Result;
+Result.Kind = Indeterminate;
+return Result;
+  }
 
   ~APValue() {
 if (Kind != None && Kind != Indeterminate)

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=361329=361328=361329=diff
==
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Tue May 21 16:15:20 2019
@@ -3115,6 +3115,13 @@ public:
   path_const_iterator path_begin() const { return path_buffer(); }
   path_const_iterator path_end() const { return path_buffer() + path_size(); }
 
+  llvm::iterator_range path() {
+return llvm::make_range(path_begin(), path_end());
+  }
+  llvm::iterator_range path() const {
+return llvm::make_range(path_begin(), path_end());
+  }
+
   const FieldDecl *getTargetUnionField() const {
 assert(getCastKind() == CK_ToUnion);
 return getTargetFieldForToUnionCast(getType(), getSubExpr()->getType());

Modified: cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td?rev=361329=361328=361329=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td Tue May 21 16:15:20 2019
@@ -55,6 +55,8 @@ def note_constexpr_non_global : Note<
   "%select{temporary|%3}2 is not a constant expression">;
 def note_constexpr_uninitialized : Note<
   "%select{|sub}0object of type %1 is not initialized">;
+def note_constexpr_subobject_declared_here : Note<
+  "subobject declared here">;
 def note_constexpr_array_index : Note<"cannot refer to element %0 of "
   "%select{array of %2 element%plural{1:|:s}2|non-array object}1 "
   "in a constant expression">;

Modified: cfe/trunk/include/clang/Basic/DiagnosticIDs.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticIDs.h?rev=361329=361328=361329=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticIDs.h (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticIDs.h Tue May 21 16:15:20 2019
@@ -33,7 +33,7 @@ namespace clang {
   DIAG_SIZE_SERIALIZATION =  120,
   DIAG_SIZE_LEX   =  400,
   DIAG_SIZE_PARSE =  500,
-  DIAG_SIZE_AST   =  150,
+  DIAG_SIZE_AST   =  200,
   DIAG_SIZE_COMMENT   =  100,
   DIAG_SIZE_CROSSTU   =  100,
   DIAG_SIZE_SEMA  = 4000,

Modified: cfe/trunk/lib/AST/ExprConstant.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=361329=361328=361329=diff
==
--- cfe/trunk/lib/AST/ExprConstant.cpp (original)
+++ cfe/trunk/lib/AST/ExprConstant.cpp Tue May 21 16:15:20 2019
@@ -290,6 +290,27 @@ namespace {
   }
 }
 
+void truncate(ASTContext , APValue::LValueBase Base,
+  unsigned NewLength) {
+  if (Invalid)
+return;
+
+  assert(Base && "cannot truncate path for null pointer");
+  assert(NewLength <= Entries.size() && "not a truncation");
+
+  if (NewLength == Entries.size())
+return;
+  Entries.resize(NewLength);
+
+  bool IsArray = false;
+  bool FirstIsUnsizedArray = false;
+  MostDerivedPathLength = findMostDerivedSubobject(
+  Ctx, Base, Entries, MostDerivedArraySize, MostDerivedType, IsArray,
+  FirstIsUnsizedArray);
+  MostDerivedIsArrayElement = IsArray;
+  FirstEntryIsAnUnsizedArray = FirstIsUnsizedArray;
+}
+
 void setInvalid() {
   Invalid = true;
   

[PATCH] D61923: [GWP-ASan] Mutex implementation [2].

2019-05-21 Thread Mitch Phillips via Phabricator via cfe-commits
hctim updated this revision to Diff 200604.
hctim marked an inline comment as done.
hctim added a comment.

- Updated to use pointer-to-impl to abstract implementation behaviour away from 
header files.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61923

Files:
  clang/runtime/CMakeLists.txt
  compiler-rt/lib/gwp_asan/CMakeLists.txt
  compiler-rt/lib/gwp_asan/mutex.h
  compiler-rt/lib/gwp_asan/platform_specific/mutex_posix.cpp
  compiler-rt/lib/gwp_asan/tests/CMakeLists.txt
  compiler-rt/lib/gwp_asan/tests/driver.cpp
  compiler-rt/lib/gwp_asan/tests/mutex_test.cpp
  compiler-rt/test/gwp_asan/CMakeLists.txt
  compiler-rt/test/gwp_asan/dummy_test.cc
  compiler-rt/test/gwp_asan/lit.cfg
  compiler-rt/test/gwp_asan/lit.site.cfg.in
  compiler-rt/test/gwp_asan/unit/lit.site.cfg.in

Index: compiler-rt/test/gwp_asan/unit/lit.site.cfg.in
===
--- /dev/null
+++ compiler-rt/test/gwp_asan/unit/lit.site.cfg.in
@@ -0,0 +1,9 @@
+@LIT_SITE_CFG_IN_HEADER@
+
+config.name = "GwpAsan-Unittest"
+# Load common config for all compiler-rt unit tests.
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured")
+
+config.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@",
+ "lib", "gwp_asan", "tests")
+config.test_source_root = config.test_exec_root
Index: compiler-rt/test/gwp_asan/lit.site.cfg.in
===
--- /dev/null
+++ compiler-rt/test/gwp_asan/lit.site.cfg.in
@@ -0,0 +1,11 @@
+@LIT_SITE_CFG_IN_HEADER@
+
+config.name_suffix = "@GWP_ASAN_TEST_CONFIG_SUFFIX@"
+config.target_arch = "@GWP_ASAN_TEST_TARGET_ARCH@"
+config.target_cflags = "@GWP_ASAN_TEST_TARGET_CFLAGS@"
+
+# Load common config for all compiler-rt lit tests.
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
+
+# Load tool-specific config that would do the real work.
+lit_config.load_config(config, "@GWP_ASAN_LIT_SOURCE_DIR@/lit.cfg")
Index: compiler-rt/test/gwp_asan/lit.cfg
===
--- /dev/null
+++ compiler-rt/test/gwp_asan/lit.cfg
@@ -0,0 +1,31 @@
+# -*- Python -*-
+
+import os
+
+# Setup config name.
+config.name = 'GWP-ASan' + config.name_suffix
+
+# Setup source root.
+config.test_source_root = os.path.dirname(__file__)
+
+# Test suffixes.
+config.suffixes = ['.c', '.cc', '.cpp', '.test']
+
+# C & CXX flags.
+c_flags = ([config.target_cflags])
+
+# Android doesn't want -lrt.
+if not config.android:
+  c_flags += ["-lrt"]
+
+cxx_flags = (c_flags + config.cxx_mode_flags + ["-std=c++11"])
+
+def build_invocation(compile_flags):
+  return " " + " ".join([config.clang] + compile_flags) + " "
+
+# Add substitutions.
+config.substitutions.append(("%clang ", build_invocation(c_flags)))
+
+# GWP-ASan tests are currently supported on Linux only.
+if config.host_os not in ['Linux']:
+   config.unsupported = True
Index: compiler-rt/test/gwp_asan/dummy_test.cc
===
--- /dev/null
+++ compiler-rt/test/gwp_asan/dummy_test.cc
@@ -0,0 +1,4 @@
+// Exists to simply stop warnings about lit not discovering any tests here.
+// RUN: %clang %s
+
+int main() { return 0; }
Index: compiler-rt/test/gwp_asan/CMakeLists.txt
===
--- compiler-rt/test/gwp_asan/CMakeLists.txt
+++ compiler-rt/test/gwp_asan/CMakeLists.txt
@@ -0,0 +1,45 @@
+set(GWP_ASAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(GWP_ASAN_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+
+set(GWP_ASAN_TESTSUITES)
+
+set(GWP_ASAN_UNITTEST_DEPS)
+set(GWP_ASAN_TEST_DEPS
+  ${SANITIZER_COMMON_LIT_TEST_DEPS}
+  gwp_asan)
+
+if (COMPILER_RT_INCLUDE_TESTS)
+  list(APPEND GWP_ASAN_TEST_DEPS GwpAsanUnitTests)
+  configure_lit_site_cfg(
+${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.in
+${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg)
+  add_lit_testsuite(check-gwp_asan-unit "Running GWP-ASan unit tests"
+${CMAKE_CURRENT_BINARY_DIR}/unit
+DEPENDS ${GWP_ASAN_TEST_DEPS})
+  set_target_properties(check-gwp_asan-unit PROPERTIES FOLDER
+"Compiler-RT Tests")
+list(APPEND GWP_ASAN_TEST_DEPS check-gwp_asan-unit)
+endif()
+
+configure_lit_site_cfg(
+  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+  )
+
+foreach(arch ${GWP_ASAN_SUPPORTED_ARCH})
+  set(GWP_ASAN_TEST_TARGET_ARCH ${arch})
+  string(TOLOWER "-${arch}" GWP_ASAN_TEST_CONFIG_SUFFIX)
+  get_test_cc_for_arch(${arch} GWP_ASAN_TEST_TARGET_CC GWP_ASAN_TEST_TARGET_CFLAGS)
+  string(TOUPPER ${arch} ARCH_UPPER_CASE)
+  set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config)
+
+  configure_lit_site_cfg(
+${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg)
+  list(APPEND 

[PATCH] D60974: Clang IFSO driver action.

2019-05-21 Thread Puyan Lotfi via Phabricator via cfe-commits
plotfi updated this revision to Diff 200602.
plotfi added a comment.

fixing support for static functions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60974

Files:
  clang/include/clang/Driver/Options.td
  clang/include/clang/Driver/Types.def
  clang/include/clang/Frontend/FrontendActions.h
  clang/include/clang/Frontend/FrontendOptions.h
  clang/lib/Driver/Driver.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Frontend/CMakeLists.txt
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp
  clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
  clang/test/InterfaceStubs/bad-format.cpp
  clang/test/InterfaceStubs/class-template-specialization.cpp
  clang/test/InterfaceStubs/function-template-specialization.cpp
  clang/test/InterfaceStubs/inline.c
  clang/test/InterfaceStubs/inline.cpp
  clang/test/InterfaceStubs/inline.h
  clang/test/InterfaceStubs/object.cpp
  clang/test/InterfaceStubs/template-namespace-function.cpp
  clang/test/InterfaceStubs/visibility.cpp
  clang/test/InterfaceStubs/weak.cpp

Index: clang/test/InterfaceStubs/weak.cpp
===
--- /dev/null
+++ clang/test/InterfaceStubs/weak.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang -target x86_64-linux-gnu -o - -emit-interface-stubs \
+// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \
+// RUN: FileCheck %s
+
+// RUN: %clang -target x86_64-linux-gnu -o - -emit-interface-stubs \
+// RUN: -interface-stub-version=experimental-yaml-elf-v1 %s | \
+// RUN: FileCheck --check-prefix=CHECK-YAML %s
+
+// CHECK: Symbols:
+// CHECK-NEXT:  _Z8weakFuncv: { Type: Func, Weak: true }
+// CHECK-NEXT:  _Z10strongFuncv: { Type: Func }
+
+// CHECK-YAML: Symbols:
+// CHECK-YAML-NEXT:   - Name:_Z8weakFuncv
+// CHECK-YAML-NEXT: Type:STT_FUNC
+// CHECK-YAML-NEXT: Binding: STB_WEAK
+// CHECK-YAML-NEXT:   - Name:_Z10strongFuncv
+// CHECK-YAML-NEXT: Type:STT_FUNC
+// CHECK-YAML-NEXT: Binding: STB_GLOBAL
+
+__attribute__((weak)) void weakFunc() {}
+int strongFunc() {}
+
Index: clang/test/InterfaceStubs/visibility.cpp
===
--- /dev/null
+++ clang/test/InterfaceStubs/visibility.cpp
@@ -0,0 +1,29 @@
+// RUN: %clang -target x86_64-linux-gnu -o - -emit-interface-stubs \
+// RUN: -interface-stub-version=experimental-tapi-elf-v1 -fvisibility=hidden \
+// RUN: %s | FileCheck --check-prefix=CHECK-CMD-HIDDEN %s
+
+// RUN: %clang -target x86_64-linux-gnu -o - -emit-interface-stubs \
+// RUN: -interface-stub-version=experimental-yaml-elf-v1 -fvisibility=hidden \
+// RUN: %s | FileCheck --check-prefix=CHECK-CMD-HIDDEN %s
+
+// RUN: %clang -target x86_64-linux-gnu -o - -emit-interface-stubs \
+// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | FileCheck %s
+
+// RUN: %clang -target x86_64-linux-gnu -o - -emit-interface-stubs \
+// RUN: -interface-stub-version=experimental-yaml-elf-v1 %s | FileCheck %s
+
+// Always Be Hidden:
+// CHECK-CMD-HIDDEN-NOT: _Z6hiddenv
+// CHECK-NOT: _Z6hiddenv
+__attribute__((visibility("hidden"))) void hidden() {}
+
+// Always Be Visible:
+// CHECK-CMD-HIDDEN: _Z9nothiddenv
+// CHECK: _Z9nothiddenv
+__attribute__((visibility("default"))) void nothidden() {}
+
+// Do Whatever -fvisibility says:
+// CHECK-CMD-HIDDEN-NOT: _Z10cmdVisiblev
+// CHECK: _Z10cmdVisiblev
+void cmdVisible() {}
+
Index: clang/test/InterfaceStubs/template-namespace-function.cpp
===
--- /dev/null
+++ clang/test/InterfaceStubs/template-namespace-function.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang -target x86_64-linux-gnu -o - -emit-interface-stubs \
+// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \
+// RUN: FileCheck %s
+
+// CHECK: Symbols:
+// CHECK-NEXT:  _ZN3qux3barEii: { Type: Func }
+// CHECK-NEXT:  _ZN3baz3addIiEET_S1_S1_: { Type: Func }
+// CHECK-NEXT:  _Z4fbarff: { Type: Func }
+// CHECK-NEXT:  _ZN3baz3addIfEET_S1_S1_: { Type: Func }
+
+namespace baz {
+template 
+T add(T a, T b) {
+  return a + b;
+}
+} // namespace baz
+
+namespace qux {
+int bar(int a, int b) { return baz::add(a, b); }
+} // namespace qux
+
+float fbar(float a, float b) { return baz::add(a, b); }
+
Index: clang/test/InterfaceStubs/object.cpp
===
--- /dev/null
+++ clang/test/InterfaceStubs/object.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang -target x86_64-linux-gnu -o - -emit-interface-stubs \
+// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \
+// RUN: FileCheck %s
+
+// CHECK: data: { Type: Object, Size: 4 }
+int data = 1844;
+
Index: clang/test/InterfaceStubs/inline.h
===
--- /dev/null
+++ clang/test/InterfaceStubs/inline.h
@@ -0,0 +1,6 @@
+
+inline int 

[PATCH] D62167: CodeView - add static data members to global variable debug info.

2019-05-21 Thread Amy Huang via Phabricator via cfe-commits
akhuang marked an inline comment as done.
akhuang added a subscriber: dblaikie.
akhuang added inline comments.



Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:4385
+// Use the global scope for static members.
+DContext = getContextDescriptor(
+   cast(CGM.getContext().getTranslationUnitDecl()), TheCU);

@dblaikie I'm using the global scope here because if the class type is used as 
the scope it runs into the [[ 
https://github.com/llvm/llvm-project/blob/a2ee80b084e5c0b20364ed4379384706f5e059b1/llvm/lib/IR/DIBuilder.cpp#L630
 | assert message ]] `Context of a global variable should not be a type with 
identifier`. Is there a reason for the assert? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62167



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


[PATCH] D61923: [GWP-ASan] Mutex implementation [2].

2019-05-21 Thread Evgenii Stepanov via Phabricator via cfe-commits
eugenis added inline comments.



Comment at: compiler-rt/lib/gwp_asan/mutex.h:27
+private:
+#include "gwp_asan/platform_specific/mutex_members.inc"
+};

What's the point of this include? You are leaking platform details into this 
common header anyway.

We can make the interface C-only; or use pImpl to hide the implementation; or 
just move the entire declaration of Mutex to the platform header.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61923



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


r361325 - Rename identifiers to spell out analyze; NFC.

2019-05-21 Thread Aaron Ballman via cfe-commits
Author: aaronballman
Date: Tue May 21 15:43:48 2019
New Revision: 361325

URL: http://llvm.org/viewvc/llvm-project?rev=361325=rev
Log:
Rename identifiers to spell out analyze; NFC.

Modified:
cfe/trunk/test/SemaCXX/attr-no-sanitize-address.cpp
cfe/trunk/test/SemaCXX/attr-no-sanitize-memory.cpp
cfe/trunk/test/SemaCXX/attr-no-sanitize-thread.cpp

Modified: cfe/trunk/test/SemaCXX/attr-no-sanitize-address.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-no-sanitize-address.cpp?rev=361325=361324=361325=diff
==
--- cfe/trunk/test/SemaCXX/attr-no-sanitize-address.cpp (original)
+++ cfe/trunk/test/SemaCXX/attr-no-sanitize-address.cpp Tue May 21 15:43:48 2019
@@ -6,31 +6,31 @@
 #error "Should support no_sanitize_address"
 #endif
 
-void noanal_fun() NO_SANITIZE_ADDRESS;
+void no_analyze() NO_SANITIZE_ADDRESS;
 
-void noanal_fun_alt() __attribute__((__no_sanitize_address__));
+void no_analyze_alt() __attribute__((__no_sanitize_address__));
 
-void noanal_fun_args() __attribute__((no_sanitize_address(1))); // \
+void no_analyze_args() __attribute__((no_sanitize_address(1))); // \
   // expected-error {{'no_sanitize_address' attribute takes no arguments}}
 
-int noanal_testfn(int y) NO_SANITIZE_ADDRESS;
+int no_analyze_testfn(int y) NO_SANITIZE_ADDRESS;
 
-int noanal_testfn(int y) {
+int no_analyze_testfn(int y) {
   int x NO_SANITIZE_ADDRESS = y; // \
 // expected-error {{'no_sanitize_address' attribute only applies to 
functions}}
   return x;
 }
 
-class NoanalFoo {
+class NoAnalyzeFoo {
  private:
   int test_field NO_SANITIZE_ADDRESS; // \
 // expected-error {{'no_sanitize_address' attribute only applies to 
functions}}
   void test_method() NO_SANITIZE_ADDRESS;
 };
 
-class NO_SANITIZE_ADDRESS NoanalTestClass { // \
+class NO_SANITIZE_ADDRESS NoAnalyzeTestClass { // \
   // expected-error {{'no_sanitize_address' attribute only applies to 
functions}}
 };
 
-void noanal_fun_params(int lvar NO_SANITIZE_ADDRESS); // \
+void no_analyze_params(int lvar NO_SANITIZE_ADDRESS); // \
   // expected-error {{'no_sanitize_address' attribute only applies to 
functions}}

Modified: cfe/trunk/test/SemaCXX/attr-no-sanitize-memory.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-no-sanitize-memory.cpp?rev=361325=361324=361325=diff
==
--- cfe/trunk/test/SemaCXX/attr-no-sanitize-memory.cpp (original)
+++ cfe/trunk/test/SemaCXX/attr-no-sanitize-memory.cpp Tue May 21 15:43:48 2019
@@ -6,34 +6,34 @@
 #error "Should support no_sanitize_memory"
 #endif
 
-void noanal_fun() NO_SANITIZE_MEMORY;
+void no_analyze() NO_SANITIZE_MEMORY;
 
-void noanal_fun_alt() __attribute__((__no_sanitize_memory__));
+void no_analyze_alt() __attribute__((__no_sanitize_memory__));
 
-void noanal_fun_args() __attribute__((no_sanitize_memory(1))); // \
+void no_analyze_args() __attribute__((no_sanitize_memory(1))); // \
   // expected-error {{'no_sanitize_memory' attribute takes no arguments}}
 
-int noanal_testfn(int y) NO_SANITIZE_MEMORY;
+int no_analyze_testfn(int y) NO_SANITIZE_MEMORY;
 
-int noanal_testfn(int y) {
+int no_analyze_testfn(int y) {
   int x NO_SANITIZE_MEMORY = y; // \
 // expected-error {{'no_sanitize_memory' attribute only applies to 
functions}}
   return x;
 }
 
-int noanal_test_var NO_SANITIZE_MEMORY; // \
+int no_analyze_test_var NO_SANITIZE_MEMORY; // \
   // expected-error {{'no_sanitize_memory' attribute only applies to 
functions}}
 
-class NoanalFoo {
+class NoAnalyzeFoo {
  private:
   int test_field NO_SANITIZE_MEMORY; // \
 // expected-error {{'no_sanitize_memory' attribute only applies to 
functions}}
   void test_method() NO_SANITIZE_MEMORY;
 };
 
-class NO_SANITIZE_MEMORY NoanalTestClass { // \
+class NO_SANITIZE_MEMORY NoAnalyzeTestClass { // \
   // expected-error {{'no_sanitize_memory' attribute only applies to 
functions}}
 };
 
-void noanal_fun_params(int lvar NO_SANITIZE_MEMORY); // \
+void no_analyze_params(int lvar NO_SANITIZE_MEMORY); // \
   // expected-error {{'no_sanitize_memory' attribute only applies to 
functions}}

Modified: cfe/trunk/test/SemaCXX/attr-no-sanitize-thread.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-no-sanitize-thread.cpp?rev=361325=361324=361325=diff
==
--- cfe/trunk/test/SemaCXX/attr-no-sanitize-thread.cpp (original)
+++ cfe/trunk/test/SemaCXX/attr-no-sanitize-thread.cpp Tue May 21 15:43:48 2019
@@ -6,34 +6,34 @@
 #error "Should support no_sanitize_thread"
 #endif
 
-void noanal_fun() NO_SANITIZE_THREAD;
+void no_analyze_fun() NO_SANITIZE_THREAD;
 
-void noanal_fun_alt() __attribute__((__no_sanitize_thread__));
+void no_analyze_alt() __attribute__((__no_sanitize_thread__));
 
-void noanal_fun_args() __attribute__((no_sanitize_thread(1))); // \
+void 

[PATCH] D61923: [GWP-ASan] Mutex implementation [2].

2019-05-21 Thread Mitch Phillips via Phabricator via cfe-commits
hctim updated this revision to Diff 200600.
hctim added a comment.

Changed GWP-ASan to use platform specific mutexes. For now, we only
target Android and Linux, and subsequently only need the pthread_mutex
variant for POSIX.

Kept around the mutex unittests as it's an easy assertion that the
abstraction over the platform specifics is implemented correctly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61923

Files:
  clang/runtime/CMakeLists.txt
  compiler-rt/lib/gwp_asan/CMakeLists.txt
  compiler-rt/lib/gwp_asan/mutex.h
  compiler-rt/lib/gwp_asan/platform_specific/mutex_include.h
  compiler-rt/lib/gwp_asan/platform_specific/mutex_members.inc
  compiler-rt/lib/gwp_asan/platform_specific/mutex_posix.cpp
  compiler-rt/lib/gwp_asan/tests/CMakeLists.txt
  compiler-rt/lib/gwp_asan/tests/driver.cpp
  compiler-rt/lib/gwp_asan/tests/mutex_test.cpp
  compiler-rt/test/gwp_asan/CMakeLists.txt
  compiler-rt/test/gwp_asan/dummy_test.cc
  compiler-rt/test/gwp_asan/lit.cfg
  compiler-rt/test/gwp_asan/lit.site.cfg.in
  compiler-rt/test/gwp_asan/unit/lit.site.cfg.in

Index: compiler-rt/test/gwp_asan/unit/lit.site.cfg.in
===
--- /dev/null
+++ compiler-rt/test/gwp_asan/unit/lit.site.cfg.in
@@ -0,0 +1,9 @@
+@LIT_SITE_CFG_IN_HEADER@
+
+config.name = "GwpAsan-Unittest"
+# Load common config for all compiler-rt unit tests.
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured")
+
+config.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@",
+ "lib", "gwp_asan", "tests")
+config.test_source_root = config.test_exec_root
Index: compiler-rt/test/gwp_asan/lit.site.cfg.in
===
--- /dev/null
+++ compiler-rt/test/gwp_asan/lit.site.cfg.in
@@ -0,0 +1,11 @@
+@LIT_SITE_CFG_IN_HEADER@
+
+config.name_suffix = "@GWP_ASAN_TEST_CONFIG_SUFFIX@"
+config.target_arch = "@GWP_ASAN_TEST_TARGET_ARCH@"
+config.target_cflags = "@GWP_ASAN_TEST_TARGET_CFLAGS@"
+
+# Load common config for all compiler-rt lit tests.
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
+
+# Load tool-specific config that would do the real work.
+lit_config.load_config(config, "@GWP_ASAN_LIT_SOURCE_DIR@/lit.cfg")
Index: compiler-rt/test/gwp_asan/lit.cfg
===
--- /dev/null
+++ compiler-rt/test/gwp_asan/lit.cfg
@@ -0,0 +1,31 @@
+# -*- Python -*-
+
+import os
+
+# Setup config name.
+config.name = 'GWP-ASan' + config.name_suffix
+
+# Setup source root.
+config.test_source_root = os.path.dirname(__file__)
+
+# Test suffixes.
+config.suffixes = ['.c', '.cc', '.cpp', '.test']
+
+# C & CXX flags.
+c_flags = ([config.target_cflags])
+
+# Android doesn't want -lrt.
+if not config.android:
+  c_flags += ["-lrt"]
+
+cxx_flags = (c_flags + config.cxx_mode_flags + ["-std=c++11"])
+
+def build_invocation(compile_flags):
+  return " " + " ".join([config.clang] + compile_flags) + " "
+
+# Add substitutions.
+config.substitutions.append(("%clang ", build_invocation(c_flags)))
+
+# GWP-ASan tests are currently supported on Linux only.
+if config.host_os not in ['Linux']:
+   config.unsupported = True
Index: compiler-rt/test/gwp_asan/dummy_test.cc
===
--- /dev/null
+++ compiler-rt/test/gwp_asan/dummy_test.cc
@@ -0,0 +1,4 @@
+// Exists to simply stop warnings about lit not discovering any tests here.
+// RUN: %clang %s
+
+int main() { return 0; }
Index: compiler-rt/test/gwp_asan/CMakeLists.txt
===
--- compiler-rt/test/gwp_asan/CMakeLists.txt
+++ compiler-rt/test/gwp_asan/CMakeLists.txt
@@ -0,0 +1,45 @@
+set(GWP_ASAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(GWP_ASAN_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+
+set(GWP_ASAN_TESTSUITES)
+
+set(GWP_ASAN_UNITTEST_DEPS)
+set(GWP_ASAN_TEST_DEPS
+  ${SANITIZER_COMMON_LIT_TEST_DEPS}
+  gwp_asan)
+
+if (COMPILER_RT_INCLUDE_TESTS)
+  list(APPEND GWP_ASAN_TEST_DEPS GwpAsanUnitTests)
+  configure_lit_site_cfg(
+${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.in
+${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg)
+  add_lit_testsuite(check-gwp_asan-unit "Running GWP-ASan unit tests"
+${CMAKE_CURRENT_BINARY_DIR}/unit
+DEPENDS ${GWP_ASAN_TEST_DEPS})
+  set_target_properties(check-gwp_asan-unit PROPERTIES FOLDER
+"Compiler-RT Tests")
+list(APPEND GWP_ASAN_TEST_DEPS check-gwp_asan-unit)
+endif()
+
+configure_lit_site_cfg(
+  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+  )
+
+foreach(arch ${GWP_ASAN_SUPPORTED_ARCH})
+  set(GWP_ASAN_TEST_TARGET_ARCH ${arch})
+  string(TOLOWER "-${arch}" GWP_ASAN_TEST_CONFIG_SUFFIX)
+  get_test_cc_for_arch(${arch} GWP_ASAN_TEST_TARGET_CC 

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-21 Thread Ethan Sommer via Phabricator via cfe-commits
E5ten added a comment.

@beanz But if libclang_shared is intended to be a shippable binary and 
BUILD_SHARED_LIBS is only intended to be an option used in developer builds, 
and libclang_shared while not causing conflicts (thanks for the info on how 
that works by the way) would be redundant in a local developer build one would 
see BUILD_SHARED_LIBS enabled in wouldn't it? And also to me it doesn't really 
make sense to enable the intended shippable binary in a build that is 
specifically enabling a developer option, and so is obviously not intended for 
shipment (I get that in the arch case it is intended for shipment but that case 
is them using an option they shouldn't not the option being one that should be 
used when the built products are intended for redistribution).


Repository:
  rC Clang

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

https://reviews.llvm.org/D61909



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


[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-21 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment.

In D61909#1510955 , @E5ten wrote:

> @beanz Well I took libclang_shared as effectively an equivalent to the 
> libLLVM.so that's created with that dylib option, and when BUILD_SHARED_LIBS 
> is enabled that library is not created, in fact the option to create that 
> library conflicts with BUILD_SHARED_LIBS.


That conflict is because of how I implemented libLLVM, and is something I'm 
looking to change. I'm hoping to put up a patch this week that will update how 
we generate libLLVM to be more like how libclang_shared is built.

> Also when the libs are built shared and also as object libraries that are 
> linked into libclang_shared would that not cause the same libraries to be 
> linked into executables twice, once through the shared libraries and once 
> through libclang_shared?

Object libraries are just collections of object files without linkage 
dependencies. The whole point of implementing libclang_shared in terms of 
object files is to allow constructing libclang_shared even if 
`BUILD_SHARED_LIBS` is enabled, and without using extra linker flags to force 
the linker to treat all the clang static archives as collections of object 
files (we do that in libLLVM using --all_load and --whole-archive flags).

It shouldn't result in duplicating the linkage because libclang contains all 
the code and shouldn't have any external resolutions against the libclang* 
component libraries.

One big reason that I don't want to disable generating libclang_shared (or 
libLLVM) if `BUILD_SHARED_LIBS=On` is because libclang_shared is intended to be 
a shippable binary unlike the `BUILD_SHARED_LIBS` libraries, so it really 
should be enabled in every possible build configuration that we can make it 
work.


Repository:
  rC Clang

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

https://reviews.llvm.org/D61909



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


[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-21 Thread Ethan Sommer via Phabricator via cfe-commits
E5ten added a comment.

@beanz Well I took libclang_shared as effectively an equivalent to the 
libLLVM.so that's created with that dylib option, and when BUILD_SHARED_LIBS is 
enabled that library is not created, in fact the option to create that library 
conflicts with BUILD_SHARED_LIBS. Also when the libs are built shared and also 
as object libraries that are linked into libclang_shared would that not cause 
the same libraries to be linked into executables twice, once through the shared 
libraries and once through libclang_shared?


Repository:
  rC Clang

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

https://reviews.llvm.org/D61909



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


[PATCH] D62047: [WebAssembly] Add multivalue and tail-call target features

2019-05-21 Thread Heejin Ahn via Phabricator via cfe-commits
aheejin added a comment.

I see. LGTM either way 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62047



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


[PATCH] D57930: [Driver] Verify GCCInstallation is valid

2019-05-21 Thread Nick Desaulniers via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rC361314: [Driver] Verify GCCInstallation is valid (authored 
by nickdesaulniers, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D57930?vs=200580=200586#toc

Repository:
  rC Clang

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

https://reviews.llvm.org/D57930

Files:
  lib/Driver/ToolChains/Linux.cpp
  test/Driver/B-opt.c


Index: test/Driver/B-opt.c
===
--- test/Driver/B-opt.c
+++ test/Driver/B-opt.c
@@ -20,3 +20,8 @@
 // RUN: -B %S/Inputs/B_opt_tree/dir2 2>&1 -fuse-ld=ld \
 // RUN:   | FileCheck --check-prefix=CHECK-B-OPT-MULT %s
 // CHECK-B-OPT-MULT: "{{.*}}/Inputs/B_opt_tree/dir3{{/|}}prefix-ld"
+//
+// RUN: %clang -B %S/Inputs/does_not_exist -print-search-dirs \
+// RUN: -target aarch64-linux-gnu \
+// RUN:   | FileCheck --check-prefix=CHECK-B-OPT-INVALID %s
+// CHECK-B-OPT-INVALID-NOT: /..//bin
Index: lib/Driver/ToolChains/Linux.cpp
===
--- lib/Driver/ToolChains/Linux.cpp
+++ lib/Driver/ToolChains/Linux.cpp
@@ -234,9 +234,11 @@
   // used to target i386.
   // FIXME: This seems unlikely to be Linux-specific.
   ToolChain::path_list  = getProgramPaths();
-  PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
- GCCInstallation.getTriple().str() + "/bin")
-   .str());
+  if (GCCInstallation.isValid()) {
+PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
+   GCCInstallation.getTriple().str() + "/bin")
+ .str());
+  }
 
   Distro Distro(D.getVFS());
 


Index: test/Driver/B-opt.c
===
--- test/Driver/B-opt.c
+++ test/Driver/B-opt.c
@@ -20,3 +20,8 @@
 // RUN: -B %S/Inputs/B_opt_tree/dir2 2>&1 -fuse-ld=ld \
 // RUN:   | FileCheck --check-prefix=CHECK-B-OPT-MULT %s
 // CHECK-B-OPT-MULT: "{{.*}}/Inputs/B_opt_tree/dir3{{/|}}prefix-ld"
+//
+// RUN: %clang -B %S/Inputs/does_not_exist -print-search-dirs \
+// RUN: -target aarch64-linux-gnu \
+// RUN:   | FileCheck --check-prefix=CHECK-B-OPT-INVALID %s
+// CHECK-B-OPT-INVALID-NOT: /..//bin
Index: lib/Driver/ToolChains/Linux.cpp
===
--- lib/Driver/ToolChains/Linux.cpp
+++ lib/Driver/ToolChains/Linux.cpp
@@ -234,9 +234,11 @@
   // used to target i386.
   // FIXME: This seems unlikely to be Linux-specific.
   ToolChain::path_list  = getProgramPaths();
-  PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
- GCCInstallation.getTriple().str() + "/bin")
-   .str());
+  if (GCCInstallation.isValid()) {
+PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
+   GCCInstallation.getTriple().str() + "/bin")
+ .str());
+  }
 
   Distro Distro(D.getVFS());
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r361314 - [Driver] Verify GCCInstallation is valid

2019-05-21 Thread Nick Desaulniers via cfe-commits
Author: nickdesaulniers
Date: Tue May 21 14:21:35 2019
New Revision: 361314

URL: http://llvm.org/viewvc/llvm-project?rev=361314=rev
Log:
[Driver] Verify GCCInstallation is valid

Summary:
Values returned by GCCInstallation.getParentLibPath() and
GCCInstallation.getTriple() are not valid unless
GCCInstallation.isValid() returns true. This has previously been
ignored, and the former two values were used without checking whether
GCCInstallation is valid. This led to the bad path "/../bin" being added
to the list of program paths.

author: danielmentz "Daniel Mentz "

Reviewers: #clang, tstellar, srhines

Reviewed By: srhines

Subscribers: danielmentz, ormris, nickdesaulniers, srhines, cfe-commits

Tags: #clang

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

Modified:
cfe/trunk/lib/Driver/ToolChains/Linux.cpp
cfe/trunk/test/Driver/B-opt.c

Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=361314=361313=361314=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Tue May 21 14:21:35 2019
@@ -234,9 +234,11 @@ Linux::Linux(const Driver , const llvm
   // used to target i386.
   // FIXME: This seems unlikely to be Linux-specific.
   ToolChain::path_list  = getProgramPaths();
-  PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
- GCCInstallation.getTriple().str() + "/bin")
-   .str());
+  if (GCCInstallation.isValid()) {
+PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
+   GCCInstallation.getTriple().str() + "/bin")
+ .str());
+  }
 
   Distro Distro(D.getVFS());
 

Modified: cfe/trunk/test/Driver/B-opt.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/B-opt.c?rev=361314=361313=361314=diff
==
--- cfe/trunk/test/Driver/B-opt.c (original)
+++ cfe/trunk/test/Driver/B-opt.c Tue May 21 14:21:35 2019
@@ -20,3 +20,8 @@
 // RUN: -B %S/Inputs/B_opt_tree/dir2 2>&1 -fuse-ld=ld \
 // RUN:   | FileCheck --check-prefix=CHECK-B-OPT-MULT %s
 // CHECK-B-OPT-MULT: "{{.*}}/Inputs/B_opt_tree/dir3{{/|}}prefix-ld"
+//
+// RUN: %clang -B %S/Inputs/does_not_exist -print-search-dirs \
+// RUN: -target aarch64-linux-gnu \
+// RUN:   | FileCheck --check-prefix=CHECK-B-OPT-INVALID %s
+// CHECK-B-OPT-INVALID-NOT: /..//bin


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


Re: [PATCH] D61909: Add Clang shared library with C++ exports

2019-05-21 Thread Chris Bieneman via cfe-commits
I don't want building libclang_shared to be disabled when 
`BUILD_SHARED_LIBS=On`. libclang_shared fulfills a completely different purpose 
from `BUILD_SHARED_LIBS`.

-Chris

> On May 21, 2019, at 12:20 PM, Ethan Sommer via Phabricator 
>  wrote:
> 
> E5ten added a comment.
> 
> @beanz Wouldn't fixing this by adding OR BUILD_SHARED_LIBS to if(ARG_SHARED) 
> in AddClang.cmake and to if (NOT LLVM_ENABLE_PIC) in 
> clang-shlib/CMakeLists.txt to prevent making libclang_shared when 
> BUILD_SHARED_LIBS is enabled make more sense?
> 
> 
> Repository:
>  rC Clang
> 
> CHANGES SINCE LAST ACTION
>  https://reviews.llvm.org/D61909/new/
> 
> https://reviews.llvm.org/D61909
> 
> 
> 

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


[PATCH] D62215: Fixes to distribution example for X86_64 Arch Linux

2019-05-21 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment.

Adding "libcxxabi" to `LLVM_ENABLE_RUNTIMES` is fine, but the other changes to 
the DistributionExample are only needed because you chose to use gold, which is 
a configuration-specific decision that is not representative of how most people 
will build, therefore it shouldn't be in the example.

I'm also not sure the `PLUGIN_TOOL` line is correct. That seems to assume that 
you either set `LLVM_ENABLE_LLVM_DYLIB`, or have libLLVM pre-installed, which I 
don't think most people do.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62215



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


[PATCH] D59841: [Gnu Driver] Let -static-pie win if it is specified along with -pie or -static.

2019-05-21 Thread Siva Chandra via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rC361312: Let -static-pie win if it is specified along with 
-pie or -static. (authored by sivachandra, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D59841?vs=200577=200584#toc

Repository:
  rC Clang

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

https://reviews.llvm.org/D59841

Files:
  include/clang/Basic/DiagnosticDriverKinds.td
  lib/Driver/ToolChains/Gnu.cpp
  test/Driver/linux-ld.c

Index: lib/Driver/ToolChains/Gnu.cpp
===
--- lib/Driver/ToolChains/Gnu.cpp
+++ lib/Driver/ToolChains/Gnu.cpp
@@ -311,7 +311,7 @@
 
 static bool getPIE(const ArgList , const toolchains::Linux ) {
   if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_static) ||
-  Args.hasArg(options::OPT_r))
+  Args.hasArg(options::OPT_r) || Args.hasArg(options::OPT_static_pie))
 return false;
 
   Arg *A = Args.getLastArg(options::OPT_pie, options::OPT_no_pie,
@@ -321,6 +321,26 @@
   return A->getOption().matches(options::OPT_pie);
 }
 
+static bool getStaticPIE(const ArgList ,
+ const toolchains::Linux ) {
+  bool HasStaticPIE = Args.hasArg(options::OPT_static_pie);
+  // -no-pie is an alias for -nopie. So, handling -nopie takes care of
+  // -no-pie as well.
+  if (HasStaticPIE && Args.hasArg(options::OPT_nopie)) {
+const Driver  = ToolChain.getDriver();
+const llvm::opt::OptTable  = D.getOpts();
+const char *StaticPIEName = Opts.getOptionName(options::OPT_static_pie);
+const char *NoPIEName = Opts.getOptionName(options::OPT_nopie);
+D.Diag(diag::err_drv_cannot_mix_options) << StaticPIEName << NoPIEName;
+  }
+  return HasStaticPIE;
+}
+
+static bool getStatic(const ArgList ) {
+  return Args.hasArg(options::OPT_static) &&
+  !Args.hasArg(options::OPT_static_pie);
+}
+
 void tools::gnutools::Linker::ConstructJob(Compilation , const JobAction ,
const InputInfo ,
const InputInfoList ,
@@ -336,7 +356,8 @@
   const bool isAndroid = ToolChain.getTriple().isAndroid();
   const bool IsIAMCU = ToolChain.getTriple().isOSIAMCU();
   const bool IsPIE = getPIE(Args, ToolChain);
-  const bool IsStaticPIE = Args.hasArg(options::OPT_static_pie);
+  const bool IsStaticPIE = getStaticPIE(Args, ToolChain);
+  const bool IsStatic = getStatic(Args);
   const bool HasCRTBeginEndFiles =
   ToolChain.getTriple().hasEnvironment() ||
   (ToolChain.getTriple().getVendor() != llvm::Triple::MipsTechnologies);
@@ -408,7 +429,7 @@
 return;
   }
 
-  if (Args.hasArg(options::OPT_static)) {
+  if (IsStatic) {
 if (Arch == llvm::Triple::arm || Arch == llvm::Triple::armeb ||
 Arch == llvm::Triple::thumb || Arch == llvm::Triple::thumbeb)
   CmdArgs.push_back("-Bstatic");
@@ -418,7 +439,7 @@
 CmdArgs.push_back("-shared");
   }
 
-  if (!Args.hasArg(options::OPT_static)) {
+  if (!IsStatic) {
 if (Args.hasArg(options::OPT_rdynamic))
   CmdArgs.push_back("-export-dynamic");
 
@@ -465,7 +486,7 @@
   }
   if (P.empty()) {
 const char *crtbegin;
-if (Args.hasArg(options::OPT_static))
+if (IsStatic)
   crtbegin = isAndroid ? "crtbegin_static.o" : "crtbeginT.o";
 else if (Args.hasArg(options::OPT_shared))
   crtbegin = isAndroid ? "crtbegin_so.o" : "crtbeginS.o";
@@ -520,7 +541,7 @@
 
   if (!Args.hasArg(options::OPT_nostdlib)) {
 if (!Args.hasArg(options::OPT_nodefaultlibs)) {
-  if (Args.hasArg(options::OPT_static) || IsStaticPIE)
+  if (IsStatic || IsStaticPIE)
 CmdArgs.push_back("--start-group");
 
   if (NeedsSanitizerDeps)
@@ -556,7 +577,7 @@
   if (IsIAMCU)
 CmdArgs.push_back("-lgloss");
 
-  if (Args.hasArg(options::OPT_static) || IsStaticPIE)
+  if (IsStatic || IsStaticPIE)
 CmdArgs.push_back("--end-group");
   else
 AddRunTimeLibs(ToolChain, D, CmdArgs, Args);
Index: include/clang/Basic/DiagnosticDriverKinds.td
===
--- include/clang/Basic/DiagnosticDriverKinds.td
+++ include/clang/Basic/DiagnosticDriverKinds.td
@@ -458,4 +458,5 @@
   "command line to use the libc++ standard library instead">,
   InGroup>;
 
+def err_drv_cannot_mix_options : Error<"cannot specify '%1' along with '%0'">;
 }
Index: test/Driver/linux-ld.c
===
--- test/Driver/linux-ld.c
+++ test/Driver/linux-ld.c
@@ -194,6 +194,39 @@
 // CHECK-CLANG-LD-STATIC-PIE: "{{.*}}rcrt1.o"
 // CHECK-CLANG-LD-STATIC-PIE: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group"
 //
+// RUN: %clang -static-pie -pie -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: 

r361312 - Let -static-pie win if it is specified along with -pie or -static.

2019-05-21 Thread Siva Chandra via cfe-commits
Author: sivachandra
Date: Tue May 21 14:09:05 2019
New Revision: 361312

URL: http://llvm.org/viewvc/llvm-project?rev=361312=rev
Log:
Let -static-pie win if it is specified along with -pie or -static.

Also, disallow specifying -no-pie/-nopie along with -static-pie.

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

Modified:
cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
cfe/trunk/test/Driver/linux-ld.c

Modified: cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td?rev=361312=361311=361312=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td Tue May 21 14:09:05 
2019
@@ -458,4 +458,5 @@ def warn_drv_libstdcxx_not_found : Warni
   "command line to use the libc++ standard library instead">,
   InGroup>;
 
+def err_drv_cannot_mix_options : Error<"cannot specify '%1' along with '%0'">;
 }

Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=361312=361311=361312=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Tue May 21 14:09:05 2019
@@ -311,7 +311,7 @@ static const char *getLDMOption(const ll
 
 static bool getPIE(const ArgList , const toolchains::Linux ) {
   if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_static) ||
-  Args.hasArg(options::OPT_r))
+  Args.hasArg(options::OPT_r) || Args.hasArg(options::OPT_static_pie))
 return false;
 
   Arg *A = Args.getLastArg(options::OPT_pie, options::OPT_no_pie,
@@ -321,6 +321,26 @@ static bool getPIE(const ArgList ,
   return A->getOption().matches(options::OPT_pie);
 }
 
+static bool getStaticPIE(const ArgList ,
+ const toolchains::Linux ) {
+  bool HasStaticPIE = Args.hasArg(options::OPT_static_pie);
+  // -no-pie is an alias for -nopie. So, handling -nopie takes care of
+  // -no-pie as well.
+  if (HasStaticPIE && Args.hasArg(options::OPT_nopie)) {
+const Driver  = ToolChain.getDriver();
+const llvm::opt::OptTable  = D.getOpts();
+const char *StaticPIEName = Opts.getOptionName(options::OPT_static_pie);
+const char *NoPIEName = Opts.getOptionName(options::OPT_nopie);
+D.Diag(diag::err_drv_cannot_mix_options) << StaticPIEName << NoPIEName;
+  }
+  return HasStaticPIE;
+}
+
+static bool getStatic(const ArgList ) {
+  return Args.hasArg(options::OPT_static) &&
+  !Args.hasArg(options::OPT_static_pie);
+}
+
 void tools::gnutools::Linker::ConstructJob(Compilation , const JobAction ,
const InputInfo ,
const InputInfoList ,
@@ -336,7 +356,8 @@ void tools::gnutools::Linker::ConstructJ
   const bool isAndroid = ToolChain.getTriple().isAndroid();
   const bool IsIAMCU = ToolChain.getTriple().isOSIAMCU();
   const bool IsPIE = getPIE(Args, ToolChain);
-  const bool IsStaticPIE = Args.hasArg(options::OPT_static_pie);
+  const bool IsStaticPIE = getStaticPIE(Args, ToolChain);
+  const bool IsStatic = getStatic(Args);
   const bool HasCRTBeginEndFiles =
   ToolChain.getTriple().hasEnvironment() ||
   (ToolChain.getTriple().getVendor() != llvm::Triple::MipsTechnologies);
@@ -408,7 +429,7 @@ void tools::gnutools::Linker::ConstructJ
 return;
   }
 
-  if (Args.hasArg(options::OPT_static)) {
+  if (IsStatic) {
 if (Arch == llvm::Triple::arm || Arch == llvm::Triple::armeb ||
 Arch == llvm::Triple::thumb || Arch == llvm::Triple::thumbeb)
   CmdArgs.push_back("-Bstatic");
@@ -418,7 +439,7 @@ void tools::gnutools::Linker::ConstructJ
 CmdArgs.push_back("-shared");
   }
 
-  if (!Args.hasArg(options::OPT_static)) {
+  if (!IsStatic) {
 if (Args.hasArg(options::OPT_rdynamic))
   CmdArgs.push_back("-export-dynamic");
 
@@ -465,7 +486,7 @@ void tools::gnutools::Linker::ConstructJ
   }
   if (P.empty()) {
 const char *crtbegin;
-if (Args.hasArg(options::OPT_static))
+if (IsStatic)
   crtbegin = isAndroid ? "crtbegin_static.o" : "crtbeginT.o";
 else if (Args.hasArg(options::OPT_shared))
   crtbegin = isAndroid ? "crtbegin_so.o" : "crtbeginS.o";
@@ -520,7 +541,7 @@ void tools::gnutools::Linker::ConstructJ
 
   if (!Args.hasArg(options::OPT_nostdlib)) {
 if (!Args.hasArg(options::OPT_nodefaultlibs)) {
-  if (Args.hasArg(options::OPT_static) || IsStaticPIE)
+  if (IsStatic || IsStaticPIE)
 CmdArgs.push_back("--start-group");
 
   if (NeedsSanitizerDeps)
@@ -556,7 +577,7 @@ void tools::gnutools::Linker::ConstructJ
   if (IsIAMCU)
 CmdArgs.push_back("-lgloss");
 
-  

[PATCH] D57930: [Driver] Verify GCCInstallation is valid

2019-05-21 Thread Stephen Hines via Phabricator via cfe-commits
srhines accepted this revision.
srhines added a comment.
This revision is now accepted and ready to land.

Thanks for picking this up and finishing it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D57930



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


[PATCH] D57930: [Driver] Verify GCCInstallation is valid

2019-05-21 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 200580.
nickdesaulniers added a comment.
Herald added a subscriber: ormris.

- add unit test


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D57930

Files:
  clang/lib/Driver/ToolChains/Linux.cpp
  clang/test/Driver/B-opt.c


Index: clang/test/Driver/B-opt.c
===
--- clang/test/Driver/B-opt.c
+++ clang/test/Driver/B-opt.c
@@ -20,3 +20,8 @@
 // RUN: -B %S/Inputs/B_opt_tree/dir2 2>&1 -fuse-ld=ld \
 // RUN:   | FileCheck --check-prefix=CHECK-B-OPT-MULT %s
 // CHECK-B-OPT-MULT: "{{.*}}/Inputs/B_opt_tree/dir3{{/|}}prefix-ld"
+//
+// RUN: %clang -B %S/Inputs/does_not_exist -print-search-dirs \
+// RUN: -target aarch64-linux-gnu \
+// RUN:   | FileCheck --check-prefix=CHECK-B-OPT-INVALID %s
+// CHECK-B-OPT-INVALID-NOT: /..//bin
Index: clang/lib/Driver/ToolChains/Linux.cpp
===
--- clang/lib/Driver/ToolChains/Linux.cpp
+++ clang/lib/Driver/ToolChains/Linux.cpp
@@ -234,9 +234,11 @@
   // used to target i386.
   // FIXME: This seems unlikely to be Linux-specific.
   ToolChain::path_list  = getProgramPaths();
-  PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
- GCCInstallation.getTriple().str() + "/bin")
-   .str());
+  if (GCCInstallation.isValid()) {
+PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
+   GCCInstallation.getTriple().str() + "/bin")
+ .str());
+  }
 
   Distro Distro(D.getVFS());
 


Index: clang/test/Driver/B-opt.c
===
--- clang/test/Driver/B-opt.c
+++ clang/test/Driver/B-opt.c
@@ -20,3 +20,8 @@
 // RUN: -B %S/Inputs/B_opt_tree/dir2 2>&1 -fuse-ld=ld \
 // RUN:   | FileCheck --check-prefix=CHECK-B-OPT-MULT %s
 // CHECK-B-OPT-MULT: "{{.*}}/Inputs/B_opt_tree/dir3{{/|}}prefix-ld"
+//
+// RUN: %clang -B %S/Inputs/does_not_exist -print-search-dirs \
+// RUN: -target aarch64-linux-gnu \
+// RUN:   | FileCheck --check-prefix=CHECK-B-OPT-INVALID %s
+// CHECK-B-OPT-INVALID-NOT: /..//bin
Index: clang/lib/Driver/ToolChains/Linux.cpp
===
--- clang/lib/Driver/ToolChains/Linux.cpp
+++ clang/lib/Driver/ToolChains/Linux.cpp
@@ -234,9 +234,11 @@
   // used to target i386.
   // FIXME: This seems unlikely to be Linux-specific.
   ToolChain::path_list  = getProgramPaths();
-  PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
- GCCInstallation.getTriple().str() + "/bin")
-   .str());
+  if (GCCInstallation.isValid()) {
+PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
+   GCCInstallation.getTriple().str() + "/bin")
+ .str());
+  }
 
   Distro Distro(D.getVFS());
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D62214: Remove extra if case.

2019-05-21 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm

Testing offline showed that it was impossible to reach the return with a real 
global variable with an enumeration type.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62214



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


[PATCH] D62167: CodeView - add static data members to global variable debug info.

2019-05-21 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment.

This needs a clang-side test to show that clang generates the expected IR for 
static data members.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62167



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


[PATCH] D59841: [Gnu Driver] Let -static-pie win if it is specified along with -pie or -static.

2019-05-21 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra marked an inline comment as done.
sivachandra added a comment.

PTAL




Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:311
   if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_static) ||
-  Args.hasArg(options::OPT_r))
+  Args.hasArg(options::OPT_r) || Args.hasArg(options::OPT_static_pie))
 return false;

saugustine wrote:
> It's not clear to me that the command line -static-pie -no-pie should result 
> in static-pie, given the way the rest of that function is coded.
> 
> I might make it a ternary enum: "nothing" "pie" "static-pie" with the last 
> one winning. That method seems more consistent with current behavior.
> 
> This would allow anyone checking the state of pie to use a single function 
> and just check the result.
static-pie is now handled in its own separate function below.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59841



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


[PATCH] D59841: [Gnu Driver] Let -static-pie win if it is specified along with -pie or -static.

2019-05-21 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra updated this revision to Diff 200577.
sivachandra added a comment.

Let -static-pie win if specified along with -pie or -static.

Also, treat specifying -nopie/-no-pie along with -static-pie as an error.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59841

Files:
  clang/include/clang/Basic/DiagnosticDriverKinds.td
  clang/lib/Driver/ToolChains/Gnu.cpp
  clang/test/Driver/linux-ld.c

Index: clang/test/Driver/linux-ld.c
===
--- clang/test/Driver/linux-ld.c
+++ clang/test/Driver/linux-ld.c
@@ -194,6 +194,39 @@
 // CHECK-CLANG-LD-STATIC-PIE: "{{.*}}rcrt1.o"
 // CHECK-CLANG-LD-STATIC-PIE: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group"
 //
+// RUN: %clang -static-pie -pie -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-CLANG-LD-STATIC-PIE-PIE %s
+// CHECK-CLANG-LD-STATIC-PIE-PIE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-CLANG-LD-STATIC-PIE-PIE: "-static"
+// CHECK-CLANG-LD-STATIC-PIE-PIE: "-pie"
+// CHECK-CLANG-LD-STATIC-PIE-PIE: "--no-dynamic-linker"
+// CHECK-CLANG-LD-STATIC-PIE-PIE: "-m" "elf_x86_64"
+// CHECK-CLANG-LD-STATIC-PIE-PIE: "{{.*}}rcrt1.o"
+// CHECK-CLANG-LD-STATIC-PIE-PIE: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group"
+//
+// RUN: %clang -static-pie -static -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-CLANG-LD-STATIC-PIE-STATIC %s
+// CHECK-CLANG-LD-STATIC-PIE-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-CLANG-LD-STATIC-PIE-STATIC: "-static"
+// CHECK-CLANG-LD-STATIC-PIE-STATIC: "-pie"
+// CHECK-CLANG-LD-STATIC-PIE-STATIC: "--no-dynamic-linker"
+// CHECK-CLANG-LD-STATIC-PIE-STATIC: "-m" "elf_x86_64"
+// CHECK-CLANG-LD-STATIC-PIE-STATIC: "{{.*}}rcrt1.o"
+// CHECK-CLANG-LD-STATIC-PIE-STATIC: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group"
+//
+// RUN: %clang -static-pie -nopie -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-CLANG-LD-STATIC-PIE-NOPIE %s
+// CHECK-CLANG-LD-STATIC-PIE-NOPIE: error: cannot specify 'nopie' along with 'static-pie'
+//
 // RUN: %clang -dynamic -no-canonical-prefixes %s -### -o %t.o 2>&1 \
 // RUN: --target=x86_64-unknown-linux -rtlib=platform \
 // RUN: --gcc-toolchain="" \
Index: clang/lib/Driver/ToolChains/Gnu.cpp
===
--- clang/lib/Driver/ToolChains/Gnu.cpp
+++ clang/lib/Driver/ToolChains/Gnu.cpp
@@ -311,7 +311,7 @@
 
 static bool getPIE(const ArgList , const toolchains::Linux ) {
   if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_static) ||
-  Args.hasArg(options::OPT_r))
+  Args.hasArg(options::OPT_r) || Args.hasArg(options::OPT_static_pie))
 return false;
 
   Arg *A = Args.getLastArg(options::OPT_pie, options::OPT_no_pie,
@@ -321,6 +321,26 @@
   return A->getOption().matches(options::OPT_pie);
 }
 
+static bool getStaticPIE(const ArgList ,
+ const toolchains::Linux ) {
+  bool HasStaticPIE = Args.hasArg(options::OPT_static_pie);
+  // -no-pie is an alias for -nopie. So, handling -nopie takes care of
+  // -no-pie as well.
+  if (HasStaticPIE && Args.hasArg(options::OPT_nopie)) {
+const Driver  = ToolChain.getDriver();
+const llvm::opt::OptTable  = D.getOpts();
+const char *StaticPIEName = Opts.getOptionName(options::OPT_static_pie);
+const char *NoPIEName = Opts.getOptionName(options::OPT_nopie);
+D.Diag(diag::err_drv_cannot_mix_options) << StaticPIEName << NoPIEName;
+  }
+  return HasStaticPIE;
+}
+
+static bool getStatic(const ArgList ) {
+  return Args.hasArg(options::OPT_static) &&
+  !Args.hasArg(options::OPT_static_pie);
+}
+
 void tools::gnutools::Linker::ConstructJob(Compilation , const JobAction ,
const InputInfo ,
const InputInfoList ,
@@ -336,7 +356,8 @@
   const bool isAndroid = ToolChain.getTriple().isAndroid();
   const bool IsIAMCU = ToolChain.getTriple().isOSIAMCU();
   const bool IsPIE = getPIE(Args, ToolChain);
-  const bool IsStaticPIE = Args.hasArg(options::OPT_static_pie);
+  const bool IsStaticPIE = getStaticPIE(Args, ToolChain);
+  const bool IsStatic = getStatic(Args);
   const bool HasCRTBeginEndFiles =
   ToolChain.getTriple().hasEnvironment() ||
   (ToolChain.getTriple().getVendor() != 

Re: r361278 - [clang][Darwin] Refactor header search path logic into the driver

2019-05-21 Thread Richard Smith via cfe-commits
Awesome!

But... this resulted in two test failures for me. I've fixed them in
r361301, can you check that's correct?

On Tue, 21 May 2019 at 10:45, Louis Dionne via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: ldionne
> Date: Tue May 21 10:48:04 2019
> New Revision: 361278
>
> URL: http://llvm.org/viewvc/llvm-project?rev=361278=rev
> Log:
> [clang][Darwin] Refactor header search path logic into the driver
>
> Summary:
> This commit moves the logic for determining system, resource and C++
> header search paths from CC1 to the driver. This refactor has already
> been made for several platforms, but Darwin had been left behind.
>
> This refactor tries to implement the previous search path logic with
> perfect accuracy. In particular, the order of all include paths inside
> CC1 and all paths that were skipped because nonexistent are conserved
> after the refactor. This change was also tested against a code base
> of significant size and revealed no problems.
>
> Reviewers: jfb, arphaman
>
> Subscribers: nemanjai, javed.absar, kbarton, christof, jkorous,
> dexonsmith, jsji, cfe-commits
>
> Tags: #clang
>
> Differential Revision: https://reviews.llvm.org/D61963
>
> Added:
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/arm64-apple-darwin10/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/arm64-apple-darwin10/.keep
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/lib/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/lib/.keep
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v6/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v6/.keep
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v7/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v7/.keep
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/lib/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/lib/.keep
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/ppc64/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/ppc64/.keep
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/ppc64/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/ppc64/.keep
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/lib/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/lib/.keep
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.0.0/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.0.0/i686-apple-darwin8/
>
> cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.0.0/i686-apple-darwin8/.keep
>

r361302 - Remove unicode character from test

2019-05-21 Thread Leonard Chan via cfe-commits
Author: leonardchan
Date: Tue May 21 13:12:00 2019
New Revision: 361302

URL: http://llvm.org/viewvc/llvm-project?rev=361302=rev
Log:
Remove unicode character from test

Modified:
cfe/trunk/test/SemaObjC/nullability_macro.m

Modified: cfe/trunk/test/SemaObjC/nullability_macro.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/nullability_macro.m?rev=361302=361301=361302=diff
==
--- cfe/trunk/test/SemaObjC/nullability_macro.m (original)
+++ cfe/trunk/test/SemaObjC/nullability_macro.m Tue May 21 13:12:00 2019
@@ -1,12 +1,13 @@
 // Test that nullability attributes still get merged even though they are
 // wrapped with a MacroQualifiedType. This should just compile with no errors.
 // RUN: %clang_cc1 %s -Wno-objc-root-class -fsyntax-only -verify
+// expected-no-diagnostics
 #define UI_APPEARANCE_SELECTOR 
__attribute__((annotate("ui_appearance_selector")))
 
 @class UIColor;
 
 @interface Test
-@property(null_resettable, nonatomic, strong) UIColor *onTintColor 
UI_APPEARANCE_SELECTOR; // expected-warning{{treating Unicode character as 
whitespace}}
+@property(null_resettable, nonatomic, strong) UIColor *onTintColor 
UI_APPEARANCE_SELECTOR;
 @end
 
 @implementation Test


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


r361301 - Fix test failures after r361278 on non-Darwin platforms and when

2019-05-21 Thread Richard Smith via cfe-commits
Author: rsmith
Date: Tue May 21 13:10:52 2019
New Revision: 361301

URL: http://llvm.org/viewvc/llvm-project?rev=361301=rev
Log:
Fix test failures after r361278 on non-Darwin platforms and when
CLANG_DEFAULT_STDLIB is defined to libstdc++.

Modified:
cfe/trunk/test/Driver/darwin-header-search-libcxx.cpp
cfe/trunk/test/Driver/darwin-header-search-libstdcxx.cpp

Modified: cfe/trunk/test/Driver/darwin-header-search-libcxx.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-header-search-libcxx.cpp?rev=361301=361300=361301=diff
==
--- cfe/trunk/test/Driver/darwin-header-search-libcxx.cpp (original)
+++ cfe/trunk/test/Driver/darwin-header-search-libcxx.cpp Tue May 21 13:10:52 
2019
@@ -52,10 +52,11 @@
 // C++ library include paths (so all except 
/usr/bin/../include/c++/v1).
 //
 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
-// RUN: -target x86_64-apple-darwin \
+// RUN: -target x86_64-apple-darwin16 \
 // RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain/usr/bin \
 // RUN: -resource-dir=%S/Inputs/resource_dir \
 // RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr \
+// RUN: -stdlib=platform \
 // RUN: -nostdinc \
 // RUN:   | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr \
 // RUN:   -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain \
@@ -65,10 +66,11 @@
 // CHECK-LIBCXX-NOSTDINC-NOT: "-internal-isystem" 
"[[SYSROOT]]/usr/include/c++/v1"
 //
 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
-// RUN: -target x86_64-apple-darwin \
+// RUN: -target x86_64-apple-darwin16 \
 // RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain/usr/bin \
 // RUN: -resource-dir=%S/Inputs/resource_dir \
 // RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr \
+// RUN: -stdlib=platform \
 // RUN: -nostdinc \
 // RUN:   | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr \
 // RUN:   -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain \

Modified: cfe/trunk/test/Driver/darwin-header-search-libstdcxx.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-header-search-libstdcxx.cpp?rev=361301=361300=361301=diff
==
--- cfe/trunk/test/Driver/darwin-header-search-libstdcxx.cpp (original)
+++ cfe/trunk/test/Driver/darwin-header-search-libstdcxx.cpp Tue May 21 
13:10:52 2019
@@ -112,7 +112,7 @@
 // RUN:| FileCheck -allow-empty --check-prefix=CHECK-LIBSTDCXX-MISSING-1 %s
 // CHECK-LIBSTDCXX-MISSING-1-NOT: warning
 //
-// RUN: %clang %s -target x86_64-apple-darwin -fsyntax-only 2>&1 \
-// RUN:   -isysroot %S/Inputs/basic_darwin_sdk_no_libstdcxx \
+// RUN: %clang %s -target x86_64-apple-darwin16 -fsyntax-only 2>&1 \
+// RUN:   -isysroot %S/Inputs/basic_darwin_sdk_no_libstdcxx 
-stdlib=platform \
 // RUN:| FileCheck -allow-empty --check-prefix=CHECK-LIBSTDCXX-MISSING-2 %s
 // CHECK-LIBSTDCXX-MISSING-2-NOT: warning


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


r361300 - [c++20] P0780R2: Support pack-expansion of init-captures.

2019-05-21 Thread Richard Smith via cfe-commits
Author: rsmith
Date: Tue May 21 13:10:50 2019
New Revision: 361300

URL: http://llvm.org/viewvc/llvm-project?rev=361300=rev
Log:
[c++20] P0780R2: Support pack-expansion of init-captures.

This permits an init-capture to introduce a new pack:

  template auto x = [...a = T()] { /* a is a pack */ };

To support this, the mechanism for allowing ParmVarDecls to be packs has
been extended to support arbitrary local VarDecls.

Added:
cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/expr.prim.lambda.capture/

cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/expr.prim.lambda.capture/p17.cpp
cfe/trunk/test/CXX/temp/temp.decls/temp.variadic/init-capture.cpp
cfe/trunk/test/FixIt/fixit-c++2a.cpp
Modified:
cfe/trunk/include/clang/AST/ASTContext.h
cfe/trunk/include/clang/AST/Decl.h
cfe/trunk/include/clang/AST/ExprCXX.h
cfe/trunk/include/clang/AST/Type.h
cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/include/clang/Sema/Template.h
cfe/trunk/lib/AST/ASTContext.cpp
cfe/trunk/lib/AST/Decl.cpp
cfe/trunk/lib/AST/DeclBase.cpp
cfe/trunk/lib/AST/ExprCXX.cpp
cfe/trunk/lib/AST/ItaniumMangle.cpp
cfe/trunk/lib/AST/JSONNodeDumper.cpp
cfe/trunk/lib/AST/TextNodeDumper.cpp
cfe/trunk/lib/AST/Type.cpp
cfe/trunk/lib/Parse/ParseExprCXX.cpp
cfe/trunk/lib/Sema/SemaLambda.cpp
cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
cfe/trunk/lib/Sema/TreeTransform.h
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
cfe/trunk/lib/Serialization/ASTWriter.cpp
cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp
cfe/trunk/test/SemaTemplate/sizeof-pack.cpp
cfe/trunk/www/cxx_status.html

Modified: cfe/trunk/include/clang/AST/ASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=361300=361299=361300=diff
==
--- cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/trunk/include/clang/AST/ASTContext.h Tue May 21 13:10:50 2019
@@ -1522,7 +1522,7 @@ public:
 
   /// C++11 deduced auto type.
   QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword,
-   bool IsDependent) const;
+   bool IsDependent, bool IsPack = false) const;
 
   /// C++11 deduction pattern for 'auto' type.
   QualType getAutoDeductType() const;

Modified: cfe/trunk/include/clang/AST/Decl.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=361300=361299=361300=diff
==
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Tue May 21 13:10:50 2019
@@ -1395,6 +1395,10 @@ public:
 NonParmVarDeclBits.IsInitCapture = IC;
   }
 
+  /// Determine whether this variable is actually a function parameter pack or
+  /// init-capture pack.
+  bool isParameterPack() const;
+
   /// Whether this local extern variable declaration's previous declaration
   /// was declared in the same block scope. Only correct in C++.
   bool isPreviousDeclInSameBlockScope() const {
@@ -1688,10 +1692,6 @@ public:
 
   QualType getOriginalType() const;
 
-  /// Determine whether this parameter is actually a function
-  /// parameter pack.
-  bool isParameterPack() const;
-
   /// Sets the function declaration that owns this
   /// ParmVarDecl. Since ParmVarDecls are often created before the
   /// FunctionDecls that own them, this routine is required to update

Modified: cfe/trunk/include/clang/AST/ExprCXX.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=361300=361299=361300=diff
==
--- cfe/trunk/include/clang/AST/ExprCXX.h (original)
+++ cfe/trunk/include/clang/AST/ExprCXX.h Tue May 21 13:10:50 2019
@@ -4233,8 +4233,8 @@ public:
   }
 };
 
-/// Represents a reference to a function parameter pack that has been
-/// substituted but not yet expanded.
+/// Represents a reference to a function parameter pack or init-capture pack
+/// that has been substituted but not yet expanded.
 ///
 /// When a pack expansion contains multiple parameter packs at different 
levels,
 /// this node is used to represent a function parameter pack at an outer level
@@ -4249,13 +4249,13 @@ public:
 /// \endcode
 class FunctionParmPackExpr final
 : public Expr,
-  private llvm::TrailingObjects {
+  private llvm::TrailingObjects {
   friend class ASTReader;
   friend class ASTStmtReader;
   friend TrailingObjects;
 
   /// The function parameter pack which was referenced.
-  ParmVarDecl *ParamPack;
+  VarDecl *ParamPack;
 
   /// The location of the 

[PATCH] D57930: [Driver] Verify GCCInstallation is valid

2019-05-21 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment.

@danielmentz thanks for this patch! Some teammates are running into issues that 
would be fixed by this patch.

I think @srhines is asking for a test similar to what I wrote in r344941 
(https://github.com/llvm/llvm-project/commit/11dadac247e677de124328077d080fe086f14d47#diff-281bd5e7ab7578a5203aff1d1d001bdd),
 and shouldn't be too much work (basically test that 
`--gcc-toolchain=` fails in an explicit way.

Would you mind adding such a test, so we can ship this useful fix?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D57930



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


[PATCH] D62202: Work around a Visual C++ bug

2019-05-21 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a comment.

In D62202#1510835 , @rnk wrote:

> In D62202#1510522 , @dblaikie wrote:
>
> > Yeah, if we're going this way I'd certainly advocate having a comment of 
> > some kind explaining why it's this way so it doesn't regress.
>
>
> In the past, I've found these sorts of comments to be pretty low value. They 
> don't do anything to help the reader understand what the code is trying to 
> do. If we want this thing to not regress, someone who cares can set up a 
> buildbot for it. I think it's more likely that by the time somebody does this 
> again, Paul and other users of Visual C++ will have upgraded to 14.8. Or, 
> they'll send another one of these changes.


Then a comment might help explain that the workaround can be removed at that 
point.


Repository:
  rC Clang

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

https://reviews.llvm.org/D62202



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


[PATCH] D62215: Fixes to distribution example for X86_64 Arch Linux

2019-05-21 Thread Wink Saville via Phabricator via cfe-commits
winksaville added a comment.

This may not "correct" but I had to do these to get `ninja stage2-distribution` 
to complete on my computer.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62215



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


[PATCH] D62200: [Driver][Windows] Add dependent lib argument for -fprofile-generate and -fcs-profile-generate

2019-05-21 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision.
rnk 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/D62200/new/

https://reviews.llvm.org/D62200



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


[PATCH] D62202: Work around a Visual C++ bug

2019-05-21 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment.

In D62202#1510522 , @dblaikie wrote:

> Yeah, if we're going this way I'd certainly advocate having a comment of some 
> kind explaining why it's this way so it doesn't regress.


In the past, I've found these sorts of comments to be pretty low value. They 
don't do anything to help the reader understand what the code is trying to do. 
If we want this thing to not regress, someone who cares can set up a buildbot 
for it. I think it's more likely that by the time somebody does this again, 
Paul and other users of Visual C++ will have upgraded to 14.8. Or, they'll send 
another one of these changes.


Repository:
  rC Clang

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

https://reviews.llvm.org/D62202



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


[PATCH] D62202: Work around a Visual C++ bug

2019-05-21 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment.

I'd go ahead and commit the workaround, even if it goes against the style 
guide. This problem will go away in two years or so.


Repository:
  rC Clang

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

https://reviews.llvm.org/D62202



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


[PATCH] D61707: [Preprocessor] Fix crash emitting note with framework location for "file not found" error.

2019-05-21 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added a comment.

Ping.


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

https://reviews.llvm.org/D61707



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


[PATCH] D61643: [PragmaHandler] Expose `#pragma` location

2019-05-21 Thread Michael Kruse via Phabricator via cfe-commits
Meinersbur added a comment.

+1

Such a solution also came up in https://bugs.llvm.org/show_bug.cgi?id=41514#c1


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61643



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


[PATCH] D62215: Fixes to distribution example for X86_64 Arch Linux

2019-05-21 Thread Wink Saville via Phabricator via cfe-commits
winksaville created this revision.
winksaville added a reviewer: beanz.
Herald added subscribers: llvm-commits, cfe-commits, mgorny.
Herald added projects: clang, LLVM.

Add runtime libcxxabi, use gold linker and create LLVMgold.so.

Tested with on monorepo with:

mkdir build && cd build && \
 cmake ../llvm -G Ninja \

  -C ../clang/cmake/caches/DistributionExample.cmake \
  -DCMAKE_INSTALL_PREFIX=local-opt \
  && \

ninja stage2-distribution && \
 cd tools/clang/stage2-bins && \
 ninja check-all && \
 ninja install-distribution


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D62215

Files:
  clang/cmake/caches/DistributionExample-stage2.cmake
  clang/cmake/caches/DistributionExample.cmake
  llvm/tools/gold/CMakeLists.txt


Index: llvm/tools/gold/CMakeLists.txt
===
--- llvm/tools/gold/CMakeLists.txt
+++ llvm/tools/gold/CMakeLists.txt
@@ -13,6 +13,7 @@
 
   add_llvm_library(LLVMgold MODULE
 gold-plugin.cpp
+PLUGIN_TOOL LLVM
 )
 
 endif()
Index: clang/cmake/caches/DistributionExample.cmake
===
--- clang/cmake/caches/DistributionExample.cmake
+++ clang/cmake/caches/DistributionExample.cmake
@@ -2,7 +2,7 @@
 
 #Enable LLVM projects and runtimes
 set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld" CACHE STRING "")
-set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx" CACHE STRING "")
+set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi" CACHE STRING "")
 
 # Only build the native target in stage1 since it is a throwaway build.
 set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "")
@@ -33,6 +33,9 @@
 
 # Setup the bootstrap build.
 set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
+set(LLVM_USE_LINKER "gold" CACHE STRING "")
+set(LLVM_BINUTILS_INCDIR "/usr/include" CACHE PATH "")
+set(LLVM_EXPORT_SYMBOLS_FOR_PLUGINS ON CACHE BOOL "")
 
 if(STAGE2_CACHE_FILE)
   set(CLANG_BOOTSTRAP_CMAKE_ARGS
Index: clang/cmake/caches/DistributionExample-stage2.cmake
===
--- clang/cmake/caches/DistributionExample-stage2.cmake
+++ clang/cmake/caches/DistributionExample-stage2.cmake
@@ -2,7 +2,9 @@
 # bootstrap build.
 
 set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld" CACHE STRING "")
-set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx" CACHE STRING "")
+set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi" CACHE STRING "")
+
+set(LLVM_USE_LINKER "gold" CACHE STRING "")
 
 set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64 CACHE STRING "")
 


Index: llvm/tools/gold/CMakeLists.txt
===
--- llvm/tools/gold/CMakeLists.txt
+++ llvm/tools/gold/CMakeLists.txt
@@ -13,6 +13,7 @@
 
   add_llvm_library(LLVMgold MODULE
 gold-plugin.cpp
+PLUGIN_TOOL LLVM
 )
 
 endif()
Index: clang/cmake/caches/DistributionExample.cmake
===
--- clang/cmake/caches/DistributionExample.cmake
+++ clang/cmake/caches/DistributionExample.cmake
@@ -2,7 +2,7 @@
 
 #Enable LLVM projects and runtimes
 set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld" CACHE STRING "")
-set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx" CACHE STRING "")
+set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi" CACHE STRING "")
 
 # Only build the native target in stage1 since it is a throwaway build.
 set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "")
@@ -33,6 +33,9 @@
 
 # Setup the bootstrap build.
 set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
+set(LLVM_USE_LINKER "gold" CACHE STRING "")
+set(LLVM_BINUTILS_INCDIR "/usr/include" CACHE PATH "")
+set(LLVM_EXPORT_SYMBOLS_FOR_PLUGINS ON CACHE BOOL "")
 
 if(STAGE2_CACHE_FILE)
   set(CLANG_BOOTSTRAP_CMAKE_ARGS
Index: clang/cmake/caches/DistributionExample-stage2.cmake
===
--- clang/cmake/caches/DistributionExample-stage2.cmake
+++ clang/cmake/caches/DistributionExample-stage2.cmake
@@ -2,7 +2,9 @@
 # bootstrap build.
 
 set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld" CACHE STRING "")
-set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx" CACHE STRING "")
+set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi" CACHE STRING "")
+
+set(LLVM_USE_LINKER "gold" CACHE STRING "")
 
 set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64 CACHE STRING "")
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D60568: [OpenMP] Add support for registering requires directives with the runtime

2019-05-21 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL361298: [OpenMP] Add support for registering requires 
directives with the runtime (authored by gbercea, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

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

https://reviews.llvm.org/D60568

Files:
  cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
  cfe/trunk/lib/CodeGen/CGOpenMPRuntime.h
  cfe/trunk/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
  cfe/trunk/lib/CodeGen/CGOpenMPRuntimeNVPTX.h
  cfe/trunk/lib/CodeGen/CodeGenModule.cpp
  cfe/trunk/test/OpenMP/openmp_offload_registration.cpp
  cfe/trunk/test/OpenMP/target_codegen.cpp
  cfe/trunk/test/OpenMP/target_codegen_registration.cpp
  cfe/trunk/test/OpenMP/target_depend_codegen.cpp
  cfe/trunk/test/OpenMP/target_parallel_codegen.cpp
  cfe/trunk/test/OpenMP/target_parallel_codegen_registration.cpp
  cfe/trunk/test/OpenMP/target_parallel_depend_codegen.cpp
  cfe/trunk/test/OpenMP/target_parallel_for_codegen.cpp
  cfe/trunk/test/OpenMP/target_parallel_for_codegen_registration.cpp
  cfe/trunk/test/OpenMP/target_parallel_for_depend_codegen.cpp
  cfe/trunk/test/OpenMP/target_parallel_for_simd_codegen.cpp
  cfe/trunk/test/OpenMP/target_parallel_for_simd_codegen_registration.cpp
  cfe/trunk/test/OpenMP/target_parallel_for_simd_depend_codegen.cpp
  cfe/trunk/test/OpenMP/target_parallel_if_codegen.cpp
  cfe/trunk/test/OpenMP/target_parallel_num_threads_codegen.cpp
  cfe/trunk/test/OpenMP/target_simd_codegen.cpp
  cfe/trunk/test/OpenMP/target_simd_codegen_registration.cpp
  cfe/trunk/test/OpenMP/target_simd_depend_codegen.cpp
  cfe/trunk/test/OpenMP/target_teams_codegen.cpp
  cfe/trunk/test/OpenMP/target_teams_codegen_registration.cpp
  cfe/trunk/test/OpenMP/target_teams_depend_codegen.cpp
  cfe/trunk/test/OpenMP/target_teams_distribute_codegen.cpp
  cfe/trunk/test/OpenMP/target_teams_distribute_codegen_registration.cpp
  cfe/trunk/test/OpenMP/target_teams_distribute_depend_codegen.cpp
  cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp
  
cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen_registration.cpp
  
cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp
  cfe/trunk/test/OpenMP/target_teams_distribute_simd_codegen.cpp
  cfe/trunk/test/OpenMP/target_teams_distribute_simd_codegen_registration.cpp
  cfe/trunk/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp
  cfe/trunk/test/OpenMP/target_teams_num_teams_codegen.cpp
  cfe/trunk/test/OpenMP/target_teams_thread_limit_codegen.cpp

Index: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
===
--- cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
+++ cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -457,6 +457,26 @@
   LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/OMP_IDENT_WORK_DISTRIBUTE)
 };
 
+namespace {
+LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
+/// Values for bit flags for marking which requires clauses have been used.
+enum OpenMPOffloadingRequiresDirFlags : int64_t {
+  /// flag undefined.
+  OMP_REQ_UNDEFINED   = 0x000,
+  /// no requires clause present.
+  OMP_REQ_NONE= 0x001,
+  /// reverse_offload clause.
+  OMP_REQ_REVERSE_OFFLOAD = 0x002,
+  /// unified_address clause.
+  OMP_REQ_UNIFIED_ADDRESS = 0x004,
+  /// unified_shared_memory clause.
+  OMP_REQ_UNIFIED_SHARED_MEMORY   = 0x008,
+  /// dynamic_allocators clause.
+  OMP_REQ_DYNAMIC_ALLOCATORS  = 0x010,
+  LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/OMP_REQ_DYNAMIC_ALLOCATORS)
+};
+} // anonymous namespace
+
 /// Describes ident structure that describes a source location.
 /// All descriptions are taken from
 /// https://github.com/llvm/llvm-project/blob/master/openmp/runtime/src/kmp.h
@@ -694,6 +714,8 @@
   // *host_ptr, int32_t arg_num, void** args_base, void **args, size_t
   // *arg_sizes, int64_t *arg_types, int32_t num_teams, int32_t thread_limit);
   OMPRTL__tgt_target_teams_nowait,
+  // Call to void __tgt_register_requires(int64_t flags);
+  OMPRTL__tgt_register_requires,
   // Call to void __tgt_register_lib(__tgt_bin_desc *desc);
   OMPRTL__tgt_register_lib,
   // Call to void __tgt_unregister_lib(__tgt_bin_desc *desc);
@@ -2296,6 +2318,14 @@
 RTLFn = CGM.CreateRuntimeFunction(FnTy, "__tgt_target_teams_nowait");
 break;
   }
+  case OMPRTL__tgt_register_requires: {
+// Build void __tgt_register_requires(int64_t flags);
+llvm::Type *TypeParams[] = {CGM.Int64Ty};
+auto *FnTy =
+llvm::FunctionType::get(CGM.VoidTy, TypeParams, /*isVarArg*/ false);
+RTLFn = CGM.CreateRuntimeFunction(FnTy, "__tgt_register_requires");
+break;
+  }
   case OMPRTL__tgt_register_lib: {
 // Build void __tgt_register_lib(__tgt_bin_desc *desc);
 QualType ParamTy =
@@ -6405,6 +6435,7 @@
 llvm::Function *, llvm::Constant *,
 bool 

r361298 - [OpenMP] Add support for registering requires directives with the runtime

2019-05-21 Thread Gheorghe-Teodor Bercea via cfe-commits
Author: gbercea
Date: Tue May 21 12:42:01 2019
New Revision: 361298

URL: http://llvm.org/viewvc/llvm-project?rev=361298=rev
Log:
[OpenMP] Add support for registering requires directives with the runtime

Summary:
This patch adds support for the registration of the requires directives with 
the runtime.

Each requires directive clause will enable a particular flag to be set.

The set of flags is passed to the runtime to be checked for compatibility with 
other such flags coming from other object files.

The registration function is called whenever OpenMP is present even if a 
requires directive is not present. This helps detect cases in which requires 
directives are used inconsistently.

Reviewers: ABataev, AlexEichenberger, caomhin

Reviewed By: ABataev, AlexEichenberger

Subscribers: jholewinski, guansong, jfb, jdoerfert, cfe-commits

Tags: #clang

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

Modified:
cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
cfe/trunk/lib/CodeGen/CGOpenMPRuntime.h
cfe/trunk/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
cfe/trunk/lib/CodeGen/CGOpenMPRuntimeNVPTX.h
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/test/OpenMP/openmp_offload_registration.cpp
cfe/trunk/test/OpenMP/target_codegen.cpp
cfe/trunk/test/OpenMP/target_codegen_registration.cpp
cfe/trunk/test/OpenMP/target_depend_codegen.cpp
cfe/trunk/test/OpenMP/target_parallel_codegen.cpp
cfe/trunk/test/OpenMP/target_parallel_codegen_registration.cpp
cfe/trunk/test/OpenMP/target_parallel_depend_codegen.cpp
cfe/trunk/test/OpenMP/target_parallel_for_codegen.cpp
cfe/trunk/test/OpenMP/target_parallel_for_codegen_registration.cpp
cfe/trunk/test/OpenMP/target_parallel_for_depend_codegen.cpp
cfe/trunk/test/OpenMP/target_parallel_for_simd_codegen.cpp
cfe/trunk/test/OpenMP/target_parallel_for_simd_codegen_registration.cpp
cfe/trunk/test/OpenMP/target_parallel_for_simd_depend_codegen.cpp
cfe/trunk/test/OpenMP/target_parallel_if_codegen.cpp
cfe/trunk/test/OpenMP/target_parallel_num_threads_codegen.cpp
cfe/trunk/test/OpenMP/target_simd_codegen.cpp
cfe/trunk/test/OpenMP/target_simd_codegen_registration.cpp
cfe/trunk/test/OpenMP/target_simd_depend_codegen.cpp
cfe/trunk/test/OpenMP/target_teams_codegen.cpp
cfe/trunk/test/OpenMP/target_teams_codegen_registration.cpp
cfe/trunk/test/OpenMP/target_teams_depend_codegen.cpp
cfe/trunk/test/OpenMP/target_teams_distribute_codegen.cpp
cfe/trunk/test/OpenMP/target_teams_distribute_codegen_registration.cpp
cfe/trunk/test/OpenMP/target_teams_distribute_depend_codegen.cpp

cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp

cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen_registration.cpp

cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp
cfe/trunk/test/OpenMP/target_teams_distribute_simd_codegen.cpp
cfe/trunk/test/OpenMP/target_teams_distribute_simd_codegen_registration.cpp
cfe/trunk/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp
cfe/trunk/test/OpenMP/target_teams_num_teams_codegen.cpp
cfe/trunk/test/OpenMP/target_teams_thread_limit_codegen.cpp

Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp?rev=361298=361297=361298=diff
==
--- cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp Tue May 21 12:42:01 2019
@@ -457,6 +457,26 @@ enum OpenMPLocationFlags : unsigned {
   LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/OMP_IDENT_WORK_DISTRIBUTE)
 };
 
+namespace {
+LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
+/// Values for bit flags for marking which requires clauses have been used.
+enum OpenMPOffloadingRequiresDirFlags : int64_t {
+  /// flag undefined.
+  OMP_REQ_UNDEFINED   = 0x000,
+  /// no requires clause present.
+  OMP_REQ_NONE= 0x001,
+  /// reverse_offload clause.
+  OMP_REQ_REVERSE_OFFLOAD = 0x002,
+  /// unified_address clause.
+  OMP_REQ_UNIFIED_ADDRESS = 0x004,
+  /// unified_shared_memory clause.
+  OMP_REQ_UNIFIED_SHARED_MEMORY   = 0x008,
+  /// dynamic_allocators clause.
+  OMP_REQ_DYNAMIC_ALLOCATORS  = 0x010,
+  LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/OMP_REQ_DYNAMIC_ALLOCATORS)
+};
+} // anonymous namespace
+
 /// Describes ident structure that describes a source location.
 /// All descriptions are taken from
 /// https://github.com/llvm/llvm-project/blob/master/openmp/runtime/src/kmp.h
@@ -694,6 +714,8 @@ enum OpenMPRTLFunction {
   // *host_ptr, int32_t arg_num, void** args_base, void **args, size_t
   // *arg_sizes, int64_t *arg_types, int32_t num_teams, int32_t thread_limit);
   OMPRTL__tgt_target_teams_nowait,
+  // Call to void __tgt_register_requires(int64_t flags);
+  

[PATCH] D60283: [DebugInfo] Don't emit checksums when compiling a preprocessed CPP

2019-05-21 Thread Alexandre Ganea via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rC361296: [DebugInfo] Dont emit checksums when compiling 
a preprocessed CPP (authored by aganea, committed by ).

Repository:
  rC Clang

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

https://reviews.llvm.org/D60283

Files:
  include/clang/Basic/SourceLocation.h
  lib/Basic/SourceManager.cpp
  lib/CodeGen/CGDebugInfo.cpp
  test/CodeGen/Inputs/debug-info-file-checksum-line.cpp
  test/CodeGen/Inputs/debug-info-file-checksum-pre.cpp
  test/CodeGen/debug-info-file-checksum.c

Index: include/clang/Basic/SourceLocation.h
===
--- include/clang/Basic/SourceLocation.h
+++ include/clang/Basic/SourceLocation.h
@@ -282,13 +282,15 @@
 /// You can get a PresumedLoc from a SourceLocation with SourceManager.
 class PresumedLoc {
   const char *Filename = nullptr;
+  FileID ID;
   unsigned Line, Col;
   SourceLocation IncludeLoc;
 
 public:
   PresumedLoc() = default;
-  PresumedLoc(const char *FN, unsigned Ln, unsigned Co, SourceLocation IL)
-  : Filename(FN), Line(Ln), Col(Co), IncludeLoc(IL) {}
+  PresumedLoc(const char *FN, FileID FID, unsigned Ln, unsigned Co,
+  SourceLocation IL)
+  : Filename(FN), ID(FID), Line(Ln), Col(Co), IncludeLoc(IL) {}
 
   /// Return true if this object is invalid or uninitialized.
   ///
@@ -305,6 +307,11 @@
 return Filename;
   }
 
+  FileID getFileID() const {
+assert(isValid());
+return ID;
+  }
+
   /// Return the presumed line number of this location.
   ///
   /// This can be affected by \#line etc.
Index: test/CodeGen/debug-info-file-checksum.c
===
--- test/CodeGen/debug-info-file-checksum.c
+++ test/CodeGen/debug-info-file-checksum.c
@@ -4,3 +4,15 @@
 // Check that "checksum" is created correctly for the compiled file.
 
 // CHECK: !DIFile(filename:{{.*}}, directory:{{.*}}, checksumkind: CSK_MD5, checksum: "a3b7d27af071accdeccaa933fc603608")
+
+// Ensure #line directives (in already pre-processed files) do not emit checksums
+// RUN: %clang -emit-llvm -S -g -gcodeview -x c %S/Inputs/debug-info-file-checksum-pre.cpp -o - | FileCheck %s --check-prefix NOCHECKSUM
+
+// NOCHECKSUM: !DIFile(filename: "{{.*}}code-coverage-filter1.h", directory: "{{[^"]*}}")
+// NOCHECKSUM: !DIFile(filename: "{{.*}}code-coverage-filter2.h", directory: "{{[^"]*}}")
+// NOCHECKSUM: !DIFile(filename: "{{.*}}debug-info-file-checksum.c", directory: "{{[^"]*}}")
+
+// Ensure #line directives without name do emit checksums
+// RUN: %clang -emit-llvm -S -g -gcodeview -x c %S/Inputs/debug-info-file-checksum-line.cpp -o - | FileCheck %s --check-prefix CHECKSUM
+
+// CHECKSUM: !DIFile(filename: "{{.*}}debug-info-file-checksum-line.cpp", directory:{{.*}}, checksumkind: CSK_MD5, checksum: "7b568574d0e3c56c28e5e0234d1f4a06")
Index: test/CodeGen/Inputs/debug-info-file-checksum-line.cpp
===
--- test/CodeGen/Inputs/debug-info-file-checksum-line.cpp
+++ test/CodeGen/Inputs/debug-info-file-checksum-line.cpp
@@ -0,0 +1,9 @@
+int foo(int x) {
+  return x+1;
+}
+
+#line 100
+void test1() {}
+
+#line 200
+void test2() {}
Index: test/CodeGen/Inputs/debug-info-file-checksum-pre.cpp
===
--- test/CodeGen/Inputs/debug-info-file-checksum-pre.cpp
+++ test/CodeGen/Inputs/debug-info-file-checksum-pre.cpp
@@ -0,0 +1,10 @@
+#line 1 "F:\\svn\\clang\\test\\CodeGen\\Inputs\\debug-info-file-checksum.c"
+#line 1 "f:\\svn\\clang\\test\\codegen\\inputs\\code-coverage-filter1.h"
+void test1() {}
+#line 2 "F:\\svn\\clang\\test\\CodeGen\\Inputs\\debug-info-file-checksum.c"
+#line 1 "f:\\svn\\clang\\test\\codegen\\inputs\\code-coverage-filter2.h"
+void test2() {}
+#line 3 "F:\\svn\\clang\\test\\CodeGen\\Inputs\\debug-info-file-checksum.c"
+int foo(int x) {
+  return x+1;
+}
Index: lib/Basic/SourceManager.cpp
===
--- lib/Basic/SourceManager.cpp
+++ lib/Basic/SourceManager.cpp
@@ -1430,6 +1430,7 @@
   // To get the source name, first consult the FileEntry (if one exists)
   // before the MemBuffer as this will avoid unnecessarily paging in the
   // MemBuffer.
+  FileID FID = LocInfo.first;
   StringRef Filename;
   if (C->OrigEntry)
 Filename = C->OrigEntry->getName();
@@ -1453,8 +1454,12 @@
 if (const LineEntry *Entry =
   LineTable->FindNearestLineEntry(LocInfo.first, LocInfo.second)) {
   // If the LineEntry indicates a filename, use it.
-  if (Entry->FilenameID != -1)
+  if (Entry->FilenameID != -1) {
 Filename = LineTable->getFilename(Entry->FilenameID);
+// The contents of files referenced by #line are not in the
+// SourceManager
+FID = FileID::get(0);
+  }
 
   // Use the line number specified by the LineEntry.  This 

r361296 - [DebugInfo] Don't emit checksums when compiling a preprocessed CPP

2019-05-21 Thread Alexandre Ganea via cfe-commits
Author: aganea
Date: Tue May 21 12:40:28 2019
New Revision: 361296

URL: http://llvm.org/viewvc/llvm-project?rev=361296=rev
Log:
[DebugInfo] Don't emit checksums when compiling a preprocessed CPP

Fixes PR41215

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

Added:
cfe/trunk/test/CodeGen/Inputs/debug-info-file-checksum-line.cpp
cfe/trunk/test/CodeGen/Inputs/debug-info-file-checksum-pre.cpp
Modified:
cfe/trunk/include/clang/Basic/SourceLocation.h
cfe/trunk/lib/Basic/SourceManager.cpp
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/test/CodeGen/debug-info-file-checksum.c

Modified: cfe/trunk/include/clang/Basic/SourceLocation.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceLocation.h?rev=361296=361295=361296=diff
==
--- cfe/trunk/include/clang/Basic/SourceLocation.h (original)
+++ cfe/trunk/include/clang/Basic/SourceLocation.h Tue May 21 12:40:28 2019
@@ -282,13 +282,15 @@ public:
 /// You can get a PresumedLoc from a SourceLocation with SourceManager.
 class PresumedLoc {
   const char *Filename = nullptr;
+  FileID ID;
   unsigned Line, Col;
   SourceLocation IncludeLoc;
 
 public:
   PresumedLoc() = default;
-  PresumedLoc(const char *FN, unsigned Ln, unsigned Co, SourceLocation IL)
-  : Filename(FN), Line(Ln), Col(Co), IncludeLoc(IL) {}
+  PresumedLoc(const char *FN, FileID FID, unsigned Ln, unsigned Co,
+  SourceLocation IL)
+  : Filename(FN), ID(FID), Line(Ln), Col(Co), IncludeLoc(IL) {}
 
   /// Return true if this object is invalid or uninitialized.
   ///
@@ -305,6 +307,11 @@ public:
 return Filename;
   }
 
+  FileID getFileID() const {
+assert(isValid());
+return ID;
+  }
+
   /// Return the presumed line number of this location.
   ///
   /// This can be affected by \#line etc.

Modified: cfe/trunk/lib/Basic/SourceManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=361296=361295=361296=diff
==
--- cfe/trunk/lib/Basic/SourceManager.cpp (original)
+++ cfe/trunk/lib/Basic/SourceManager.cpp Tue May 21 12:40:28 2019
@@ -1430,6 +1430,7 @@ PresumedLoc SourceManager::getPresumedLo
   // To get the source name, first consult the FileEntry (if one exists)
   // before the MemBuffer as this will avoid unnecessarily paging in the
   // MemBuffer.
+  FileID FID = LocInfo.first;
   StringRef Filename;
   if (C->OrigEntry)
 Filename = C->OrigEntry->getName();
@@ -1453,8 +1454,12 @@ PresumedLoc SourceManager::getPresumedLo
 if (const LineEntry *Entry =
   LineTable->FindNearestLineEntry(LocInfo.first, LocInfo.second)) {
   // If the LineEntry indicates a filename, use it.
-  if (Entry->FilenameID != -1)
+  if (Entry->FilenameID != -1) {
 Filename = LineTable->getFilename(Entry->FilenameID);
+// The contents of files referenced by #line are not in the
+// SourceManager
+FID = FileID::get(0);
+  }
 
   // Use the line number specified by the LineEntry.  This line number may
   // be multiple lines down from the line entry.  Add the difference in
@@ -1473,7 +1478,7 @@ PresumedLoc SourceManager::getPresumedLo
 }
   }
 
-  return PresumedLoc(Filename.data(), LineNo, ColNo, IncludeLoc);
+  return PresumedLoc(Filename.data(), FID, LineNo, ColNo, IncludeLoc);
 }
 
 /// Returns whether the PresumedLoc for a given SourceLocation is

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=361296=361295=361296=diff
==
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Tue May 21 12:40:28 2019
@@ -422,8 +422,12 @@ llvm::DIFile *CGDebugInfo::getOrCreateFi
   }
 
   SmallString<32> Checksum;
+
+  // Compute the checksum if possible. If the location is affected by a #line
+  // directive that refers to a file, PLoc will have an invalid FileID, and we
+  // will correctly get no checksum.
   Optional CSKind =
-  computeChecksum(SM.getFileID(Loc), Checksum);
+  computeChecksum(PLoc.getFileID(), Checksum);
   Optional> CSInfo;
   if (CSKind)
 CSInfo.emplace(*CSKind, Checksum);

Added: cfe/trunk/test/CodeGen/Inputs/debug-info-file-checksum-line.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/Inputs/debug-info-file-checksum-line.cpp?rev=361296=auto
==
--- cfe/trunk/test/CodeGen/Inputs/debug-info-file-checksum-line.cpp (added)
+++ cfe/trunk/test/CodeGen/Inputs/debug-info-file-checksum-line.cpp Tue May 21 
12:40:28 2019
@@ -0,0 +1,9 @@
+int foo(int x) {
+  return x+1;
+}
+
+#line 100
+void test1() {}
+
+#line 200
+void test2() {}

Added: 

[PATCH] D38479: Make -mgeneral-regs-only more like GCC's

2019-05-21 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added inline comments.



Comment at: clang/lib/Sema/SemaExprCXX.cpp:7951
+  // they don't have to write out memcpy() for simple cases. For that reason,
+  // it's very limited in what it will detect.
+  //

We don't always lower struct copies to memcpy(); I'm not sure this is safe.



Comment at: clang/lib/Sema/SemaExprCXX.cpp:8003
+!isRValueOfIllegalType(E) &&
+E->isConstantInitializer(S.getASTContext(), /*ForRef=*/false)) {
+  resetDiagnosticState(InitialState);

Just because we can constant-fold an expression, doesn't mean we will, 
especially at -O0.


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

https://reviews.llvm.org/D38479



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


[PATCH] D38479: Make -mgeneral-regs-only more like GCC's

2019-05-21 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment.

We don't necessarily need to block the clang changes on the backend error 
reporting actually being implemented, I guess, if the architecture we want is 
settled.

With this patch, do we pass the general-regs-only attribute to the backend?  If 
so, would that be the attribute we'd want to check to emit errors from the 
backend from any "accidental" floating-point operations?




Comment at: clang/lib/Sema/SemaExprCXX.cpp:7840
+
+  const auto *StructTy = Ty.getCanonicalType()->getAsStructureType();
+  if (!StructTy)

Do you really want to enforce isStruct() here?  That's types declared with the 
keyword "struct".



Comment at: clang/lib/Sema/SemaExprCXX.cpp:7857
+
+  return llvm::any_of(StructTy->getDecl()->fields(), [](const FieldDecl *FD) {
+return typeHasFloatingOrVectorComponent(FD->getType());

Do we have to be concerned about base classes here?


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

https://reviews.llvm.org/D38479



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


[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-21 Thread Ethan Sommer via Phabricator via cfe-commits
E5ten added a comment.

@beanz Wouldn't fixing this by adding OR BUILD_SHARED_LIBS to if(ARG_SHARED) in 
AddClang.cmake and to if (NOT LLVM_ENABLE_PIC) in clang-shlib/CMakeLists.txt to 
prevent making libclang_shared when BUILD_SHARED_LIBS is enabled make more 
sense?


Repository:
  rC Clang

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

https://reviews.llvm.org/D61909



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


[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment.

In D61386#1510690 , @MyDeveloperDay 
wrote:

> Just a passing comment, Is this:
>
> a) a different type of check that would be used for a different type of check 
> than previous clang-tidy checks
>  b) or is this a replacement on the previous style?


This is a replacement for a certain class of checks. Mostly for simple tests 
that are primarily pattern + reconstruction, without complex logic (at least 
for now).  The long-term goal is to provide a concise alternative for the large 
majority of checks.

> Is there any documentation about the benefits of this method vs the old 
> method? or of why we would potentially use one and not the other?

There's a doc describing the framework here
https://docs.google.com/document/d/1ppw0RhjwsrbBcHYhI85pe6ISDbA6r5d00ot3N8cQWeQ/edit?usp=sharing
and some corresponding discussion on the cfe-dev mailing list (and in the doc 
comments).

> Is there a change needed to add_new_check.py to have it generate this new 
> style? (its ok if the answer is yes in a future revision)
> 
> Do you foresee people using this mechanism going forward?

Not yet, but once it is more mature, yes. I would hope that it will be the more 
common approach. At that point, we can adjust the scripts accordingly.

> I do like the brevity of it and I do like the GTEST unit tests, (I struggled 
> more with the lit tests than anything else, mainly for python on cygwin 
> reasons)
> 
> It looks good, even if it looks like I need to go learn how tooling::stencil 
> works... a little bit of documentation might not go a miss on how to get 
> started with it...

Thanks.  Yes, it very much requires that you familiarize yourself with Stencil 
and RewriteRule (Tooling/Refactoring/Stencil.h and Transformer.h).  I'm not 
sure what more to add that is specific to clang tidy. The intent is that, if 
your check can be expressed as a `RewriteRule` then there's really nothing you 
need to know about clang-tidy beyond what's in the header file -- you just drop 
the rule into TransformerClangTidyCheck.  If you have questions after you see 
the Tooling documentation, please let me know and I'm happy to expand the 
comments here.  Both Stencil and Transformer are quite and still under active 
development. Once they've stabilized a bit, I also plan to send out a more 
general announcement about this to the cfe-dev list.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61386



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


[PATCH] D62152: [ARM][AArch64] Fix incorrect handling of alignment in va_arg code generation

2019-05-21 Thread Eli Friedman via Phabricator via cfe-commits
efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.

Oh, I see, ABIInfo::computeInfo() uses the canonical type to compute the 
calling convention, and that throws away alignment attributes because alignment 
attributes on non-struct are broken that way.

In that case, LGTM.


Repository:
  rC Clang

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

https://reviews.llvm.org/D62152



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


[PATCH] D62049: [clang-tidy] Add a close-on-exec check on pipe2() in Android module.

2019-05-21 Thread Jian Cai via Phabricator via cfe-commits
jcai19 marked 2 inline comments as done.
jcai19 added inline comments.



Comment at: clang-tools-extra/test/clang-tidy/android-cloexec-pipe2.cpp:52
+
+void e() {
+  int pipefd[2];

srhines wrote:
> I'm not all that familiar with writing clang-tidy-specific tests, but should 
> these tests here denote that a diagnostic should NOT be issued? That is 
> usually the convention in regular Clang tests, so I assume the test runner 
> here should be equally supportive of ensuring that the contents passed 
> through without any other diagnostics related to pipe2 and/or O_CLOEXEC.
That makes sense, and I have seem tests for similar checks with (e.g. 
android-cloexec-open)  and without (e.g. android-cloexec-accep4 and 
android-cloexec-socket) additional CHECK-MESSAGES-NOT check. But based on the 
Testing Checks section of 
https://clang.llvm.org/extra/clang-tidy/Contributing.html, it seems typically 
CHECK-MASSAGES and CHECK-FIXES are sufficient for clang-tidy checks. Please let 
me know what you think.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62049



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


[PATCH] D62201: [LibTooling] Address post-commit feedback for r361152

2019-05-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rC361285: [LibTooling] Address post-commit feedback for 
r361152 (authored by ymandel, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D62201?vs=200514=200559#toc

Repository:
  rC Clang

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

https://reviews.llvm.org/D62201

Files:
  unittests/Tooling/CMakeLists.txt


Index: unittests/Tooling/CMakeLists.txt
===
--- unittests/Tooling/CMakeLists.txt
+++ unittests/Tooling/CMakeLists.txt
@@ -1,6 +1,7 @@
 set(LLVM_LINK_COMPONENTS
   ${LLVM_TARGETS_TO_BUILD}
   Support
+  TestingSupport
   )
 
 # By default MSVC has a 2^16 limit on the number of sections in an object file,
@@ -70,8 +71,6 @@
   clangToolingCore
   clangToolingInclusions
   clangToolingRefactor
-  LLVMSupport
-  LLVMTestingSupport
   )
 
 


Index: unittests/Tooling/CMakeLists.txt
===
--- unittests/Tooling/CMakeLists.txt
+++ unittests/Tooling/CMakeLists.txt
@@ -1,6 +1,7 @@
 set(LLVM_LINK_COMPONENTS
   ${LLVM_TARGETS_TO_BUILD}
   Support
+  TestingSupport
   )
 
 # By default MSVC has a 2^16 limit on the number of sections in an object file,
@@ -70,8 +71,6 @@
   clangToolingCore
   clangToolingInclusions
   clangToolingRefactor
-  LLVMSupport
-  LLVMTestingSupport
   )
 
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D62214: Remove extra if case.

2019-05-21 Thread Amy Huang via Phabricator via cfe-commits
akhuang created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D62214

Files:
  clang/lib/CodeGen/CGDebugInfo.cpp


Index: clang/lib/CodeGen/CGDebugInfo.cpp
===
--- clang/lib/CodeGen/CGDebugInfo.cpp
+++ clang/lib/CodeGen/CGDebugInfo.cpp
@@ -4348,16 +4348,14 @@
   llvm::DIFile *Unit = getOrCreateFile(VD->getLocation());
   StringRef Name = VD->getName();
   llvm::DIType *Ty = getOrCreateType(VD->getType(), Unit);
+
+  // Do not use global variables for enums.
   if (const auto *ECD = dyn_cast(VD)) {
 const auto *ED = cast(ECD->getDeclContext());
 assert(isa(ED->getTypeForDecl()) && "Enum without EnumType?");
-Ty = getOrCreateType(QualType(ED->getTypeForDecl(), 0), Unit);
-  }
-  // Do not use global variables for enums.
-  //
-  // FIXME: why not?
-  if (Ty->getTag() == llvm::dwarf::DW_TAG_enumeration_type)
 return;
+  }
+
   // Do not emit separate definitions for function local const/statics.
   if (isa(VD->getDeclContext()))
 return;


Index: clang/lib/CodeGen/CGDebugInfo.cpp
===
--- clang/lib/CodeGen/CGDebugInfo.cpp
+++ clang/lib/CodeGen/CGDebugInfo.cpp
@@ -4348,16 +4348,14 @@
   llvm::DIFile *Unit = getOrCreateFile(VD->getLocation());
   StringRef Name = VD->getName();
   llvm::DIType *Ty = getOrCreateType(VD->getType(), Unit);
+
+  // Do not use global variables for enums.
   if (const auto *ECD = dyn_cast(VD)) {
 const auto *ED = cast(ECD->getDeclContext());
 assert(isa(ED->getTypeForDecl()) && "Enum without EnumType?");
-Ty = getOrCreateType(QualType(ED->getTypeForDecl(), 0), Unit);
-  }
-  // Do not use global variables for enums.
-  //
-  // FIXME: why not?
-  if (Ty->getTag() == llvm::dwarf::DW_TAG_enumeration_type)
 return;
+  }
+
   // Do not emit separate definitions for function local const/statics.
   if (isa(VD->getDeclContext()))
 return;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r361285 - [LibTooling] Address post-commit feedback for r361152

2019-05-21 Thread Yitzhak Mandelbaum via cfe-commits
Author: ymandel
Date: Tue May 21 11:48:58 2019
New Revision: 361285

URL: http://llvm.org/viewvc/llvm-project?rev=361285=rev
Log:
[LibTooling] Address post-commit feedback for r361152

Fixes a redundant dependency and moves another to its proper place.

Reviewers: thakis

Subscribers: mgorny, cfe-commits

Tags: #clang

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

Modified:
cfe/trunk/unittests/Tooling/CMakeLists.txt

Modified: cfe/trunk/unittests/Tooling/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/CMakeLists.txt?rev=361285=361284=361285=diff
==
--- cfe/trunk/unittests/Tooling/CMakeLists.txt (original)
+++ cfe/trunk/unittests/Tooling/CMakeLists.txt Tue May 21 11:48:58 2019
@@ -1,6 +1,7 @@
 set(LLVM_LINK_COMPONENTS
   ${LLVM_TARGETS_TO_BUILD}
   Support
+  TestingSupport
   )
 
 # By default MSVC has a 2^16 limit on the number of sections in an object file,
@@ -70,8 +71,6 @@ target_link_libraries(ToolingTests
   clangToolingCore
   clangToolingInclusions
   clangToolingRefactor
-  LLVMSupport
-  LLVMTestingSupport
   )
 
 


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


[PATCH] D62201: [LibTooling] Adjust dependencies for unittests.

2019-05-21 Thread Nico Weber via Phabricator via cfe-commits
thakis accepted this revision.
thakis added a comment.
This revision is now accepted and ready to land.

Thanks! Maybe say "address post-commit feedback for r" in the description. 
(But as-is is fine too.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62201



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


[PATCH] D62202: Work around a Visual C++ bug

2019-05-21 Thread Paul Robinson via Phabricator via cfe-commits
probinson added a comment.

The helper is passed as a template parameter to a class ctor, and that 
instantiated class calls the helper from operator(), so I suppose maybe enough 
indirection through lambdas
but this seems kind of involved for getting my builds to work.


Repository:
  rC Clang

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

https://reviews.llvm.org/D62202



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


[PATCH] D62049: [clang-tidy] Add a close-on-exec check on pipe2() in Android module.

2019-05-21 Thread Stephen Hines via Phabricator via cfe-commits
srhines added inline comments.



Comment at: clang-tools-extra/test/clang-tidy/android-cloexec-pipe2.cpp:52
+
+void e() {
+  int pipefd[2];

I'm not all that familiar with writing clang-tidy-specific tests, but should 
these tests here denote that a diagnostic should NOT be issued? That is usually 
the convention in regular Clang tests, so I assume the test runner here should 
be equally supportive of ensuring that the contents passed through without any 
other diagnostics related to pipe2 and/or O_CLOEXEC.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62049



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


[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-21 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment.

Just a passing comment, Is this:

a) a different type of check that would be used for a different type of check 
than previous clang-tidy checks
b) or is this a replacement on the previous style?

Is there any documentation about the benefits of this method vs the old method? 
or of why we would potentially use one and not the other?

Is there a change needed to add_new_check.py to have it generate this new 
style? (its ok if the answer is yes in a future revision)

Do you foresee people using this mechanism going foward?

I do like the brevity of it and I do like the GTEST unit tests, (I struggled 
more with the lit tests than anything else, mainly for python on cygwin reasons)

It looks good, even if it looks like I need to go learn how tooling::stencil 
works... a little bit of documentation might not go a miss on how to get 
started with it...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61386



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


r361283 - [OPENMP]Use the attributes for dso locality when building for device.

2019-05-21 Thread Alexey Bataev via cfe-commits
Author: abataev
Date: Tue May 21 11:20:08 2019
New Revision: 361283

URL: http://llvm.org/viewvc/llvm-project?rev=361283=rev
Log:
[OPENMP]Use the attributes for dso locality when building for device.

Currently, we ignore all dso locality attributes/info when building for
the device and thus all symblos are externally visible and can be
preemted at the runtime. It may lead to incorrect results. We need to
follow the same logic, compiler uses for static/pie builds.

Modified:
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/test/OpenMP/declare_target_codegen.cpp
cfe/trunk/test/OpenMP/nvptx_allocate_codegen.cpp
cfe/trunk/test/OpenMP/nvptx_declare_target_var_ctor_dtor_codegen.cpp
cfe/trunk/test/OpenMP/nvptx_target_codegen.cpp
cfe/trunk/test/OpenMP/nvptx_unsupported_type_codegen.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=361283=361282=361283=diff
==
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue May 21 11:20:08 2019
@@ -798,7 +798,7 @@ static bool shouldAssumeDSOLocal(const C
   const auto  = CGM.getCodeGenOpts();
   llvm::Reloc::Model RM = CGOpts.RelocationModel;
   const auto  = CGM.getLangOpts();
-  if (RM != llvm::Reloc::Static && !LOpts.PIE)
+  if (RM != llvm::Reloc::Static && !LOpts.PIE && !LOpts.OpenMPIsDevice)
 return false;
 
   // A definition cannot be preempted from an executable.

Modified: cfe/trunk/test/OpenMP/declare_target_codegen.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/declare_target_codegen.cpp?rev=361283=361282=361283=diff
==
--- cfe/trunk/test/OpenMP/declare_target_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/declare_target_codegen.cpp Tue May 21 11:20:08 2019
@@ -16,22 +16,22 @@
 // CHECK-DAG: Bake
 // CHECK-NOT: @{{hhh|ggg|fff|eee}} =
 // CHECK-DAG: @aaa = external global i32,
-// CHECK-DAG: @bbb = global i32 0,
+// CHECK-DAG: @bbb ={{ dso_local | }}global i32 0,
 // CHECK-DAG: weak constant %struct.__tgt_offload_entry { i8* bitcast (i32* 
@bbb to i8*),
 // CHECK-DAG: @ccc = external global i32,
-// CHECK-DAG: @ddd = global i32 0,
+// CHECK-DAG: @ddd ={{ dso_local | }}global i32 0,
 // CHECK-DAG: @hhh_decl_tgt_link_ptr = common global i32* null
 // CHECK-DAG: @ggg_decl_tgt_link_ptr = common global i32* null
 // CHECK-DAG: @fff_decl_tgt_link_ptr = common global i32* null
 // CHECK-DAG: @eee_decl_tgt_link_ptr = common global i32* null
 // CHECK-DAG: @{{.*}}maini1{{.*}}aaa = internal global i64 23,
-// CHECK-DAG: @b = global i32 15,
-// CHECK-DAG: @d = global i32 0,
+// CHECK-DAG: @b ={{ dso_local | }}global i32 15,
+// CHECK-DAG: @d ={{ dso_local | }}global i32 0,
 // CHECK-DAG: @c = external global i32,
-// CHECK-DAG: @globals = global %struct.S zeroinitializer,
+// CHECK-DAG: @globals ={{ dso_local | }}global %struct.S zeroinitializer,
 // CHECK-DAG: [[STAT:@.+stat]] = internal global %struct.S zeroinitializer,
 // CHECK-DAG: [[STAT_REF:@.+]] = internal constant %struct.S* [[STAT]]
-// CHECK-DAG: @out_decl_target = global i32 0,
+// CHECK-DAG: @out_decl_target ={{ dso_local | }}global i32 0,
 // CHECK-DAG: @llvm.used = appending global [6 x i8*] [i8* bitcast (void ()* 
@__omp_offloading__{{.+}}_globals_l[[@LINE+80]]_ctor to i8*), i8* bitcast (void 
()* @__omp_offloading__{{.+}}_stat_l[[@LINE+81]]_ctor to i8*),
 // CHECK-DAG: @llvm.compiler.used = appending global [1 x i8*] [i8* bitcast 
(%struct.S** [[STAT_REF]] to i8*)],
 

Modified: cfe/trunk/test/OpenMP/nvptx_allocate_codegen.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/nvptx_allocate_codegen.cpp?rev=361283=361282=361283=diff
==
--- cfe/trunk/test/OpenMP/nvptx_allocate_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/nvptx_allocate_codegen.cpp Tue May 21 11:20:08 2019
@@ -17,11 +17,11 @@ extern const omp_allocator_handle_t omp_
 extern const omp_allocator_handle_t omp_thread_mem_alloc;
 
 // CHECK-DAG: @{{.+}}St1{{.+}}b{{.+}} = external global i32,
-// CHECK-DAG: @a = global i32 0,
-// CHECK-DAG: @b = addrspace(4) global i32 0,
-// CHECK-DAG: @c = global i32 0,
-// CHECK-DAG: @d = global %struct.St1 zeroinitializer,
-// CHECK-DAG: @{{.+}}ns{{.+}}a{{.+}} = addrspace(3) global i32 0,
+// CHECK-DAG: @a ={{ dso_local | }}global i32 0,
+// CHECK-DAG: @b ={{ dso_local | }}addrspace(4) global i32 0,
+// CHECK-DAG: @c ={{ dso_local | }}global i32 0,
+// CHECK-DAG: @d ={{ dso_local | }}global %struct.St1 zeroinitializer,
+// CHECK-DAG: @{{.+}}ns{{.+}}a{{.+}} ={{ dso_local | }}addrspace(3) global i32 
0,
 // CHECK-DAG: @{{.+}}main{{.+}}a{{.*}} = internal global i32 0,
 // CHECK-DAG: @{{.+}}ST{{.+}}m{{.+}} = external global i32,
 // CHECK-DAG: @bar_c = internal global i32 0,
@@ -79,7 

[PATCH] D58035: [clang/DIVar] Emit flag for params that have unchanged values

2019-05-21 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl accepted this revision.
aprantl added a comment.
This revision is now accepted and ready to land.

Couple more nitpicks, but otherwise good.


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

https://reviews.llvm.org/D58035



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


[PATCH] D58035: [clang/DIVar] Emit flag for params that have unchanged values

2019-05-21 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added inline comments.



Comment at: lib/CodeGen/CGDebugInfo.cpp:4468
 }
 
+static void analyzeParametersModification(

/// Analyzes each function parameter to determine whether it is constant 
throughout the  function body.



Comment at: lib/CodeGen/CGDebugInfo.cpp:4478
+  ExprMutationAnalyzer FuncAnalyzer(*FuncBody, Ctx);
+  if (!FuncAnalyzer.isMutated(Parm)) {
+auto I = ParamCache.find(Parm);

```
if (FuncAnalyzer.isMutated(Parm))
  continue;
```



Comment at: lib/CodeGen/CGDebugInfo.cpp:4483
+  DIParm->setIsNotModified();
+}
+  }

should the else be an assertion or are there legitimate failure cases?


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

https://reviews.llvm.org/D58035



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


[PATCH] D58033: Add option for emitting dbg info for call site parameters

2019-05-21 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl accepted this revision.
aprantl added a comment.

LGTM, with an additional testcase.




Comment at: test/CodeGenCXX/dbg-info-all-calls-described.cpp:23
+// RUN: | FileCheck %s -check-prefix=HAS-ATTR \
+// RUN: -implicit-check-not=DIFlagAllCallsDescribed
+

+ a negative test for -O0 


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

https://reviews.llvm.org/D58033



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


[PATCH] D62049: [clang-tidy] Add a close-on-exec check on pipe2() in Android module.

2019-05-21 Thread Jian Cai via Phabricator via cfe-commits
jcai19 updated this revision to Diff 200547.
jcai19 added a comment.

Fix a typo.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62049

Files:
  clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp
  clang-tools-extra/clang-tidy/android/CMakeLists.txt
  clang-tools-extra/clang-tidy/android/CloexecPipe2Check.cpp
  clang-tools-extra/clang-tidy/android/CloexecPipe2Check.h
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/android-cloexec-pipe2.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/test/clang-tidy/android-cloexec-pipe2.cpp

Index: clang-tools-extra/test/clang-tidy/android-cloexec-pipe2.cpp
===
--- /dev/null
+++ clang-tools-extra/test/clang-tidy/android-cloexec-pipe2.cpp
@@ -0,0 +1,68 @@
+// RUN: %check_clang_tidy %s android-cloexec-pipe2 %t
+
+#define O_NONBLOCK 1
+#define __O_CLOEXEC 3
+#define O_CLOEXEC __O_CLOEXEC
+#define TEMP_FAILURE_RETRY(exp) \
+  ({\
+int _rc;\
+do {\
+  _rc = (exp);  \
+} while (_rc == -1);\
+  })
+#define NULL 0
+
+extern "C" int pipe2(int pipefd[2], int flags);
+
+void a() {
+  int pipefd[2];
+  pipe2(pipefd, O_NONBLOCK);
+  // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: 'pipe2' should use O_CLOEXEC where possible [android-cloexec-pipe2]
+  // CHECK-FIXES: pipe2(pipefd, O_NONBLOCK | O_CLOEXEC);
+  TEMP_FAILURE_RETRY(pipe2(pipefd, O_NONBLOCK));
+  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: 'pipe2'
+  // CHECK-FIXES: TEMP_FAILURE_RETRY(pipe2(pipefd, O_NONBLOCK | O_CLOEXEC));
+}
+
+void f() {
+  int pipefd[2];
+  pipe2(pipefd, 3);
+  // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: 'pipe2'
+  // CHECK-FIXES: pipe2(pipefd, 3 | O_CLOEXEC);
+  TEMP_FAILURE_RETRY(pipe2(pipefd, 3));
+  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: 'pipe2'
+  // CHECK-FIXES: TEMP_FAILURE_RETRY(pipe2(pipefd, 3 | O_CLOEXEC));
+
+  int flag = O_NONBLOCK;
+  pipe2(pipefd, flag);
+  TEMP_FAILURE_RETRY(pipe2(pipefd, flag));
+}
+
+namespace i {
+int pipe2(int pipefd[2], int flags);
+
+void d() {
+  int pipefd[2];
+  pipe2(pipefd, O_NONBLOCK);
+  TEMP_FAILURE_RETRY(pipe2(pipefd, O_NONBLOCK));
+}
+
+} // namespace i
+
+void e() {
+  int pipefd[2];
+  pipe2(pipefd, O_CLOEXEC);
+  TEMP_FAILURE_RETRY(pipe2(pipefd, O_CLOEXEC));
+  pipe2(pipefd, O_NONBLOCK | O_CLOEXEC);
+  TEMP_FAILURE_RETRY(pipe2(pipefd, O_NONBLOCK | O_CLOEXEC));
+}
+
+class G {
+public:
+  int pipe2(int pipefd[2], int flags);
+  void d() {
+int pipefd[2];
+pipe2(pipefd, O_NONBLOCK);
+TEMP_FAILURE_RETRY(pipe2(pipefd, O_NONBLOCK));
+  }
+};
Index: clang-tools-extra/docs/clang-tidy/checks/list.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -32,6 +32,7 @@
android-cloexec-inotify-init1
android-cloexec-memfd-create
android-cloexec-open
+   android-cloexec-pipe2
android-cloexec-socket
android-comparison-in-temp-failure-retry
boost-use-to-string
Index: clang-tools-extra/docs/clang-tidy/checks/android-cloexec-pipe2.rst
===
--- /dev/null
+++ clang-tools-extra/docs/clang-tidy/checks/android-cloexec-pipe2.rst
@@ -0,0 +1,19 @@
+.. title:: clang-tidy - android-cloexec-pipe2
+
+android-cloexec-pipe2
+=
+
+Checks if the required file flag ``O_CLOEXEC`` is present in the argument of
+``pipe2()``. ``pipe2()`` should include ``O_CLOEXEC`` in its type argument to
+avoid the file descriptor leakage. Without this flag, an opened sensitive file
+would remain open across a ``fork``+``exec`` to a lower-privileged SELinux domain.
+
+Examples:
+
+.. code-block:: c++
+
+  pipe2(pipefd, O_NONBLOCK);
+
+  // becomes
+
+  pipe2(pipefd, O_NONBLOCK | O_CLOEXEC);
Index: clang-tools-extra/docs/ReleaseNotes.rst
===
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -101,6 +101,12 @@
   Finds and fixes ``absl::Time`` subtraction expressions to do subtraction
   in the Time domain instead of the numeric domain.
 
+- New :doc:`android-cloexec-pipe
+  ` check.
+
+  Checks if the required file flag ``O_CLOEXEC`` is present in the argument of
+  ``pipe2()``.
+
 - New :doc:`bugprone-unhandled-self-assignment
   ` check.
 
Index: clang-tools-extra/clang-tidy/android/CloexecPipe2Check.h
===
--- /dev/null
+++ clang-tools-extra/clang-tidy/android/CloexecPipe2Check.h
@@ -0,0 +1,34 @@
+//===--- CloexecPipe2Check.h - clang-tidy*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See 

[PATCH] D62049: [clang-tidy] Add a close-on-exec check on pipe2() in Android module.

2019-05-21 Thread Jian Cai via Phabricator via cfe-commits
jcai19 marked 2 inline comments as done.
jcai19 added inline comments.



Comment at: 
clang-tools-extra/docs/clang-tidy/checks/android-cloexec-pipe2.rst:19
+
+  pipe2(pipefd, O_CLOEXEC);

srhines wrote:
> Shouldn't this be "O_NONBLOCK | O_CLOEXEC" instead? Why drop the O_NONBLOCK?
Good catch!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62049



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


[PATCH] D62047: [WebAssembly] Add multivalue and tail-call target features

2019-05-21 Thread Thomas Lively via Phabricator via cfe-commits
tlively added a comment.

In D62047#1505878 , @aheejin wrote:

> How about using `multi_value`/`multi-value`/`MultiValue`/`MULTI-VALUE` 
> (depending on positions)? The repo name is also multi-value. 
> https://github.com/WebAssembly/multi-value
>  Otherwise LGTM.


From 
https://english.stackexchange.com/questions/118021/existence-of-multi-in-us-english:

> the prefix multi is valid in American English, and usually used unhyphenated

F8907535: multivalue.jpg 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62047



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


[PATCH] D61963: [clang][Darwin] Refactor header search path logic into the driver

2019-05-21 Thread Louis Dionne via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rC361278: [clang][Darwin] Refactor header search path logic 
into the driver (authored by ldionne, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61963?vs=200311=200539#toc

Repository:
  rC Clang

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

https://reviews.llvm.org/D61963

Files:
  include/clang/Basic/DiagnosticDriverKinds.td
  include/clang/Basic/DiagnosticFrontendKinds.td
  lib/Driver/ToolChains/Darwin.cpp
  lib/Driver/ToolChains/Darwin.h
  lib/Frontend/InitHeaderSearch.cpp
  
test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/arm64-apple-darwin10/.keep
  test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/lib/.keep
  
test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v6/.keep
  
test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v7/.keep
  test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/lib/.keep
  
test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/ppc64/.keep
  
test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/ppc64/.keep
  test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/lib/.keep
  
test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.0.0/i686-apple-darwin8/.keep
  
test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/.keep
  test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/lib/.keep
  test/Driver/Inputs/basic_darwin_sdk_no_libcxx/usr/include/.keep
  test/Driver/Inputs/basic_darwin_sdk_no_libcxx/usr/lib/.keep
  test/Driver/Inputs/basic_darwin_sdk_no_libstdcxx/usr/include/.keep
  test/Driver/Inputs/basic_darwin_sdk_no_libstdcxx/usr/lib/.keep
  test/Driver/Inputs/basic_darwin_sdk_usr/usr/include/.keep
  test/Driver/Inputs/basic_darwin_sdk_usr/usr/lib/.keep
  test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/include/.keep
  test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/lib/.keep
  test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/local/include/.keep
  test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/local/lib/.keep
  test/Driver/Inputs/basic_darwin_sdk_usr_local/usr/local/include/.keep
  test/Driver/Inputs/basic_darwin_sdk_usr_local/usr/local/lib/.keep
  test/Driver/Inputs/basic_darwin_toolchain/usr/bin/.keep
  test/Driver/Inputs/basic_darwin_toolchain/usr/include/c++/v1/.keep
  test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin/.keep
  test/Driver/darwin-header-search-libcxx.cpp
  test/Driver/darwin-header-search-libstdcxx.cpp
  test/Driver/darwin-header-search-system.cpp
  test/Driver/darwin-stdlib.cpp
  test/Frontend/warning-stdlibcxx-darwin.cpp

Index: include/clang/Basic/DiagnosticDriverKinds.td
===
--- include/clang/Basic/DiagnosticDriverKinds.td
+++ include/clang/Basic/DiagnosticDriverKinds.td
@@ -453,4 +453,9 @@
   "specify a MSP430 device, or -mhwmult to set hardware multiply type "
   "explicitly.">, InGroup;
 
+def warn_drv_libstdcxx_not_found : Warning<
+  "include path for libstdc++ headers not found; pass '-stdlib=libc++' on the "
+  "command line to use the libc++ standard library instead">,
+  InGroup>;
+
 }
Index: include/clang/Basic/DiagnosticFrontendKinds.td
===
--- include/clang/Basic/DiagnosticFrontendKinds.td
+++ include/clang/Basic/DiagnosticFrontendKinds.td
@@ -232,11 +232,6 @@
 def warn_option_invalid_ocl_version : Warning<
   "OpenCL version %0 does not support the option '%1'">, InGroup;
 
-def warn_stdlibcxx_not_found : Warning<
-  "include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the "
-  "command line to use the libc++ standard library instead">,
-  InGroup>;
-
 def err_builtin_needs_feature : Error<"%0 needs target feature %1">;
 def err_function_needs_feature : Error<
   "always_inline function %1 requires target feature '%2', but would "
Index: test/Driver/darwin-header-search-libstdcxx.cpp
===
--- test/Driver/darwin-header-search-libstdcxx.cpp
+++ test/Driver/darwin-header-search-libstdcxx.cpp
@@ -0,0 +1,118 @@
+// General tests that the header search paths for libstdc++ detected by the
+// driver and passed to CC1 are correct on Darwin platforms.
+
+// Check ppc and ppc64
+//
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
+// RUN: -target ppc-apple-darwin \
+// RUN: -stdlib=libstdc++ \
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_libstdcxx_ppc \
+// RUN:   | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_libstdcxx_ppc --check-prefix=CHECK-LIBSTDCXX-PPC %s
+// CHECK-LIBSTDCXX-PPC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
+// CHECK-LIBSTDCXX-PPC: "-internal-isystem" 

r361278 - [clang][Darwin] Refactor header search path logic into the driver

2019-05-21 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Tue May 21 10:48:04 2019
New Revision: 361278

URL: http://llvm.org/viewvc/llvm-project?rev=361278=rev
Log:
[clang][Darwin] Refactor header search path logic into the driver

Summary:
This commit moves the logic for determining system, resource and C++
header search paths from CC1 to the driver. This refactor has already
been made for several platforms, but Darwin had been left behind.

This refactor tries to implement the previous search path logic with
perfect accuracy. In particular, the order of all include paths inside
CC1 and all paths that were skipped because nonexistent are conserved
after the refactor. This change was also tested against a code base
of significant size and revealed no problems.

Reviewers: jfb, arphaman

Subscribers: nemanjai, javed.absar, kbarton, christof, jkorous, dexonsmith, 
jsji, cfe-commits

Tags: #clang

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

Added:
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/arm64-apple-darwin10/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/arm64-apple-darwin10/.keep
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/lib/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/lib/.keep
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v6/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v6/.keep

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v7/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v7/.keep
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/lib/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/lib/.keep
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/ppc64/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/ppc64/.keep

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/ppc64/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/ppc64/.keep
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/lib/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/lib/.keep
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.0.0/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.0.0/i686-apple-darwin8/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.0.0/i686-apple-darwin8/.keep

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.2.1/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.2.1/i686-apple-darwin10/


[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 4 inline comments as done.
ymandel added a comment.

Thanks for the review.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61386



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


  1   2   >