Re: [PATCH] D21407: Enable building and using atomic shared_ptr for GCC.

2016-06-15 Thread Asiri Rathnayake via cfe-commits
rmaprath added a comment.

LGTM. I'll leave you to commit if Marshall has no objection.

Thanks!

/ Asiri


http://reviews.llvm.org/D21407



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


r272874 - clang/test/Driver/cuda-march.cu: Tweak not to match "clang" to other place like "path-to-clang-foo".

2016-06-15 Thread NAKAMURA Takumi via cfe-commits
Author: chapuni
Date: Thu Jun 16 01:08:09 2016
New Revision: 272874

URL: http://llvm.org/viewvc/llvm-project?rev=272874&view=rev
Log:
clang/test/Driver/cuda-march.cu: Tweak not to match "clang" to other place like 
"path-to-clang-foo".

Modified:
cfe/trunk/test/Driver/cuda-march.cu

Modified: cfe/trunk/test/Driver/cuda-march.cu
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cuda-march.cu?rev=272874&r1=272873&r2=272874&view=diff
==
--- cfe/trunk/test/Driver/cuda-march.cu (original)
+++ cfe/trunk/test/Driver/cuda-march.cu Thu Jun 16 01:08:09 2016
@@ -11,7 +11,7 @@
 // RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_20 %s 2>&1 | \
 // RUN: FileCheck %s
 
-// CHECK:clang
+// CHECK: bin{{/|\\+}}clang
 // CHECK: "-cc1"
 // CHECK-SAME: "-triple" "nvptx
 // CHECK-SAME: "-target-cpu" "sm_20"
@@ -19,6 +19,6 @@
 // CHECK: ptxas
 // CHECK-SAME: "--gpu-name" "sm_20"
 
-// CHECK:clang
+// CHECK: bin{{/|\\+}}clang
 // CHECK-SAME: "-cc1"
 // CHECK-SAME: "-target-cpu" "haswell"


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


r272867 - [Lex] Try to fix a 'comparison is always false' warning. NFC.

2016-06-15 Thread George Burgess IV via cfe-commits
Author: gbiv
Date: Wed Jun 15 21:30:33 2016
New Revision: 272867

URL: http://llvm.org/viewvc/llvm-project?rev=272867&view=rev
Log:
[Lex] Try to fix a 'comparison is always false' warning. NFC.

Modified:
cfe/trunk/lib/Lex/PPDirectives.cpp

Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=272867&r1=272866&r2=272867&view=diff
==
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Wed Jun 15 21:30:33 2016
@@ -162,7 +162,7 @@ static bool warnByDefaultOnWrongCase(Str
   SmallString<32> LowerInclude{Include};
   for (char &Ch : LowerInclude) {
 // In the ASCII range?
-if (Ch < 0 || Ch > 0x7f)
+if (static_cast(Ch) > 0x7f)
   return false; // Can't be a standard header
 // ASCII lowercase:
 if (Ch >= 'A' && Ch <= 'Z')


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


r272862 - [DebugInfo] Enable generation of unique identifiers for externally visible MS ABI types

2016-06-15 Thread Reid Kleckner via cfe-commits
Author: rnk
Date: Wed Jun 15 20:21:28 2016
New Revision: 272862

URL: http://llvm.org/viewvc/llvm-project?rev=272862&view=rev
Log:
[DebugInfo] Enable generation of unique identifiers for externally visible MS 
ABI types

We implemented the mangling for this a long time ago.

Added:
cfe/trunk/test/CodeGenCXX/debug-info-ms-abi.cpp
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=272862&r1=272861&r2=272862&view=diff
==
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Jun 15 20:21:28 2016
@@ -649,10 +649,6 @@ static SmallString<256> getUniqueTagType
   if (!hasCXXMangling(TD, TheCU) || !TD->isExternallyVisible())
 return FullName;
 
-  // Microsoft Mangler does not have support for mangleCXXRTTIName yet.
-  if (CGM.getTarget().getCXXABI().isMicrosoft())
-return FullName;
-
   // TODO: This is using the RTTI name. Is there a better way to get
   // a unique string for a type?
   llvm::raw_svector_ostream Out(FullName);

Added: cfe/trunk/test/CodeGenCXX/debug-info-ms-abi.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-ms-abi.cpp?rev=272862&view=auto
==
--- cfe/trunk/test/CodeGenCXX/debug-info-ms-abi.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/debug-info-ms-abi.cpp Wed Jun 15 20:21:28 2016
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 %s -triple=i686-pc-windows-msvc -debug-info-kind=limited 
-emit-llvm -o - | FileCheck %s
+
+// Tests that certain miscellaneous features work in the MS ABI.
+
+struct Foo {
+  struct Nested {};
+};
+Foo f;
+Foo::Nested n;
+// CHECK: distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Foo",
+// CHECK-SAME: identifier: ".?AUFoo@@"
+// CHECK: distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Nested",
+// CHECK-SAME: identifier: ".?AUNested@Foo@@"


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


Re: [PATCH] clang: ignore -maccumulate_outgoing_args option

2016-06-15 Thread Reid Kleckner via cfe-commits
Actually, in the last three months we've recently added support for pushing
arguments in a call sequence. I think we should wire this up to an LLVM
function attribute. It should be a tiny bit of work in
llvm/lib/Target/X86/X86FrameLowering.cpp and
clang/lib/CodeGen/CodeGenModule.cpp:SetLLVMFunctionAttributesForDefinition.

On Wed, Jun 15, 2016 at 4:44 PM, Austin English via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Hi,
>
> This fixes https://llvm.org/bugs/show_bug.cgi?id=28145
>
> Please let me know if something needs to changed for inclusion.
>
> --
> -Austin
> GPG: 14FB D7EA A041 937B
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r272859 - Allow 'nodebug' on local variables.

2016-06-15 Thread Paul Robinson via cfe-commits
Author: probinson
Date: Wed Jun 15 19:42:36 2016
New Revision: 272859

URL: http://llvm.org/viewvc/llvm-project?rev=272859&view=rev
Log:
Allow 'nodebug' on local variables.
Parameters and non-static members of aggregates are still excluded,
and probably should remain that way.

Differential Revision: http://reviews.llvm.org/D19754

Added:
cfe/trunk/test/CodeGenObjC/debug-info-nodebug.m
Modified:
cfe/trunk/include/clang/Basic/Attr.td
cfe/trunk/include/clang/Basic/AttrDocs.td
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/test/CodeGenCXX/debug-info-nodebug.cpp
cfe/trunk/test/Sema/attr-nodebug.c

Modified: cfe/trunk/include/clang/Basic/Attr.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=272859&r1=272858&r2=272859&view=diff
==
--- cfe/trunk/include/clang/Basic/Attr.td (original)
+++ cfe/trunk/include/clang/Basic/Attr.td Wed Jun 15 19:42:36 2016
@@ -82,6 +82,8 @@ def NormalVar : SubsetSubjectgetKind() != Decl::ImplicitParam &&
 S->getKind() != Decl::ParmVar &&
 S->getKind() != Decl::NonTypeTemplateParm}]>;
+def NonParmVar : SubsetSubjectgetKind() != Decl::ParmVar}]>;
 def NonBitField : SubsetSubjectisBitField()}]>;
 
@@ -994,8 +996,8 @@ def NoCommon : InheritableAttr {
 
 def NoDebug : InheritableAttr {
   let Spellings = [GCC<"nodebug">];
-  let Subjects = SubjectList<[FunctionLike, ObjCMethod, GlobalVar], WarnDiag,
-  "ExpectedFunctionGlobalVarMethodOrProperty">;
+  let Subjects = SubjectList<[FunctionLike, ObjCMethod, NonParmVar], WarnDiag,
+  "ExpectedVariableOrFunction">;
   let Documentation = [NoDebugDocs];
 }
 

Modified: cfe/trunk/include/clang/Basic/AttrDocs.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=272859&r1=272858&r2=272859&view=diff
==
--- cfe/trunk/include/clang/Basic/AttrDocs.td (original)
+++ cfe/trunk/include/clang/Basic/AttrDocs.td Wed Jun 15 19:42:36 2016
@@ -524,8 +524,8 @@ def NoDebugDocs : Documentation {
   let Category = DocCatVariable;
   let Content = [{
 The ``nodebug`` attribute allows you to suppress debugging information for a
-function, or for a variable declared with static storage duration, such as
-globals, class static data members, and static locals.
+function or method, or for a variable that is not a parameter or a non-static
+data member.
   }];
 }
 

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=272859&r1=272858&r2=272859&view=diff
==
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Jun 15 19:42:36 2016
@@ -3019,6 +3019,8 @@ void CGDebugInfo::EmitDeclare(const VarD
   CGBuilderTy &Builder) {
   assert(DebugKind >= codegenoptions::LimitedDebugInfo);
   assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!");
+  if (VD->hasAttr())
+return;
 
   bool Unwritten =
   VD->isImplicit() || (isa(VD->getDeclContext()) &&
@@ -3163,6 +3165,8 @@ void CGDebugInfo::EmitDeclareOfBlockDecl
 
   if (Builder.GetInsertBlock() == nullptr)
 return;
+  if (VD->hasAttr())
+return;
 
   bool isByRef = VD->hasAttr();
 

Modified: cfe/trunk/test/CodeGenCXX/debug-info-nodebug.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-nodebug.cpp?rev=272859&r1=272858&r2=272859&view=diff
==
--- cfe/trunk/test/CodeGenCXX/debug-info-nodebug.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-nodebug.cpp Wed Jun 15 19:42:36 2016
@@ -44,9 +44,12 @@ void func3() {
 // YESINFO-DAG: !DIDerivedType({{.*}} name: "static_const_member"
 // NOINFO-NOT:  !DIDerivedType({{.*}} name: "static_const_member"
 
-// Function-local static variable.
+// Function-local static and auto variables.
 void func4() {
   NODEBUG static int static_local = 6;
+  NODEBUGint normal_local = 7;
 }
 // YESINFO-DAG: !DIGlobalVariable(name: "static_local"
 // NOINFO-NOT:  !DIGlobalVariable(name: "static_local"
+// YESINFO-DAG: !DILocalVariable(name: "normal_local"
+// NOINFO-NOT:  !DILocalVariable(name: "normal_local"

Added: cfe/trunk/test/CodeGenObjC/debug-info-nodebug.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/debug-info-nodebug.m?rev=272859&view=auto
==
--- cfe/trunk/test/CodeGenObjC/debug-info-nodebug.m (added)
+++ cfe/trunk/test/CodeGenObjC/debug-info-nodebug.m Wed Jun 15 19:42:36 2016
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -triple arm-apple-ios -emit-llvm -debug-info-kind=l

Re: [PATCH] D19754: Allow 'nodebug' on local variables

2016-06-15 Thread Paul Robinson via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272859: Allow 'nodebug' on local variables. (authored by 
probinson).

Changed prior to commit:
  http://reviews.llvm.org/D19754?vs=60930&id=60940#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19754

Files:
  cfe/trunk/include/clang/Basic/Attr.td
  cfe/trunk/include/clang/Basic/AttrDocs.td
  cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
  cfe/trunk/test/CodeGenCXX/debug-info-nodebug.cpp
  cfe/trunk/test/CodeGenObjC/debug-info-nodebug.m
  cfe/trunk/test/Sema/attr-nodebug.c

Index: cfe/trunk/include/clang/Basic/AttrDocs.td
===
--- cfe/trunk/include/clang/Basic/AttrDocs.td
+++ cfe/trunk/include/clang/Basic/AttrDocs.td
@@ -524,8 +524,8 @@
   let Category = DocCatVariable;
   let Content = [{
 The ``nodebug`` attribute allows you to suppress debugging information for a
-function, or for a variable declared with static storage duration, such as
-globals, class static data members, and static locals.
+function or method, or for a variable that is not a parameter or a non-static
+data member.
   }];
 }
 
Index: cfe/trunk/include/clang/Basic/Attr.td
===
--- cfe/trunk/include/clang/Basic/Attr.td
+++ cfe/trunk/include/clang/Basic/Attr.td
@@ -82,6 +82,8 @@
 S->getKind() != Decl::ImplicitParam &&
 S->getKind() != Decl::ParmVar &&
 S->getKind() != Decl::NonTypeTemplateParm}]>;
+def NonParmVar : SubsetSubjectgetKind() != Decl::ParmVar}]>;
 def NonBitField : SubsetSubjectisBitField()}]>;
 
@@ -994,8 +996,8 @@
 
 def NoDebug : InheritableAttr {
   let Spellings = [GCC<"nodebug">];
-  let Subjects = SubjectList<[FunctionLike, ObjCMethod, GlobalVar], WarnDiag,
-  "ExpectedFunctionGlobalVarMethodOrProperty">;
+  let Subjects = SubjectList<[FunctionLike, ObjCMethod, NonParmVar], WarnDiag,
+  "ExpectedVariableOrFunction">;
   let Documentation = [NoDebugDocs];
 }
 
Index: cfe/trunk/test/Sema/attr-nodebug.c
===
--- cfe/trunk/test/Sema/attr-nodebug.c
+++ cfe/trunk/test/Sema/attr-nodebug.c
@@ -2,8 +2,8 @@
 
 int a __attribute__((nodebug));
 
-void b() {
-  int b __attribute__((nodebug)); // expected-warning {{'nodebug' attribute only applies to functions and global variables}}
+void b(int p __attribute__((nodebug))) { // expected-warning {{'nodebug' attribute only applies to variables and functions}}
+  int b __attribute__((nodebug));
 }
 
 void t1() __attribute__((nodebug));
Index: cfe/trunk/test/CodeGenObjC/debug-info-nodebug.m
===
--- cfe/trunk/test/CodeGenObjC/debug-info-nodebug.m
+++ cfe/trunk/test/CodeGenObjC/debug-info-nodebug.m
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -triple arm-apple-ios -emit-llvm -debug-info-kind=limited -fblocks  %s -o - | FileCheck %s
+// Objective-C code cargo-culted from debug-info-lifetime-crash.m.
+@protocol NSObject
+- (id)copy;
+@end
+@class W;
+@interface View1
+@end
+@implementation Controller {
+void (^Block)(void);
+}
+- (void)View:(View1 *)View foo:(W *)W
+{
+  // The reference from inside the block implicitly creates another
+  // local variable for the referenced member. That is what gets
+  // suppressed by the attribute.  It still gets debug info as a
+  // member, though.
+  // CHECK-NOT: !DILocalVariable(name: "weakSelf"
+  // CHECK: !DIDerivedType({{.*}} name: "weakSelf"
+  // CHECK-NOT: !DILocalVariable(name: "weakSelf"
+  __attribute__((nodebug)) __typeof(self) weakSelf = self;
+  Block = [^{
+__typeof(self) strongSelf = weakSelf;
+} copy];
+}
+@end
Index: cfe/trunk/test/CodeGenCXX/debug-info-nodebug.cpp
===
--- cfe/trunk/test/CodeGenCXX/debug-info-nodebug.cpp
+++ cfe/trunk/test/CodeGenCXX/debug-info-nodebug.cpp
@@ -44,9 +44,12 @@
 // YESINFO-DAG: !DIDerivedType({{.*}} name: "static_const_member"
 // NOINFO-NOT:  !DIDerivedType({{.*}} name: "static_const_member"
 
-// Function-local static variable.
+// Function-local static and auto variables.
 void func4() {
   NODEBUG static int static_local = 6;
+  NODEBUGint normal_local = 7;
 }
 // YESINFO-DAG: !DIGlobalVariable(name: "static_local"
 // NOINFO-NOT:  !DIGlobalVariable(name: "static_local"
+// YESINFO-DAG: !DILocalVariable(name: "normal_local"
+// NOINFO-NOT:  !DILocalVariable(name: "normal_local"
Index: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
===
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
@@ -3019,6 +3019,8 @@
   CGBuilderTy &Builder) {
   assert(DebugKind >= codegenoptions::LimitedDebugInfo);
   assert(!LexicalBlockStack.em

[PATCH] clang: ignore -maccumulate_outgoing_args option

2016-06-15 Thread Austin English via cfe-commits
Hi,

This fixes https://llvm.org/bugs/show_bug.cgi?id=28145

Please let me know if something needs to changed for inclusion.

-- 
-Austin
GPG: 14FB D7EA A041 937B
From fd4aa56c027d8ccc38ffb7484b19194804982cbe Mon Sep 17 00:00:00 2001
From: Austin English 
Date: Wed, 15 Jun 2016 18:40:51 -0500
Subject: [PATCH] clang: ignore -maccumulate_outgoing_args option

Fixes https://llvm.org/bugs/show_bug.cgi?id=28145

Signed-off-by: Austin English 
---
 include/clang/Driver/Options.td | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td
index 5c240f3..1babc19 100644
--- a/include/clang/Driver/Options.td
+++ b/include/clang/Driver/Options.td
@@ -1308,6 +1308,7 @@ def mx32 : Flag<["-"], "mx32">, Group, Flags<[DriverOption, CoreOption]
 def mabi_EQ : Joined<["-"], "mabi=">, Group;
 def miamcu : Flag<["-"], "miamcu">, Group, Flags<[DriverOption, CoreOption]>,
   HelpText<"Use Intel MCU ABI">;
+def maccumulate_outgoing_args : Flag<["-"], "maccumulate-outgoing-args">, Group;
 def malign_functions_EQ : Joined<["-"], "malign-functions=">, Group;
 def malign_loops_EQ : Joined<["-"], "malign-loops=">, Group;
 def malign_jumps_EQ : Joined<["-"], "malign-jumps=">, Group;
-- 
2.7.3

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


Re: [PATCH] D21419: [CUDA] Don't pass top-level -march down to device cc1 or ptxas.

2016-06-15 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272857: [CUDA] Don't pass top-level -march down to device 
cc1 or ptxas. (authored by jlebar).

Changed prior to commit:
  http://reviews.llvm.org/D21419?vs=60932&id=60935#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21419

Files:
  cfe/trunk/lib/Driver/ToolChains.cpp
  cfe/trunk/test/Driver/cuda-march.cu

Index: cfe/trunk/lib/Driver/ToolChains.cpp
===
--- cfe/trunk/lib/Driver/ToolChains.cpp
+++ cfe/trunk/lib/Driver/ToolChains.cpp
@@ -4676,8 +4676,10 @@
 DAL->append(A);
   }
 
-  if (BoundArch)
+  if (BoundArch) {
+DAL->eraseArg(options::OPT_march_EQ);
 DAL->AddJoinedArg(nullptr, Opts.getOption(options::OPT_march_EQ), 
BoundArch);
+  }
   return DAL;
 }
 
Index: cfe/trunk/test/Driver/cuda-march.cu
===
--- cfe/trunk/test/Driver/cuda-march.cu
+++ cfe/trunk/test/Driver/cuda-march.cu
@@ -0,0 +1,24 @@
+// Checks that cuda compilation does the right thing when passed -march.
+// (Specifically, we want to pass it to host compilation, but not to device
+// compilation or ptxas!)
+//
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: nvptx-registered-target
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell %s 2>&1 | 
FileCheck %s
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_20 %s 2>&1 | \
+// RUN: FileCheck %s
+
+// CHECK:clang
+// CHECK: "-cc1"
+// CHECK-SAME: "-triple" "nvptx
+// CHECK-SAME: "-target-cpu" "sm_20"
+
+// CHECK: ptxas
+// CHECK-SAME: "--gpu-name" "sm_20"
+
+// CHECK:clang
+// CHECK-SAME: "-cc1"
+// CHECK-SAME: "-target-cpu" "haswell"


Index: cfe/trunk/lib/Driver/ToolChains.cpp
===
--- cfe/trunk/lib/Driver/ToolChains.cpp
+++ cfe/trunk/lib/Driver/ToolChains.cpp
@@ -4676,8 +4676,10 @@
 DAL->append(A);
   }
 
-  if (BoundArch)
+  if (BoundArch) {
+DAL->eraseArg(options::OPT_march_EQ);
 DAL->AddJoinedArg(nullptr, Opts.getOption(options::OPT_march_EQ), BoundArch);
+  }
   return DAL;
 }
 
Index: cfe/trunk/test/Driver/cuda-march.cu
===
--- cfe/trunk/test/Driver/cuda-march.cu
+++ cfe/trunk/test/Driver/cuda-march.cu
@@ -0,0 +1,24 @@
+// Checks that cuda compilation does the right thing when passed -march.
+// (Specifically, we want to pass it to host compilation, but not to device
+// compilation or ptxas!)
+//
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: nvptx-registered-target
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell %s 2>&1 | FileCheck %s
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_20 %s 2>&1 | \
+// RUN: FileCheck %s
+
+// CHECK:clang
+// CHECK: "-cc1"
+// CHECK-SAME: "-triple" "nvptx
+// CHECK-SAME: "-target-cpu" "sm_20"
+
+// CHECK: ptxas
+// CHECK-SAME: "--gpu-name" "sm_20"
+
+// CHECK:clang
+// CHECK-SAME: "-cc1"
+// CHECK-SAME: "-target-cpu" "haswell"
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r272857 - [CUDA] Don't pass top-level -march down to device cc1 or ptxas.

2016-06-15 Thread Justin Lebar via cfe-commits
Author: jlebar
Date: Wed Jun 15 18:46:11 2016
New Revision: 272857

URL: http://llvm.org/viewvc/llvm-project?rev=272857&view=rev
Log:
[CUDA] Don't pass top-level -march down to device cc1 or ptxas.

Summary:
Previously if you did e.g.

  $ clang -march=haswell -x cuda foo.cu

we would pass "-march=haswell -march=sm_20" down to the ptxas tool.
This causes it to assert, and rightly so!

Reviewers: tra

Subscribers: cfe-commits, echristo

Differential Revision: http://reviews.llvm.org/D21419

Added:
cfe/trunk/test/Driver/cuda-march.cu
Modified:
cfe/trunk/lib/Driver/ToolChains.cpp

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=272857&r1=272856&r2=272857&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Wed Jun 15 18:46:11 2016
@@ -4676,8 +4676,10 @@ CudaToolChain::TranslateArgs(const llvm:
 DAL->append(A);
   }
 
-  if (BoundArch)
+  if (BoundArch) {
+DAL->eraseArg(options::OPT_march_EQ);
 DAL->AddJoinedArg(nullptr, Opts.getOption(options::OPT_march_EQ), 
BoundArch);
+  }
   return DAL;
 }
 

Added: cfe/trunk/test/Driver/cuda-march.cu
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cuda-march.cu?rev=272857&view=auto
==
--- cfe/trunk/test/Driver/cuda-march.cu (added)
+++ cfe/trunk/test/Driver/cuda-march.cu Wed Jun 15 18:46:11 2016
@@ -0,0 +1,24 @@
+// Checks that cuda compilation does the right thing when passed -march.
+// (Specifically, we want to pass it to host compilation, but not to device
+// compilation or ptxas!)
+//
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: nvptx-registered-target
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell %s 2>&1 | 
FileCheck %s
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_20 %s 2>&1 | \
+// RUN: FileCheck %s
+
+// CHECK:clang
+// CHECK: "-cc1"
+// CHECK-SAME: "-triple" "nvptx
+// CHECK-SAME: "-target-cpu" "sm_20"
+
+// CHECK: ptxas
+// CHECK-SAME: "--gpu-name" "sm_20"
+
+// CHECK:clang
+// CHECK-SAME: "-cc1"
+// CHECK-SAME: "-target-cpu" "haswell"


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


Re: [PATCH] D21419: [CUDA] Don't pass top-level -march down to device cc1 or ptxas.

2016-06-15 Thread Artem Belevich via cfe-commits
tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.

LGTM.


http://reviews.llvm.org/D21419



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


Re: [PATCH] D21419: [CUDA] Don't pass top-level -march down to device cc1 or ptxas.

2016-06-15 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 60932.
jlebar added a comment.

Fix tests for real this time.


http://reviews.llvm.org/D21419

Files:
  lib/Driver/ToolChains.cpp
  test/Driver/cuda-march.cu

Index: test/Driver/cuda-march.cu
===
--- /dev/null
+++ test/Driver/cuda-march.cu
@@ -0,0 +1,24 @@
+// Checks that cuda compilation does the right thing when passed -march.
+// (Specifically, we want to pass it to host compilation, but not to device
+// compilation or ptxas!)
+//
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: nvptx-registered-target
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell %s 2>&1 | 
FileCheck %s
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_20 %s 2>&1 | \
+// RUN: FileCheck %s
+
+// CHECK:clang
+// CHECK: "-cc1"
+// CHECK-SAME: "-triple" "nvptx
+// CHECK-SAME: "-target-cpu" "sm_20"
+
+// CHECK: ptxas
+// CHECK-SAME: "--gpu-name" "sm_20"
+
+// CHECK:clang
+// CHECK-SAME: "-cc1"
+// CHECK-SAME: "-target-cpu" "haswell"
Index: lib/Driver/ToolChains.cpp
===
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -4676,8 +4676,10 @@
 DAL->append(A);
   }
 
-  if (BoundArch)
+  if (BoundArch) {
+DAL->eraseArg(options::OPT_march_EQ);
 DAL->AddJoinedArg(nullptr, Opts.getOption(options::OPT_march_EQ), 
BoundArch);
+  }
   return DAL;
 }
 


Index: test/Driver/cuda-march.cu
===
--- /dev/null
+++ test/Driver/cuda-march.cu
@@ -0,0 +1,24 @@
+// Checks that cuda compilation does the right thing when passed -march.
+// (Specifically, we want to pass it to host compilation, but not to device
+// compilation or ptxas!)
+//
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: nvptx-registered-target
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell %s 2>&1 | FileCheck %s
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_20 %s 2>&1 | \
+// RUN: FileCheck %s
+
+// CHECK:clang
+// CHECK: "-cc1"
+// CHECK-SAME: "-triple" "nvptx
+// CHECK-SAME: "-target-cpu" "sm_20"
+
+// CHECK: ptxas
+// CHECK-SAME: "--gpu-name" "sm_20"
+
+// CHECK:clang
+// CHECK-SAME: "-cc1"
+// CHECK-SAME: "-target-cpu" "haswell"
Index: lib/Driver/ToolChains.cpp
===
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -4676,8 +4676,10 @@
 DAL->append(A);
   }
 
-  if (BoundArch)
+  if (BoundArch) {
+DAL->eraseArg(options::OPT_march_EQ);
 DAL->AddJoinedArg(nullptr, Opts.getOption(options::OPT_march_EQ), BoundArch);
+  }
   return DAL;
 }
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D21419: [CUDA] Don't pass top-level -march down to device cc1 or ptxas.

2016-06-15 Thread Artem Belevich via cfe-commits
tra added inline comments.


Comment at: test/Driver/cuda-march.cu:22-28
@@ +21,9 @@
+
+// SM30:clang
+// SM30: "-cc1"
+// SM30-SAME: "-triple" "nvptx
+// SM30-SAME: "-target-cpu" "sm_30"
+// SM30: ptxas
+// SM30-SAME: "--gpu-name" "sm_30"
+
+// HASWELL:clang

You don't need SM30 checks these now.
Speaking of checks, you only need one check label now as all runs check for 
both SM20 and HASWELL.


http://reviews.llvm.org/D21419



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


Re: [PATCH] D19754: Allow 'nodebug' on local variables

2016-06-15 Thread David Blaikie via cfe-commits
dblaikie accepted this revision.
dblaikie added a comment.

Sure, looks good - thanks. Will discuss the broader test issues 
later/separately.


http://reviews.llvm.org/D19754



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


Re: [PATCH] D21419: [CUDA] Don't pass top-level -march down to device cc1 or ptxas.

2016-06-15 Thread Justin Lebar via cfe-commits
jlebar added inline comments.


Comment at: test/Driver/cuda-march.cu:15-16
@@ +14,4 @@
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=skylake 
--cuda-gpu-arch=sm_30 %s 2>&1 | \
+// RUN: FileCheck -check-prefix SKYLAKE -check-prefix SM30 %s
+

tra wrote:
> These look redundant -- we only care whether we eliminate -march on device 
> side. It does not depend on the value of -march or on particular GPU arch. 
> What do I miss?
Removed the last one.  I don't think the first two are redundant, because I 
wanted to check that the *implicit* sm_20 still overrides the explicit 
-mhaswell.


http://reviews.llvm.org/D21419



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


Re: [PATCH] D21419: [CUDA] Don't pass top-level -march down to device cc1 or ptxas.

2016-06-15 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 60931.
jlebar added a comment.

Remove redundant test.


http://reviews.llvm.org/D21419

Files:
  lib/Driver/ToolChains.cpp
  test/Driver/cuda-march.cu

Index: test/Driver/cuda-march.cu
===
--- /dev/null
+++ test/Driver/cuda-march.cu
@@ -0,0 +1,31 @@
+// Checks that cuda compilation does the right thing when passed -march.
+// (Specifically, we want to pass it to host compilation, but not to device
+// compilation or ptxas!)
+//
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: nvptx-registered-target
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell %s 2>&1 | \
+// RUN: FileCheck -check-prefix HASWELL -check-prefix SM20 %s
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_20 %s 2>&1 | \
+// RUN: FileCheck -check-prefix HASWELL -check-prefix SM20 %s
+
+// SM20:clang
+// SM20: "-cc1"
+// SM20-SAME: "-triple" "nvptx
+// SM20-SAME: "-target-cpu" "sm_20"
+// SM20: ptxas
+// SM20-SAME: "--gpu-name" "sm_20"
+
+// SM30:clang
+// SM30: "-cc1"
+// SM30-SAME: "-triple" "nvptx
+// SM30-SAME: "-target-cpu" "sm_30"
+// SM30: ptxas
+// SM30-SAME: "--gpu-name" "sm_30"
+
+// HASWELL:clang
+// HASWELL-SAME: "-cc1"
+// HASWELL-SAME: "-target-cpu" "haswell"
Index: lib/Driver/ToolChains.cpp
===
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -4676,8 +4676,10 @@
 DAL->append(A);
   }
 
-  if (BoundArch)
+  if (BoundArch) {
+DAL->eraseArg(options::OPT_march_EQ);
 DAL->AddJoinedArg(nullptr, Opts.getOption(options::OPT_march_EQ), 
BoundArch);
+  }
   return DAL;
 }
 


Index: test/Driver/cuda-march.cu
===
--- /dev/null
+++ test/Driver/cuda-march.cu
@@ -0,0 +1,31 @@
+// Checks that cuda compilation does the right thing when passed -march.
+// (Specifically, we want to pass it to host compilation, but not to device
+// compilation or ptxas!)
+//
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: nvptx-registered-target
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell %s 2>&1 | \
+// RUN: FileCheck -check-prefix HASWELL -check-prefix SM20 %s
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_20 %s 2>&1 | \
+// RUN: FileCheck -check-prefix HASWELL -check-prefix SM20 %s
+
+// SM20:clang
+// SM20: "-cc1"
+// SM20-SAME: "-triple" "nvptx
+// SM20-SAME: "-target-cpu" "sm_20"
+// SM20: ptxas
+// SM20-SAME: "--gpu-name" "sm_20"
+
+// SM30:clang
+// SM30: "-cc1"
+// SM30-SAME: "-triple" "nvptx
+// SM30-SAME: "-target-cpu" "sm_30"
+// SM30: ptxas
+// SM30-SAME: "--gpu-name" "sm_30"
+
+// HASWELL:clang
+// HASWELL-SAME: "-cc1"
+// HASWELL-SAME: "-target-cpu" "haswell"
Index: lib/Driver/ToolChains.cpp
===
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -4676,8 +4676,10 @@
 DAL->append(A);
   }
 
-  if (BoundArch)
+  if (BoundArch) {
+DAL->eraseArg(options::OPT_march_EQ);
 DAL->AddJoinedArg(nullptr, Opts.getOption(options::OPT_march_EQ), BoundArch);
+  }
   return DAL;
 }
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D19754: Allow 'nodebug' on local variables

2016-06-15 Thread Paul Robinson via cfe-commits
probinson marked an inline comment as done.


Comment at: test/CodeGenCXX/debug-info-nodebug.cpp:50
@@ -49,2 +49,3 @@
   NODEBUG static int static_local = 6;
+  NODEBUGint normal_local = 7;
 }

const case removed.


http://reviews.llvm.org/D19754



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


r272856 - Fix sanitizer-ld test.

2016-06-15 Thread Evgeniy Stepanov via cfe-commits
Author: eugenis
Date: Wed Jun 15 18:29:26 2016
New Revision: 272856

URL: http://llvm.org/viewvc/llvm-project?rev=272856&view=rev
Log:
Fix sanitizer-ld test.

Modified:
cfe/trunk/test/Driver/sanitizer-ld.c

Modified: cfe/trunk/test/Driver/sanitizer-ld.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/sanitizer-ld.c?rev=272856&r1=272855&r2=272856&view=diff
==
--- cfe/trunk/test/Driver/sanitizer-ld.c (original)
+++ cfe/trunk/test/Driver/sanitizer-ld.c Wed Jun 15 18:29:26 2016
@@ -299,7 +299,6 @@
 // RUN:   | FileCheck --check-prefix=CHECK-ASAN-COV-LINUX %s
 // CHECK-ASAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-ASAN-COV-LINUX: "-whole-archive" "{{.*}}libclang_rt.asan-x86_64.a" 
"-no-whole-archive"
-// CHECK-ASAN-COV-LINUX: "--dynamic-list={{.*}}libclang_rt.asan-x86_64.a.syms"
 // CHECK-ASAN-COV-LINUX-NOT: libclang_rt.ubsan
 // CHECK-ASAN-COV-LINUX-NOT: "-lstdc++"
 // CHECK-ASAN-COV-LINUX: "-lpthread"
@@ -310,7 +309,6 @@
 // RUN:   | FileCheck --check-prefix=CHECK-MSAN-COV-LINUX %s
 // CHECK-MSAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-MSAN-COV-LINUX: "-whole-archive" "{{.*}}libclang_rt.msan-x86_64.a" 
"-no-whole-archive"
-// CHECK-MSAN-COV-LINUX: "--dynamic-list={{.*}}libclang_rt.msan-x86_64.a.syms"
 // CHECK-MSAN-COV-LINUX-NOT: libclang_rt.ubsan
 // CHECK-MSAN-COV-LINUX-NOT: "-lstdc++"
 // CHECK-MSAN-COV-LINUX: "-lpthread"
@@ -321,7 +319,6 @@
 // RUN:   | FileCheck --check-prefix=CHECK-DFSAN-COV-LINUX %s
 // CHECK-DFSAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-DFSAN-COV-LINUX: "-whole-archive" "{{.*}}libclang_rt.dfsan-x86_64.a" 
"-no-whole-archive"
-// CHECK-DFSAN-COV-LINUX: 
"--dynamic-list={{.*}}libclang_rt.dfsan-x86_64.a.syms"
 // CHECK-DFSAN-COV-LINUX-NOT: libclang_rt.ubsan
 // CHECK-DFSAN-COV-LINUX-NOT: "-lstdc++"
 // CHECK-DFSAN-COV-LINUX: "-lpthread"
@@ -332,8 +329,6 @@
 // RUN:   | FileCheck --check-prefix=CHECK-UBSAN-COV-LINUX %s
 // CHECK-UBSAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-UBSAN-COV-LINUX: "-whole-archive" 
"{{.*}}libclang_rt.ubsan_standalone-x86_64.a" "-no-whole-archive"
-// CHECK-UBSAN-COV-LINUX: 
"--dynamic-list={{.*}}libclang_rt.ubsan_standalone-x86_64.a.syms"
-// CHECK-UBSAN-COV-LINUX-NOT: libclang_rt.ubsan
 // CHECK-UBSAN-COV-LINUX-NOT: "-lstdc++"
 // CHECK-UBSAN-COV-LINUX: "-lpthread"
 
@@ -343,8 +338,6 @@
 // RUN:   | FileCheck --check-prefix=CHECK-COV-LINUX %s
 // CHECK-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-COV-LINUX: "-whole-archive" 
"{{.*}}libclang_rt.ubsan_standalone-x86_64.a" "-no-whole-archive"
-// CHECK-COV-LINUX: 
"--dynamic-list={{.*}}libclang_rt.ubsan_standalone-x86_64.a.syms"
-// CHECK-COV-LINUX-NOT: libclang_rt.ubsan
 // CHECK-COV-LINUX-NOT: "-lstdc++"
 // CHECK-COV-LINUX: "-lpthread"
 


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


Re: [PATCH] D19754: Allow 'nodebug' on local variables

2016-06-15 Thread Paul Robinson via cfe-commits
probinson updated this revision to Diff 60930.
probinson added a comment.

Removed the apparently redundant test for a const local variable.

Yes, I'm back to this after way longer than expected.  I believe, for this 
patch specifically, the extra const local variable was the only identifiable 
problem.  There were other issues regarding the overall test, which were partly 
discussed here and partly in http://reviews.llvm.org/D19567, but those were not 
specific to this patch.

@dblaikie, I propose that with the 'const' test removed, we allow this patch to 
proceed (which completes the implementation, something I would dearly like to 
have done before 3.9 branches) with the promise that I'll come back around to 
the broader topic of the test file in general as a follow-up.


http://reviews.llvm.org/D19754

Files:
  include/clang/Basic/Attr.td
  include/clang/Basic/AttrDocs.td
  lib/CodeGen/CGDebugInfo.cpp
  test/CodeGenCXX/debug-info-nodebug.cpp
  test/CodeGenObjC/debug-info-nodebug.m
  test/Sema/attr-nodebug.c

Index: test/Sema/attr-nodebug.c
===
--- test/Sema/attr-nodebug.c
+++ test/Sema/attr-nodebug.c
@@ -2,8 +2,8 @@
 
 int a __attribute__((nodebug));
 
-void b() {
-  int b __attribute__((nodebug)); // expected-warning {{'nodebug' attribute only applies to functions and global variables}}
+void b(int p __attribute__((nodebug))) { // expected-warning {{'nodebug' attribute only applies to variables and functions}}
+  int b __attribute__((nodebug));
 }
 
 void t1() __attribute__((nodebug));
Index: test/CodeGenObjC/debug-info-nodebug.m
===
--- test/CodeGenObjC/debug-info-nodebug.m
+++ test/CodeGenObjC/debug-info-nodebug.m
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -triple arm-apple-ios -emit-llvm -debug-info-kind=limited -fblocks  %s -o - | FileCheck %s
+// Objective-C code cargo-culted from debug-info-lifetime-crash.m.
+@protocol NSObject
+- (id)copy;
+@end
+@class W;
+@interface View1
+@end
+@implementation Controller {
+void (^Block)(void);
+}
+- (void)View:(View1 *)View foo:(W *)W
+{
+  // The reference from inside the block implicitly creates another
+  // local variable for the referenced member. That is what gets
+  // suppressed by the attribute.  It still gets debug info as a
+  // member, though.
+  // CHECK-NOT: !DILocalVariable(name: "weakSelf"
+  // CHECK: !DIDerivedType({{.*}} name: "weakSelf"
+  // CHECK-NOT: !DILocalVariable(name: "weakSelf"
+  __attribute__((nodebug)) __typeof(self) weakSelf = self;
+  Block = [^{
+__typeof(self) strongSelf = weakSelf;
+} copy];
+}
+@end
Index: test/CodeGenCXX/debug-info-nodebug.cpp
===
--- test/CodeGenCXX/debug-info-nodebug.cpp
+++ test/CodeGenCXX/debug-info-nodebug.cpp
@@ -44,9 +44,12 @@
 // YESINFO-DAG: !DIDerivedType({{.*}} name: "static_const_member"
 // NOINFO-NOT:  !DIDerivedType({{.*}} name: "static_const_member"
 
-// Function-local static variable.
+// Function-local static and auto variables.
 void func4() {
   NODEBUG static int static_local = 6;
+  NODEBUGint normal_local = 7;
 }
 // YESINFO-DAG: !DIGlobalVariable(name: "static_local"
 // NOINFO-NOT:  !DIGlobalVariable(name: "static_local"
+// YESINFO-DAG: !DILocalVariable(name: "normal_local"
+// NOINFO-NOT:  !DILocalVariable(name: "normal_local"
Index: lib/CodeGen/CGDebugInfo.cpp
===
--- lib/CodeGen/CGDebugInfo.cpp
+++ lib/CodeGen/CGDebugInfo.cpp
@@ -3019,6 +3019,8 @@
   CGBuilderTy &Builder) {
   assert(DebugKind >= codegenoptions::LimitedDebugInfo);
   assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!");
+  if (VD->hasAttr())
+return;
 
   bool Unwritten =
   VD->isImplicit() || (isa(VD->getDeclContext()) &&
@@ -3163,6 +3165,8 @@
 
   if (Builder.GetInsertBlock() == nullptr)
 return;
+  if (VD->hasAttr())
+return;
 
   bool isByRef = VD->hasAttr();
 
Index: include/clang/Basic/AttrDocs.td
===
--- include/clang/Basic/AttrDocs.td
+++ include/clang/Basic/AttrDocs.td
@@ -524,8 +524,8 @@
   let Category = DocCatVariable;
   let Content = [{
 The ``nodebug`` attribute allows you to suppress debugging information for a
-function, or for a variable declared with static storage duration, such as
-globals, class static data members, and static locals.
+function or method, or for a variable that is not a parameter or a non-static
+data member.
   }];
 }
 
Index: include/clang/Basic/Attr.td
===
--- include/clang/Basic/Attr.td
+++ include/clang/Basic/Attr.td
@@ -82,6 +82,8 @@
 S->getKind() != Decl::ImplicitParam &&
 S->getKind() != Decl::ParmVar &&
   

Re: [PATCH] D21419: [CUDA] Don't pass top-level -march down to device cc1 or ptxas.

2016-06-15 Thread Artem Belevich via cfe-commits
tra added inline comments.


Comment at: test/Driver/cuda-march.cu:15-16
@@ +14,4 @@
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=skylake 
--cuda-gpu-arch=sm_30 %s 2>&1 | \
+// RUN: FileCheck -check-prefix SKYLAKE -check-prefix SM30 %s
+

These look redundant -- we only care whether we eliminate -march on device 
side. It does not depend on the value of -march or on particular GPU arch. What 
do I miss?


http://reviews.llvm.org/D21419



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


Re: [PATCH] D21390: redefinition of '__true_type' struct __true_type {}; - Bug 27991

2016-06-15 Thread Richard Smith via cfe-commits
rsmith added inline comments.


Comment at: include/llvm/module.modulemap:121-126
@@ -106,8 +120,8 @@
 
   // FIXME: Is this the right place for these?
   module Pass { header "Pass.h" export * }
   module PassSupport { header "PassSupport.h" export * }
   module PassAnalysisSupport { header "PassAnalysisSupport.h" export * }
   module PassRegistry { header "PassRegistry.h" export * }
   module InitializePasses { header "InitializePasses.h" export * }
 

You should be able to remove all of these too.


Repository:
  rL LLVM

http://reviews.llvm.org/D21390



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


Re: [PATCH] D21390: redefinition of '__true_type' struct __true_type {}; - Bug 27991

2016-06-15 Thread Richard Smith via cfe-commits
rsmith accepted this revision.
rsmith added a reviewer: rsmith.
rsmith added a comment.
This revision is now accepted and ready to land.

Makes sense to me.


Repository:
  rL LLVM

http://reviews.llvm.org/D21390



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


[PATCH] D21419: [CUDA] Don't pass top-level -march down to device cc1 or ptxas.

2016-06-15 Thread Justin Lebar via cfe-commits
jlebar created this revision.
jlebar added a reviewer: tra.
jlebar added subscribers: echristo, cfe-commits.

Previously if you did e.g.

  $ clang -march=haswell -x cuda foo.cu

we would pass "-march=haswell -march=sm_20" down to the ptxas tool.
This causes it to assert, and rightly so!

http://reviews.llvm.org/D21419

Files:
  lib/Driver/ToolChains.cpp
  test/Driver/cuda-march.cu

Index: test/Driver/cuda-march.cu
===
--- /dev/null
+++ test/Driver/cuda-march.cu
@@ -0,0 +1,38 @@
+// Checks that cuda compilation does the right thing when passed -march.
+// (Specifically, we want to pass it to host compilation, but not to device
+// compilation or ptxas!)
+//
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: nvptx-registered-target
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell %s 2>&1 | \
+// RUN: FileCheck -check-prefix HASWELL -check-prefix SM20 %s
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_20 %s 2>&1 | \
+// RUN: FileCheck -check-prefix HASWELL -check-prefix SM20 %s
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=skylake 
--cuda-gpu-arch=sm_30 %s 2>&1 | \
+// RUN: FileCheck -check-prefix SKYLAKE -check-prefix SM30 %s
+
+// SM20:clang
+// SM20: "-cc1"
+// SM20-SAME: "-triple" "nvptx
+// SM20-SAME: "-target-cpu" "sm_20"
+// SM20: ptxas
+// SM20-SAME: "--gpu-name" "sm_20"
+
+// SM30:clang
+// SM30: "-cc1"
+// SM30-SAME: "-triple" "nvptx
+// SM30-SAME: "-target-cpu" "sm_30"
+// SM30: ptxas
+// SM30-SAME: "--gpu-name" "sm_30"
+
+// HASWELL:clang
+// HASWELL-SAME: "-cc1"
+// HASWELL-SAME: "-target-cpu" "haswell"
+
+// SKYLAKE:clang
+// SKYLAKE-SAME: "-cc1"
+// SKYLAKE-SAME: "-target-cpu" "skylake"
Index: lib/Driver/ToolChains.cpp
===
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -4676,8 +4676,10 @@
 DAL->append(A);
   }
 
-  if (BoundArch)
+  if (BoundArch) {
+DAL->eraseArg(options::OPT_march_EQ);
 DAL->AddJoinedArg(nullptr, Opts.getOption(options::OPT_march_EQ), 
BoundArch);
+  }
   return DAL;
 }
 


Index: test/Driver/cuda-march.cu
===
--- /dev/null
+++ test/Driver/cuda-march.cu
@@ -0,0 +1,38 @@
+// Checks that cuda compilation does the right thing when passed -march.
+// (Specifically, we want to pass it to host compilation, but not to device
+// compilation or ptxas!)
+//
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: nvptx-registered-target
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell %s 2>&1 | \
+// RUN: FileCheck -check-prefix HASWELL -check-prefix SM20 %s
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_20 %s 2>&1 | \
+// RUN: FileCheck -check-prefix HASWELL -check-prefix SM20 %s
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -march=skylake --cuda-gpu-arch=sm_30 %s 2>&1 | \
+// RUN: FileCheck -check-prefix SKYLAKE -check-prefix SM30 %s
+
+// SM20:clang
+// SM20: "-cc1"
+// SM20-SAME: "-triple" "nvptx
+// SM20-SAME: "-target-cpu" "sm_20"
+// SM20: ptxas
+// SM20-SAME: "--gpu-name" "sm_20"
+
+// SM30:clang
+// SM30: "-cc1"
+// SM30-SAME: "-triple" "nvptx
+// SM30-SAME: "-target-cpu" "sm_30"
+// SM30: ptxas
+// SM30-SAME: "--gpu-name" "sm_30"
+
+// HASWELL:clang
+// HASWELL-SAME: "-cc1"
+// HASWELL-SAME: "-target-cpu" "haswell"
+
+// SKYLAKE:clang
+// SKYLAKE-SAME: "-cc1"
+// SKYLAKE-SAME: "-target-cpu" "skylake"
Index: lib/Driver/ToolChains.cpp
===
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -4676,8 +4676,10 @@
 DAL->append(A);
   }
 
-  if (BoundArch)
+  if (BoundArch) {
+DAL->eraseArg(options::OPT_march_EQ);
 DAL->AddJoinedArg(nullptr, Opts.getOption(options::OPT_march_EQ), BoundArch);
+  }
   return DAL;
 }
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17462: Fix a codegen bug for variadic functions with pass_object_size params

2016-06-15 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment.

(: ƃuıd


http://reviews.llvm.org/D17462



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


r272853 - Fix linking of DFSan + coverage.

2016-06-15 Thread Evgeniy Stepanov via cfe-commits
Author: eugenis
Date: Wed Jun 15 18:05:21 2016
New Revision: 272853

URL: http://llvm.org/viewvc/llvm-project?rev=272853&view=rev
Log:
Fix linking of DFSan + coverage.

Broken in r272717 because of no test coverage.

Modified:
cfe/trunk/lib/Driver/SanitizerArgs.cpp
cfe/trunk/test/Driver/sanitizer-ld.c

Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=272853&r1=272852&r2=272853&view=diff
==
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Wed Jun 15 18:05:21 2016
@@ -162,7 +162,7 @@ bool SanitizerArgs::needsUbsanRt() const
   return ((Sanitizers.Mask & NeedsUbsanRt & ~TrapSanitizers.Mask) ||
   CoverageFeatures) &&
  !Sanitizers.has(Address) && !Sanitizers.has(Memory) &&
- !Sanitizers.has(Thread) && !CfiCrossDso;
+ !Sanitizers.has(Thread) && !Sanitizers.has(DataFlow) && !CfiCrossDso;
 }
 
 bool SanitizerArgs::needsCfiRt() const {

Modified: cfe/trunk/test/Driver/sanitizer-ld.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/sanitizer-ld.c?rev=272853&r1=272852&r2=272853&view=diff
==
--- cfe/trunk/test/Driver/sanitizer-ld.c (original)
+++ cfe/trunk/test/Driver/sanitizer-ld.c Wed Jun 15 18:05:21 2016
@@ -293,6 +293,61 @@
 // CHECK-LSAN-ASAN-LINUX: libclang_rt.asan-x86_64
 // CHECK-LSAN-ASAN-LINUX-NOT: libclang_rt.lsan
 
+// RUN: %clang -fsanitize=address -fsanitize-coverage=func %s -### -o %t.o 
2>&1 \
+// RUN: -target x86_64-unknown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-ASAN-COV-LINUX %s
+// CHECK-ASAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
+// CHECK-ASAN-COV-LINUX: "-whole-archive" "{{.*}}libclang_rt.asan-x86_64.a" 
"-no-whole-archive"
+// CHECK-ASAN-COV-LINUX: "--dynamic-list={{.*}}libclang_rt.asan-x86_64.a.syms"
+// CHECK-ASAN-COV-LINUX-NOT: libclang_rt.ubsan
+// CHECK-ASAN-COV-LINUX-NOT: "-lstdc++"
+// CHECK-ASAN-COV-LINUX: "-lpthread"
+
+// RUN: %clang -fsanitize=memory -fsanitize-coverage=func %s -### -o %t.o 2>&1 
\
+// RUN: -target x86_64-unknown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-MSAN-COV-LINUX %s
+// CHECK-MSAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
+// CHECK-MSAN-COV-LINUX: "-whole-archive" "{{.*}}libclang_rt.msan-x86_64.a" 
"-no-whole-archive"
+// CHECK-MSAN-COV-LINUX: "--dynamic-list={{.*}}libclang_rt.msan-x86_64.a.syms"
+// CHECK-MSAN-COV-LINUX-NOT: libclang_rt.ubsan
+// CHECK-MSAN-COV-LINUX-NOT: "-lstdc++"
+// CHECK-MSAN-COV-LINUX: "-lpthread"
+
+// RUN: %clang -fsanitize=dataflow -fsanitize-coverage=func %s -### -o %t.o 
2>&1 \
+// RUN: -target x86_64-unknown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-DFSAN-COV-LINUX %s
+// CHECK-DFSAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
+// CHECK-DFSAN-COV-LINUX: "-whole-archive" "{{.*}}libclang_rt.dfsan-x86_64.a" 
"-no-whole-archive"
+// CHECK-DFSAN-COV-LINUX: 
"--dynamic-list={{.*}}libclang_rt.dfsan-x86_64.a.syms"
+// CHECK-DFSAN-COV-LINUX-NOT: libclang_rt.ubsan
+// CHECK-DFSAN-COV-LINUX-NOT: "-lstdc++"
+// CHECK-DFSAN-COV-LINUX: "-lpthread"
+
+// RUN: %clang -fsanitize=undefined -fsanitize-coverage=func %s -### -o %t.o 
2>&1 \
+// RUN: -target x86_64-unknown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-COV-LINUX %s
+// CHECK-UBSAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
+// CHECK-UBSAN-COV-LINUX: "-whole-archive" 
"{{.*}}libclang_rt.ubsan_standalone-x86_64.a" "-no-whole-archive"
+// CHECK-UBSAN-COV-LINUX: 
"--dynamic-list={{.*}}libclang_rt.ubsan_standalone-x86_64.a.syms"
+// CHECK-UBSAN-COV-LINUX-NOT: libclang_rt.ubsan
+// CHECK-UBSAN-COV-LINUX-NOT: "-lstdc++"
+// CHECK-UBSAN-COV-LINUX: "-lpthread"
+
+// RUN: %clang -fsanitize-coverage=func %s -### -o %t.o 2>&1 \
+// RUN: -target x86_64-unknown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-COV-LINUX %s
+// CHECK-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
+// CHECK-COV-LINUX: "-whole-archive" 
"{{.*}}libclang_rt.ubsan_standalone-x86_64.a" "-no-whole-archive"
+// CHECK-COV-LINUX: 
"--dynamic-list={{.*}}libclang_rt.ubsan_standalone-x86_64.a.syms"
+// CHECK-COV-LINUX-NOT: libclang_rt.ubsan
+// CHECK-COV-LINUX-NOT: "-lstdc++"
+// CHECK-COV-LINUX: "-lpthread"
+
 // CFI by itself does not link runtime libraries.
 // RUN: %clang -fsanitize=cfi %s -### -o %t.o 2>&1 \
 // RUN: -target x86_64-unknown-linux \


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


Re: [clang-tools-extra] r272816 - clang-rename: implement renaming of classes with a dtor

2016-06-15 Thread Artem Belevich via cfe-commits
Should be fixed in r272852

--Artem

On Wed, Jun 15, 2016 at 3:16 PM, Artem Belevich  wrote:

> Miklos,
>
> TokenName produces unused variable warning in builds with asserts disabled.
> Could you add LLVM_ATTRIBUTE_UNUSED to it?
>
> Thanks,
> --Artem
>
>
> On Wed, Jun 15, 2016 at 11:35 AM, Miklos Vajna via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> Author: vmiklos
>> Date: Wed Jun 15 13:35:41 2016
>> New Revision: 272816
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=272816&view=rev
>> Log:
>> clang-rename: implement renaming of classes with a dtor
>>
>> The declaration wasn't renamed. Also neither part of the declaration
>> wasn't renamed.
>>
>> Reviewers: klimek
>>
>> Differential Revision: http://reviews.llvm.org/D21364
>>
>> Added:
>> clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp
>> Modified:
>> clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
>>
>> Modified: clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp?rev=272816&r1=272815&r2=272816&view=diff
>>
>> ==
>> --- clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp (original)
>> +++ clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp Wed Jun 15
>> 13:35:41 2016
>> @@ -87,6 +87,28 @@ public:
>>  return true;
>>}
>>
>> +  bool VisitCXXDestructorDecl(clang::CXXDestructorDecl *DestructorDecl) {
>> +if (getUSRForDecl(DestructorDecl->getParent()) == USR) {
>> +  // Handles "~Foo" from "Foo::~Foo".
>> +  SourceLocation Location = DestructorDecl->getLocation();
>> +  const ASTContext &Context = DestructorDecl->getASTContext();
>> +  StringRef TokenName = Lexer::getSourceText(
>> +  CharSourceRange::getTokenRange(Location),
>> Context.getSourceManager(),
>> +  Context.getLangOpts());
>> +  // 1 is the length of the "~" string that is not to be touched by
>> the
>> +  // rename.
>> +  assert(TokenName.startswith("~"));
>> +  LocationsFound.push_back(Location.getLocWithOffset(1));
>> +
>> +  if (DestructorDecl->isThisDeclarationADefinition()) {
>> +// Handles "Foo" from "Foo::~Foo".
>> +LocationsFound.push_back(DestructorDecl->getLocStart());
>> +  }
>> +}
>> +
>> +return true;
>> +  }
>> +
>>// Expression visitors:
>>
>>bool VisitDeclRefExpr(const DeclRefExpr *Expr) {
>>
>> Added: clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp?rev=272816&view=auto
>>
>> ==
>> --- clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp (added)
>> +++ clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp Wed Jun 15
>> 13:35:41 2016
>> @@ -0,0 +1,17 @@
>> +// RUN: cat %s > %t.cpp
>> +// RUN: clang-rename -offset=135 -new-name=Bar %t.cpp -i --
>> +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
>> +class Foo {
>> +public:
>> +  Foo();
>> +  ~Foo(); // CHECK: ~Bar();
>> +};
>> +
>> +Foo::Foo() {
>> +}
>> +
>> +Foo::~Foo() { // CHECK: Bar::~Bar()
>> +}
>> +
>> +// Use grep -FUbo 'Foo'  to get the correct offset of foo when
>> changing
>> +// this file.
>>
>>
>> ___
>> cfe-commits mailing list
>> cfe-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>
>
>
> --
> --Artem Belevich
>



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


[clang-tools-extra] r272852 - [clang-tools] mark TokenName as unused

2016-06-15 Thread Artem Belevich via cfe-commits
Author: tra
Date: Wed Jun 15 18:04:42 2016
New Revision: 272852

URL: http://llvm.org/viewvc/llvm-project?rev=272852&view=rev
Log:
[clang-tools] mark TokenName as unused

Otherwise it produces compiler warning if asserts are disabled.

Modified:
clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp

Modified: clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp?rev=272852&r1=272851&r2=272852&view=diff
==
--- clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp (original)
+++ clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp Wed Jun 15 18:04:42 
2016
@@ -92,7 +92,7 @@ public:
   // Handles "~Foo" from "Foo::~Foo".
   SourceLocation Location = DestructorDecl->getLocation();
   const ASTContext &Context = DestructorDecl->getASTContext();
-  StringRef TokenName = Lexer::getSourceText(
+  StringRef LLVM_ATTRIBUTE_UNUSED TokenName = Lexer::getSourceText(
   CharSourceRange::getTokenRange(Location), Context.getSourceManager(),
   Context.getLangOpts());
   // 1 is the length of the "~" string that is not to be touched by the


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


Re: [clang-tools-extra] r272816 - clang-rename: implement renaming of classes with a dtor

2016-06-15 Thread Artem Belevich via cfe-commits
Miklos,

TokenName produces unused variable warning in builds with asserts disabled.
Could you add LLVM_ATTRIBUTE_UNUSED to it?

Thanks,
--Artem


On Wed, Jun 15, 2016 at 11:35 AM, Miklos Vajna via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: vmiklos
> Date: Wed Jun 15 13:35:41 2016
> New Revision: 272816
>
> URL: http://llvm.org/viewvc/llvm-project?rev=272816&view=rev
> Log:
> clang-rename: implement renaming of classes with a dtor
>
> The declaration wasn't renamed. Also neither part of the declaration
> wasn't renamed.
>
> Reviewers: klimek
>
> Differential Revision: http://reviews.llvm.org/D21364
>
> Added:
> clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp
> Modified:
> clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
>
> Modified: clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp?rev=272816&r1=272815&r2=272816&view=diff
>
> ==
> --- clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp (original)
> +++ clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp Wed Jun 15
> 13:35:41 2016
> @@ -87,6 +87,28 @@ public:
>  return true;
>}
>
> +  bool VisitCXXDestructorDecl(clang::CXXDestructorDecl *DestructorDecl) {
> +if (getUSRForDecl(DestructorDecl->getParent()) == USR) {
> +  // Handles "~Foo" from "Foo::~Foo".
> +  SourceLocation Location = DestructorDecl->getLocation();
> +  const ASTContext &Context = DestructorDecl->getASTContext();
> +  StringRef TokenName = Lexer::getSourceText(
> +  CharSourceRange::getTokenRange(Location),
> Context.getSourceManager(),
> +  Context.getLangOpts());
> +  // 1 is the length of the "~" string that is not to be touched by
> the
> +  // rename.
> +  assert(TokenName.startswith("~"));
> +  LocationsFound.push_back(Location.getLocWithOffset(1));
> +
> +  if (DestructorDecl->isThisDeclarationADefinition()) {
> +// Handles "Foo" from "Foo::~Foo".
> +LocationsFound.push_back(DestructorDecl->getLocStart());
> +  }
> +}
> +
> +return true;
> +  }
> +
>// Expression visitors:
>
>bool VisitDeclRefExpr(const DeclRefExpr *Expr) {
>
> Added: clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp?rev=272816&view=auto
>
> ==
> --- clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp (added)
> +++ clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp Wed Jun 15
> 13:35:41 2016
> @@ -0,0 +1,17 @@
> +// RUN: cat %s > %t.cpp
> +// RUN: clang-rename -offset=135 -new-name=Bar %t.cpp -i --
> +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +class Foo {
> +public:
> +  Foo();
> +  ~Foo(); // CHECK: ~Bar();
> +};
> +
> +Foo::Foo() {
> +}
> +
> +Foo::~Foo() { // CHECK: Bar::~Bar()
> +}
> +
> +// Use grep -FUbo 'Foo'  to get the correct offset of foo when
> changing
> +// this file.
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>



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


Re: [PATCH] D21030: [Sema] Fix rejects-valid where parameter pack was not expanded in type alias

2016-06-15 Thread Erik Pilkington via cfe-commits
erik.pilkington updated this revision to Diff 60908.
erik.pilkington added a comment.

This new patch replaces the call to `RebuildPackExpansion` with a direct call 
to `getPackExpansionType`. Also use `None` instead of `NumExpansions` as 
argument.

As far as the `assert(*NumExpansions == 1)`, I don't believe that is always the 
case. Consider:

  template struct Foo {};
  template using FooAlias = Foo;
  template using FooAliasAlias = FooAlias;

Here, the `Ts` in `FooAlias` are expanded into 2 `Us` in `FooAliasAlias`, 
meaning that there are 2 expansions that need to be separately rebuilt. I added 
this case to the test file.

Thanks for the review!


http://reviews.llvm.org/D21030

Files:
  lib/Sema/TreeTransform.h
  test/CXX/temp/temp.decls/temp.variadic/p5.cpp

Index: test/CXX/temp/temp.decls/temp.variadic/p5.cpp
===
--- test/CXX/temp/temp.decls/temp.variadic/p5.cpp
+++ test/CXX/temp/temp.decls/temp.variadic/p5.cpp
@@ -437,3 +437,35 @@
   template void g<>();
   template void g<1, 2, 3>();
 }
+
+template 
+int var_expr(Ts... ts);
+
+template 
+auto a_function(Ts... ts) -> decltype(var_expr(ts...));
+
+template 
+using partial = decltype(a_function);
+
+int use_partial() { partial n; }
+
+namespace PR26017 {
+template 
+struct Foo {};
+template 
+using FooAlias = Foo;
+
+template 
+using FooAliasAlias = FooAlias;
+
+template 
+void bar(const FooAlias &) {}
+
+int fn() {
+  FooAlias<> a;
+  bar(a);
+
+  FooAlias b;
+  bar(b);
+}
+}
Index: lib/Sema/TreeTransform.h
===
--- lib/Sema/TreeTransform.h
+++ lib/Sema/TreeTransform.h
@@ -3310,8 +3310,6 @@
 if (Out.isInvalid())
   return true;
 
-// FIXME: Can this happen? We should not try to expand the pack
-// in this case.
 if (Out.get()->containsUnexpandedParameterPack()) {
   Out = getDerived().RebuildPackExpansion(
   Out.get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
@@ -4780,6 +4778,14 @@
   if (NewType.isNull())
 return true;
 
+  if (NewType->containsUnexpandedParameterPack()) {
+NewType =
+getSema().getASTContext().getPackExpansionType(NewType, None);
+
+if (NewType.isNull())
+  return true;
+  }
+
   if (ParamInfos)
 PInfos.set(OutParamTypes.size(), ParamInfos[i]);
   OutParamTypes.push_back(NewType);


Index: test/CXX/temp/temp.decls/temp.variadic/p5.cpp
===
--- test/CXX/temp/temp.decls/temp.variadic/p5.cpp
+++ test/CXX/temp/temp.decls/temp.variadic/p5.cpp
@@ -437,3 +437,35 @@
   template void g<>();
   template void g<1, 2, 3>();
 }
+
+template 
+int var_expr(Ts... ts);
+
+template 
+auto a_function(Ts... ts) -> decltype(var_expr(ts...));
+
+template 
+using partial = decltype(a_function);
+
+int use_partial() { partial n; }
+
+namespace PR26017 {
+template 
+struct Foo {};
+template 
+using FooAlias = Foo;
+
+template 
+using FooAliasAlias = FooAlias;
+
+template 
+void bar(const FooAlias &) {}
+
+int fn() {
+  FooAlias<> a;
+  bar(a);
+
+  FooAlias b;
+  bar(b);
+}
+}
Index: lib/Sema/TreeTransform.h
===
--- lib/Sema/TreeTransform.h
+++ lib/Sema/TreeTransform.h
@@ -3310,8 +3310,6 @@
 if (Out.isInvalid())
   return true;
 
-// FIXME: Can this happen? We should not try to expand the pack
-// in this case.
 if (Out.get()->containsUnexpandedParameterPack()) {
   Out = getDerived().RebuildPackExpansion(
   Out.get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
@@ -4780,6 +4778,14 @@
   if (NewType.isNull())
 return true;
 
+  if (NewType->containsUnexpandedParameterPack()) {
+NewType =
+getSema().getASTContext().getPackExpansionType(NewType, None);
+
+if (NewType.isNull())
+  return true;
+  }
+
   if (ParamInfos)
 PInfos.set(OutParamTypes.size(), ParamInfos[i]);
   OutParamTypes.push_back(NewType);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20748: Handle recursion in LLVMIRGeneration Timer

2016-06-15 Thread Davide Italiano via cfe-commits
davide added a comment.

ping?


http://reviews.llvm.org/D20748



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


Re: [PATCH] D21268: [x86] translate SSE packed FP comparison builtins to IR

2016-06-15 Thread Sanjay Patel via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272840: [x86] translate SSE packed FP comparison builtins to 
IR (authored by spatel).

Changed prior to commit:
  http://reviews.llvm.org/D21268?vs=60473&id=60905#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21268

Files:
  cfe/trunk/lib/CodeGen/CGBuiltin.cpp
  cfe/trunk/test/CodeGen/avx2-builtins.c
  cfe/trunk/test/CodeGen/sse-builtins.c
  cfe/trunk/test/CodeGen/sse2-builtins.c

Index: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
===
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp
@@ -6419,6 +6419,36 @@
 Ops.push_back(llvm::ConstantInt::get(getLLVMContext(), Result));
   }
 
+  // These exist so that the builtin that takes an immediate can be bounds
+  // checked by clang to avoid passing bad immediates to the backend. Since
+  // AVX has a larger immediate than SSE we would need separate builtins to
+  // do the different bounds checking. Rather than create a clang specific
+  // SSE only builtin, this implements eight separate builtins to match gcc
+  // implementation.
+  auto getCmpIntrinsicCall = [this, &Ops](Intrinsic::ID ID, unsigned Imm) {
+Ops.push_back(llvm::ConstantInt::get(Int8Ty, Imm));
+llvm::Function *F = CGM.getIntrinsic(ID);
+return Builder.CreateCall(F, Ops);
+  };
+
+  // For the vector forms of FP comparisons, translate the builtins directly to
+  // IR.
+  // TODO: The builtins could be removed if the SSE header files used vector
+  // extension comparisons directly (vector ordered/unordered may need
+  // additional support via __builtin_isnan()).
+  llvm::VectorType *V2F64 =
+  llvm::VectorType::get(llvm::Type::getDoubleTy(getLLVMContext()), 2);
+  llvm::VectorType *V4F32 =
+  llvm::VectorType::get(llvm::Type::getFloatTy(getLLVMContext()), 4);
+
+  auto getVectorFCmpIR = [this, &Ops](CmpInst::Predicate Pred,
+  llvm::VectorType *FPVecTy) {
+Value *Cmp = Builder.CreateFCmp(Pred, Ops[0], Ops[1]);
+llvm::VectorType *IntVecTy = llvm::VectorType::getInteger(FPVecTy);
+Value *Sext = Builder.CreateSExt(Cmp, IntVecTy);
+return Builder.CreateBitCast(Sext, FPVecTy);
+  };
+
   switch (BuiltinID) {
   default: return nullptr;
   case X86::BI__builtin_cpu_supports: {
@@ -6857,154 +6887,74 @@
   Ops[0]);
 return Builder.CreateExtractValue(Call, 1);
   }
-  // SSE comparison intrisics
+
+  // SSE packed comparison intrinsics
   case X86::BI__builtin_ia32_cmpeqps:
+return getVectorFCmpIR(CmpInst::FCMP_OEQ, V4F32);
   case X86::BI__builtin_ia32_cmpltps:
+return getVectorFCmpIR(CmpInst::FCMP_OLT, V4F32);
   case X86::BI__builtin_ia32_cmpleps:
+return getVectorFCmpIR(CmpInst::FCMP_OLE, V4F32);
   case X86::BI__builtin_ia32_cmpunordps:
+return getVectorFCmpIR(CmpInst::FCMP_UNO, V4F32);
   case X86::BI__builtin_ia32_cmpneqps:
+return getVectorFCmpIR(CmpInst::FCMP_UNE, V4F32);
   case X86::BI__builtin_ia32_cmpnltps:
+return getVectorFCmpIR(CmpInst::FCMP_UGE, V4F32);
   case X86::BI__builtin_ia32_cmpnleps:
+return getVectorFCmpIR(CmpInst::FCMP_UGT, V4F32);
   case X86::BI__builtin_ia32_cmpordps:
-  case X86::BI__builtin_ia32_cmpeqss:
-  case X86::BI__builtin_ia32_cmpltss:
-  case X86::BI__builtin_ia32_cmpless:
-  case X86::BI__builtin_ia32_cmpunordss:
-  case X86::BI__builtin_ia32_cmpneqss:
-  case X86::BI__builtin_ia32_cmpnltss:
-  case X86::BI__builtin_ia32_cmpnless:
-  case X86::BI__builtin_ia32_cmpordss:
+return getVectorFCmpIR(CmpInst::FCMP_ORD, V4F32);
   case X86::BI__builtin_ia32_cmpeqpd:
+return getVectorFCmpIR(CmpInst::FCMP_OEQ, V2F64);
   case X86::BI__builtin_ia32_cmpltpd:
+return getVectorFCmpIR(CmpInst::FCMP_OLT, V2F64);
   case X86::BI__builtin_ia32_cmplepd:
+return getVectorFCmpIR(CmpInst::FCMP_OLE, V2F64);
   case X86::BI__builtin_ia32_cmpunordpd:
+return getVectorFCmpIR(CmpInst::FCMP_UNO, V2F64);
   case X86::BI__builtin_ia32_cmpneqpd:
+return getVectorFCmpIR(CmpInst::FCMP_UNE, V2F64);
   case X86::BI__builtin_ia32_cmpnltpd:
+return getVectorFCmpIR(CmpInst::FCMP_UGE, V2F64);
   case X86::BI__builtin_ia32_cmpnlepd:
+return getVectorFCmpIR(CmpInst::FCMP_UGT, V2F64);
   case X86::BI__builtin_ia32_cmpordpd:
+return getVectorFCmpIR(CmpInst::FCMP_ORD, V2F64);
+
+  // SSE scalar comparison intrinsics
+  case X86::BI__builtin_ia32_cmpeqss:
+return getCmpIntrinsicCall(Intrinsic::x86_sse_cmp_ss, 0);
+  case X86::BI__builtin_ia32_cmpltss:
+return getCmpIntrinsicCall(Intrinsic::x86_sse_cmp_ss, 1);
+  case X86::BI__builtin_ia32_cmpless:
+return getCmpIntrinsicCall(Intrinsic::x86_sse_cmp_ss, 2);
+  case X86::BI__builtin_ia32_cmpunordss:
+return getCmpIntrinsicCall(Intrinsic::x86_sse_cmp_ss, 3);
+  case X86::BI__builtin_ia32_cmpneqss:
+return getCmpIntrinsicCall(Intrinsic::x86_sse_cmp_ss, 4);
+  case X86::BI__builtin_ia

r272840 - [x86] translate SSE packed FP comparison builtins to IR

2016-06-15 Thread Sanjay Patel via cfe-commits
Author: spatel
Date: Wed Jun 15 16:20:04 2016
New Revision: 272840

URL: http://llvm.org/viewvc/llvm-project?rev=272840&view=rev
Log:
[x86] translate SSE packed FP comparison builtins to IR

As noted in the code comment, a potential follow-on would be to remove
the builtins themselves. Other than ord/unord, this already works as 
expected. Eg:

  typedef float v4sf __attribute__((__vector_size__(16)));
  v4sf fcmpgt(v4sf a, v4sf b) { return a > b; }

Differential Revision: http://reviews.llvm.org/D21268

Modified:
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/test/CodeGen/avx2-builtins.c
cfe/trunk/test/CodeGen/sse-builtins.c
cfe/trunk/test/CodeGen/sse2-builtins.c

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=272840&r1=272839&r2=272840&view=diff
==
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Wed Jun 15 16:20:04 2016
@@ -6419,6 +6419,36 @@ Value *CodeGenFunction::EmitX86BuiltinEx
 Ops.push_back(llvm::ConstantInt::get(getLLVMContext(), Result));
   }
 
+  // These exist so that the builtin that takes an immediate can be bounds
+  // checked by clang to avoid passing bad immediates to the backend. Since
+  // AVX has a larger immediate than SSE we would need separate builtins to
+  // do the different bounds checking. Rather than create a clang specific
+  // SSE only builtin, this implements eight separate builtins to match gcc
+  // implementation.
+  auto getCmpIntrinsicCall = [this, &Ops](Intrinsic::ID ID, unsigned Imm) {
+Ops.push_back(llvm::ConstantInt::get(Int8Ty, Imm));
+llvm::Function *F = CGM.getIntrinsic(ID);
+return Builder.CreateCall(F, Ops);
+  };
+
+  // For the vector forms of FP comparisons, translate the builtins directly to
+  // IR.
+  // TODO: The builtins could be removed if the SSE header files used vector
+  // extension comparisons directly (vector ordered/unordered may need
+  // additional support via __builtin_isnan()).
+  llvm::VectorType *V2F64 =
+  llvm::VectorType::get(llvm::Type::getDoubleTy(getLLVMContext()), 2);
+  llvm::VectorType *V4F32 =
+  llvm::VectorType::get(llvm::Type::getFloatTy(getLLVMContext()), 4);
+
+  auto getVectorFCmpIR = [this, &Ops](CmpInst::Predicate Pred,
+  llvm::VectorType *FPVecTy) {
+Value *Cmp = Builder.CreateFCmp(Pred, Ops[0], Ops[1]);
+llvm::VectorType *IntVecTy = llvm::VectorType::getInteger(FPVecTy);
+Value *Sext = Builder.CreateSExt(Cmp, IntVecTy);
+return Builder.CreateBitCast(Sext, FPVecTy);
+  };
+
   switch (BuiltinID) {
   default: return nullptr;
   case X86::BI__builtin_cpu_supports: {
@@ -6857,154 +6887,74 @@ Value *CodeGenFunction::EmitX86BuiltinEx
   Ops[0]);
 return Builder.CreateExtractValue(Call, 1);
   }
-  // SSE comparison intrisics
+
+  // SSE packed comparison intrinsics
   case X86::BI__builtin_ia32_cmpeqps:
+return getVectorFCmpIR(CmpInst::FCMP_OEQ, V4F32);
   case X86::BI__builtin_ia32_cmpltps:
+return getVectorFCmpIR(CmpInst::FCMP_OLT, V4F32);
   case X86::BI__builtin_ia32_cmpleps:
+return getVectorFCmpIR(CmpInst::FCMP_OLE, V4F32);
   case X86::BI__builtin_ia32_cmpunordps:
+return getVectorFCmpIR(CmpInst::FCMP_UNO, V4F32);
   case X86::BI__builtin_ia32_cmpneqps:
+return getVectorFCmpIR(CmpInst::FCMP_UNE, V4F32);
   case X86::BI__builtin_ia32_cmpnltps:
+return getVectorFCmpIR(CmpInst::FCMP_UGE, V4F32);
   case X86::BI__builtin_ia32_cmpnleps:
+return getVectorFCmpIR(CmpInst::FCMP_UGT, V4F32);
   case X86::BI__builtin_ia32_cmpordps:
-  case X86::BI__builtin_ia32_cmpeqss:
-  case X86::BI__builtin_ia32_cmpltss:
-  case X86::BI__builtin_ia32_cmpless:
-  case X86::BI__builtin_ia32_cmpunordss:
-  case X86::BI__builtin_ia32_cmpneqss:
-  case X86::BI__builtin_ia32_cmpnltss:
-  case X86::BI__builtin_ia32_cmpnless:
-  case X86::BI__builtin_ia32_cmpordss:
+return getVectorFCmpIR(CmpInst::FCMP_ORD, V4F32);
   case X86::BI__builtin_ia32_cmpeqpd:
+return getVectorFCmpIR(CmpInst::FCMP_OEQ, V2F64);
   case X86::BI__builtin_ia32_cmpltpd:
+return getVectorFCmpIR(CmpInst::FCMP_OLT, V2F64);
   case X86::BI__builtin_ia32_cmplepd:
+return getVectorFCmpIR(CmpInst::FCMP_OLE, V2F64);
   case X86::BI__builtin_ia32_cmpunordpd:
+return getVectorFCmpIR(CmpInst::FCMP_UNO, V2F64);
   case X86::BI__builtin_ia32_cmpneqpd:
+return getVectorFCmpIR(CmpInst::FCMP_UNE, V2F64);
   case X86::BI__builtin_ia32_cmpnltpd:
+return getVectorFCmpIR(CmpInst::FCMP_UGE, V2F64);
   case X86::BI__builtin_ia32_cmpnlepd:
+return getVectorFCmpIR(CmpInst::FCMP_UGT, V2F64);
   case X86::BI__builtin_ia32_cmpordpd:
+return getVectorFCmpIR(CmpInst::FCMP_ORD, V2F64);
+
+  // SSE scalar comparison intrinsics
+  case X86::BI__builtin_ia32_cmpeqss:
+return getCmpIntrinsicCall(Intrinsic::x86_

[PATCH] D21407: Enable building and using atomic shared_ptr for GCC.

2016-06-15 Thread Eric Fiselier via cfe-commits
EricWF created this revision.
EricWF added reviewers: mclow.lists, rmaprath.
EricWF added a subscriber: cfe-commits.

Currently the  implementation of [util.smartptr.shared.atomic] is provided only 
when using Clang, and not with GCC. This is a relic of not having a GCC 
implementation of , even though  isn't actually used in the 
implementation. This patch enables support for atomic shared_ptr functions when 
using GCC.

Note that this is not a header only change. Previously only Clang builds of 
libc++.so would provide the required symbols. There is no reason  for this 
restriction.
After this change both Clang and GCC builds should be binary compatible with 
each other WRT these symbols.


http://reviews.llvm.org/D21407

Files:
  include/memory
  src/memory.cpp

Index: src/memory.cpp
===
--- src/memory.cpp
+++ src/memory.cpp
@@ -124,7 +124,7 @@
 
 #endif  // _LIBCPP_NO_RTTI
 
-#if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
 
 static const std::size_t __sp_mut_count = 16;
 static __libcpp_mutex_t mut_back_imp[__sp_mut_count] =
@@ -177,7 +177,7 @@
 return muts[hash()(p) & (__sp_mut_count-1)];
 }
 
-#endif // defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+#endif // !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
 
 void
 declare_reachable(void*)
Index: include/memory
===
--- include/memory
+++ include/memory
@@ -5464,9 +5464,8 @@
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
 
-// TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
-// enabled with clang.
-#if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+
+#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
 
 class _LIBCPP_TYPE_VIS __sp_mut
 {
@@ -5595,7 +5594,7 @@
 return atomic_compare_exchange_weak(__p, __v, __w);
 }
 
-#endif  // defined(_LIBCPP_HAS_C_ATOMIC_IMP) && 
!defined(_LIBCPP_HAS_NO_THREADS)
+#endif  // !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
 
 //enum class
 struct _LIBCPP_TYPE_VIS pointer_safety


Index: src/memory.cpp
===
--- src/memory.cpp
+++ src/memory.cpp
@@ -124,7 +124,7 @@
 
 #endif  // _LIBCPP_NO_RTTI
 
-#if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
 
 static const std::size_t __sp_mut_count = 16;
 static __libcpp_mutex_t mut_back_imp[__sp_mut_count] =
@@ -177,7 +177,7 @@
 return muts[hash()(p) & (__sp_mut_count-1)];
 }
 
-#endif // defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+#endif // !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
 
 void
 declare_reachable(void*)
Index: include/memory
===
--- include/memory
+++ include/memory
@@ -5464,9 +5464,8 @@
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
 
-// TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
-// enabled with clang.
-#if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+
+#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
 
 class _LIBCPP_TYPE_VIS __sp_mut
 {
@@ -5595,7 +5594,7 @@
 return atomic_compare_exchange_weak(__p, __v, __w);
 }
 
-#endif  // defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+#endif  // !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
 
 //enum class
 struct _LIBCPP_TYPE_VIS pointer_safety
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r272832 - Add support to clang-cl driver for /GS switch

2016-06-15 Thread Etienne Bergeron via cfe-commits
Author: etienneb
Date: Wed Jun 15 15:34:33 2016
New Revision: 272832

URL: http://llvm.org/viewvc/llvm-project?rev=272832&view=rev
Log:
Add support to clang-cl driver for /GS switch

Summary:
This patch is adding command-line support for the MSVC buffer security check.

The buffer security check is turned on with the '/GS' compiler switch.
https://msdn.microsoft.com/en-us/library/8dbf701c.aspx

The MSVC buffer security check in implemented here:
http://reviews.llvm.org/D20346

Reviewers: hans, rnk

Subscribers: chrisha, cfe-commits, rnk, hans, thakis

Differential Revision: http://reviews.llvm.org/D20347

Modified:
cfe/trunk/include/clang/Driver/CLCompatOptions.td
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/cl-fallback.c
cfe/trunk/test/Driver/cl-options.c

Modified: cfe/trunk/include/clang/Driver/CLCompatOptions.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CLCompatOptions.td?rev=272832&r1=272831&r2=272832&view=diff
==
--- cfe/trunk/include/clang/Driver/CLCompatOptions.td (original)
+++ cfe/trunk/include/clang/Driver/CLCompatOptions.td Wed Jun 15 15:34:33 2016
@@ -77,6 +77,8 @@ def _SLASH_GR : CLFlag<"GR">, HelpText<"
 def _SLASH_GR_ : CLFlag<"GR-">, HelpText<"Disable emission of RTTI data">;
 def _SLASH_GF_ : CLFlag<"GF-">, HelpText<"Disable string pooling">,
   Alias;
+def _SLASH_GS : CLFlag<"GS">, HelpText<"Enable buffer security check">;
+def _SLASH_GS_ : CLFlag<"GS-">, HelpText<"Disable buffer security check">;
 def _SLASH_Gs : CLJoined<"Gs">, HelpText<"Set stack probe size">,
   Alias;
 def _SLASH_Gy : CLFlag<"Gy">, HelpText<"Put each function in its own section">,
@@ -287,7 +289,6 @@ def _SLASH_Fd : CLIgnoredJoined<"Fd">;
 def _SLASH_FC : CLIgnoredFlag<"FC">;
 def _SLASH_FS : CLIgnoredFlag<"FS">, HelpText<"Force synchronous PDB writes">;
 def _SLASH_GF : CLIgnoredFlag<"GF">;
-def _SLASH_GS_ : CLIgnoredFlag<"GS-">;
 def _SLASH_kernel_ : CLIgnoredFlag<"kernel-">;
 def _SLASH_nologo : CLIgnoredFlag<"nologo">;
 def _SLASH_Ob1 : CLIgnoredFlag<"Ob1">;
@@ -329,7 +330,6 @@ def _SLASH_GL : CLFlag<"GL">;
 def _SLASH_GL_ : CLFlag<"GL-">;
 def _SLASH_Gm : CLFlag<"Gm">;
 def _SLASH_Gm_ : CLFlag<"Gm-">;
-def _SLASH_GS : CLFlag<"GS">;
 def _SLASH_GT : CLFlag<"GT">;
 def _SLASH_Guard : CLJoined<"guard:">;
 def _SLASH_GZ : CLFlag<"GZ">;

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=272832&r1=272831&r2=272832&view=diff
==
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Jun 15 15:34:33 2016
@@ -6183,6 +6183,14 @@ void Clang::AddClangCLArgs(const ArgList
/*default=*/false))
 CmdArgs.push_back("-fno-rtti-data");
 
+  // This controls whether or not we emit stack-protector instrumentation.
+  // In MSVC, Buffer Security Check (/GS) is on by default.
+  if (Args.hasFlag(options::OPT__SLASH_GS, options::OPT__SLASH_GS_,
+   /*default=*/true)) {
+CmdArgs.push_back("-stack-protector");
+CmdArgs.push_back(Args.MakeArgString(Twine(LangOptions::SSPStrong)));
+  }
+
   // Emit CodeView if -Z7 is present.
   *EmitCodeView = Args.hasArg(options::OPT__SLASH_Z7);
   if (*EmitCodeView)
@@ -10022,6 +10030,11 @@ std::unique_ptr visualstudio::C
   if (Args.hasFlag(options::OPT__SLASH_GR_, options::OPT__SLASH_GR,
/*default=*/false))
 CmdArgs.push_back("/GR-");
+
+  if (Args.hasFlag(options::OPT__SLASH_GS_, options::OPT__SLASH_GS,
+   /*default=*/false))
+CmdArgs.push_back("/GS-");
+
   if (Arg *A = Args.getLastArg(options::OPT_ffunction_sections,
options::OPT_fno_function_sections))
 CmdArgs.push_back(A->getOption().getID() == options::OPT_ffunction_sections

Modified: cfe/trunk/test/Driver/cl-fallback.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-fallback.c?rev=272832&r1=272831&r2=272832&view=diff
==
--- cfe/trunk/test/Driver/cl-fallback.c (original)
+++ cfe/trunk/test/Driver/cl-fallback.c Wed Jun 15 15:34:33 2016
@@ -1,7 +1,7 @@
 // Note: %s must be preceded by --, otherwise it may be interpreted as a
 // command-line option, e.g. on Mac where %s is commonly under /Users.
 
-// RUN: %clang_cl --target=i686-pc-win32 /fallback /Dfoo=bar /Ubaz /Ifoo /O0 
/Ox /GR /GR- /Gy /Gy- \
+// RUN: %clang_cl --target=i686-pc-win32 /fallback /Dfoo=bar /Ubaz /Ifoo /O0 
/Ox /GR /GR- /GS /GS- /Gy /Gy- \
 // RUN:   /Gw /Gw- /LD /LDd /EHs /EHs- /Zl /MD /MDd /MTd /MT /FImyheader.h /Zi 
\
 // RUN:   -garbage -moregarbage \
 // RUN:   -### -- %s 2>&1 \
@@ -22,6 +22,7 @@
 // CHECK: "/Oy"
 // CHECK: "/GF"
 // CHECK: "/GR-"
+// CHECK: "/GS-"
 // CHECK: "/Gy-"
 // CHECK: "/Gw-"
 // CHECK: "/Z7"
@@ -41,6 +42,10 @@
 // GR: cl.exe
 /

[libcxx] r272827 - Add an Android version check for GNU strerror_r.

2016-06-15 Thread Dan Albert via cfe-commits
Author: danalbert
Date: Wed Jun 15 15:20:32 2016
New Revision: 272827

URL: http://llvm.org/viewvc/llvm-project?rev=272827&view=rev
Log:
Add an Android version check for GNU strerror_r.

Summary:
Android didn't gain GNU's strerror_r until Marshmallow. If we're
building libc++ against something older (we build the NDK library
against the oldest release we support, currently Gingerbread), fall
back to the POSIX version.

Reviewers: mclow.lists, EricWF

Subscribers: tberghammer, danalbert, srhines, cfe-commits

Differential Revision: http://reviews.llvm.org/D21402

Modified:
libcxx/trunk/src/system_error.cpp

Modified: libcxx/trunk/src/system_error.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/system_error.cpp?rev=272827&r1=272826&r2=272827&view=diff
==
--- libcxx/trunk/src/system_error.cpp (original)
+++ libcxx/trunk/src/system_error.cpp Wed Jun 15 15:20:32 2016
@@ -21,6 +21,10 @@
 #include "string"
 #include "string.h"
 
+#if defined(__ANDROID__)
+#include 
+#endif
+
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 // class error_category
@@ -58,7 +62,8 @@ constexpr size_t strerror_buff_size = 10
 
 string do_strerror_r(int ev);
 
-#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC)
+#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC)  
\
+&& (!defined(__ANDROID__) || __ANDROID_API__ >= 23)
 // GNU Extended version
 string do_strerror_r(int ev) {
 char buffer[strerror_buff_size];


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


Re: [PATCH] D21402: Add an Android version check for GNU strerror_r.

2016-06-15 Thread Dan Albert via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272827: Add an Android version check for GNU strerror_r. 
(authored by danalbert).

Changed prior to commit:
  http://reviews.llvm.org/D21402?vs=60887&id=60893#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21402

Files:
  libcxx/trunk/src/system_error.cpp

Index: libcxx/trunk/src/system_error.cpp
===
--- libcxx/trunk/src/system_error.cpp
+++ libcxx/trunk/src/system_error.cpp
@@ -21,6 +21,10 @@
 #include "string"
 #include "string.h"
 
+#if defined(__ANDROID__)
+#include 
+#endif
+
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 // class error_category
@@ -58,7 +62,8 @@
 
 string do_strerror_r(int ev);
 
-#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC)
+#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC)  
\
+&& (!defined(__ANDROID__) || __ANDROID_API__ >= 23)
 // GNU Extended version
 string do_strerror_r(int ev) {
 char buffer[strerror_buff_size];


Index: libcxx/trunk/src/system_error.cpp
===
--- libcxx/trunk/src/system_error.cpp
+++ libcxx/trunk/src/system_error.cpp
@@ -21,6 +21,10 @@
 #include "string"
 #include "string.h"
 
+#if defined(__ANDROID__)
+#include 
+#endif
+
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 // class error_category
@@ -58,7 +62,8 @@
 
 string do_strerror_r(int ev);
 
-#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC)
+#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC)  \
+&& (!defined(__ANDROID__) || __ANDROID_API__ >= 23)
 // GNU Extended version
 string do_strerror_r(int ev) {
 char buffer[strerror_buff_size];
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D21402: Add an Android version check for GNU strerror_r.

2016-06-15 Thread Eric Fiselier via cfe-commits
EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.

LGTM.

I would have preferred to always use the POSIX version, but it's impossible to 
turn of GNU extensions without breaking the linux build.


http://reviews.llvm.org/D21402



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


[PATCH] D21402: Add an Android version check for GNU strerror_r.

2016-06-15 Thread Dan Albert via cfe-commits
danalbert created this revision.
danalbert added reviewers: mclow.lists, EricWF.
danalbert added a subscriber: cfe-commits.
Herald added subscribers: srhines, danalbert, tberghammer.

Android didn't gain GNU's strerror_r until Marshmallow. If we're
building libc++ against something older (we build the NDK library
against the oldest release we support, currently Gingerbread), fall
back to the POSIX version.

http://reviews.llvm.org/D21402

Files:
  src/system_error.cpp

Index: src/system_error.cpp
===
--- src/system_error.cpp
+++ src/system_error.cpp
@@ -21,6 +21,10 @@
 #include "string"
 #include "string.h"
 
+#if defined(__ANDROID__)
+#include 
+#endif
+
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 // class error_category
@@ -58,7 +62,8 @@
 
 string do_strerror_r(int ev);
 
-#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC)
+#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC)  
\
+&& (!defined(__ANDROID__) || __ANDROID_API__ >= 23)
 // GNU Extended version
 string do_strerror_r(int ev) {
 char buffer[strerror_buff_size];


Index: src/system_error.cpp
===
--- src/system_error.cpp
+++ src/system_error.cpp
@@ -21,6 +21,10 @@
 #include "string"
 #include "string.h"
 
+#if defined(__ANDROID__)
+#include 
+#endif
+
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 // class error_category
@@ -58,7 +62,8 @@
 
 string do_strerror_r(int ev);
 
-#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC)
+#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC)  \
+&& (!defined(__ANDROID__) || __ANDROID_API__ >= 23)
 // GNU Extended version
 string do_strerror_r(int ev) {
 char buffer[strerror_buff_size];
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [gentoo-musl] Re: Add support for musl-libc on Linux

2016-06-15 Thread Rafael Espíndola via cfe-commits
r272825,

Thanks,
Rafael


On 15 June 2016 at 04:28, Lei Zhang  wrote:
> 2016-06-14 20:55 GMT+08:00 Rafael Espíndola :
>> On 13 June 2016 at 21:07, Lei Zhang  wrote:
>>> 2016-06-14 5:00 GMT+08:00 Rafael Espíndola :
 Do you need someone to commit it for you?
>>>
>>> Yes, please :)
>>
>> Committed.
>
> Thanks!
>
> Here's another patch including test cases for various non-x86 archs,
> which should just work with my previous patches. ARM is left out
> purposely since it involves extra complexity. I'll work on it later.
>
>
> Lei
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r272825 - Add a few Musl related tests that already pass.

2016-06-15 Thread Rafael Espindola via cfe-commits
Author: rafael
Date: Wed Jun 15 15:02:22 2016
New Revision: 272825

URL: http://llvm.org/viewvc/llvm-project?rev=272825&view=rev
Log:
Add a few Musl related tests that already pass.

Patch by Lei Zhang.

Modified:
cfe/trunk/test/Driver/linux-ld.c

Modified: cfe/trunk/test/Driver/linux-ld.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-ld.c?rev=272825&r1=272824&r2=272825&view=diff
==
--- cfe/trunk/test/Driver/linux-ld.c (original)
+++ cfe/trunk/test/Driver/linux-ld.c Wed Jun 15 15:02:22 2016
@@ -1575,9 +1575,33 @@
 // Check dynamic-linker for musl-libc
 // RUN: %clang %s -### -o %t.o 2>&1 \
 // RUN: --target=i386-pc-linux-musl \
-// RUN:   | FileCheck --check-prefix=CHECK-MUSL32 %s
+// RUN:   | FileCheck --check-prefix=CHECK-MUSL-X86 %s
 // RUN: %clang %s -### -o %t.o 2>&1 \
 // RUN: --target=x86_64-pc-linux-musl \
-// RUN:   | FileCheck --check-prefix=CHECK-MUSL64 %s
-// CHECK-MUSL32: "-dynamic-linker" "/lib/ld-musl-i386.so.1"
-// CHECK-MUSL64: "-dynamic-linker" "/lib/ld-musl-x86_64.so.1"
+// RUN:   | FileCheck --check-prefix=CHECK-MUSL-X86_64 %s
+// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-pc-linux-musl \
+// RUN:   | FileCheck --check-prefix=CHECK-MUSL-MIPS %s
+// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-pc-linux-musl \
+// RUN:   | FileCheck --check-prefix=CHECK-MUSL-MIPSEL %s
+// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-pc-linux-musl \
+// RUN:   | FileCheck --check-prefix=CHECK-MUSL-MIPS64 %s
+// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-pc-linux-musl \
+// RUN:   | FileCheck --check-prefix=CHECK-MUSL-MIPS64EL %s
+// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=powerpc-pc-linux-musl \
+// RUN:   | FileCheck --check-prefix=CHECK-MUSL-PPC %s
+// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=powerpc64-pc-linux-musl \
+// RUN:   | FileCheck --check-prefix=CHECK-MUSL-PPC64 %s
+// CHECK-MUSL-X86:  "-dynamic-linker" "/lib/ld-musl-i386.so.1"
+// CHECK-MUSL-X86_64:   "-dynamic-linker" "/lib/ld-musl-x86_64.so.1"
+// CHECK-MUSL-MIPS: "-dynamic-linker" "/lib/ld-musl-mips.so.1"
+// CHECK-MUSL-MIPSEL:   "-dynamic-linker" "/lib/ld-musl-mipsel.so.1"
+// CHECK-MUSL-MIPS64:   "-dynamic-linker" "/lib/ld-musl-mips64.so.1"
+// CHECK-MUSL-MIPS64EL: "-dynamic-linker" "/lib/ld-musl-mips64el.so.1"
+// CHECK-MUSL-PPC:  "-dynamic-linker" "/lib/ld-musl-powerpc.so.1"
+// CHECK-MUSL-PPC64:"-dynamic-linker" "/lib/ld-musl-powerpc64.so.1"


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


[libcxxabi] r272824 - Fix [libcxxabi] Fix warning about uninitialized const member.

2016-06-15 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Wed Jun 15 14:59:16 2016
New Revision: 272824

URL: http://llvm.org/viewvc/llvm-project?rev=272824&view=rev
Log:
Fix [libcxxabi] Fix warning about uninitialized const member.

Modified:
libcxxabi/trunk/test/catch_member_data_pointer_01.pass.cpp

Modified: libcxxabi/trunk/test/catch_member_data_pointer_01.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_member_data_pointer_01.pass.cpp?rev=272824&r1=272823&r2=272824&view=diff
==
--- libcxxabi/trunk/test/catch_member_data_pointer_01.pass.cpp (original)
+++ libcxxabi/trunk/test/catch_member_data_pointer_01.pass.cpp Wed Jun 15 
14:59:16 2016
@@ -13,6 +13,7 @@
 
 struct A
 {
+A() : i(0), j(0) {} // explicitly initialize 'i' to prevent warnings
 const int i;
 int j;
 };
@@ -22,7 +23,7 @@ typedef   int A::*md2;
 
 struct B : public A
 {
-B() : k(42), l(0) {} // explicitly initialize 'k' to prevent warnings.
+B() : k(0), l(0) {} // explicitly initialize 'k' to prevent warnings.
 const int k;
 int l;
 };


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


[libcxxabi] r272823 - Fix warning about uninitialized const member. NFC

2016-06-15 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Wed Jun 15 14:48:26 2016
New Revision: 272823

URL: http://llvm.org/viewvc/llvm-project?rev=272823&view=rev
Log:
Fix warning about uninitialized const member. NFC

Modified:
libcxxabi/trunk/test/catch_member_data_pointer_01.pass.cpp

Modified: libcxxabi/trunk/test/catch_member_data_pointer_01.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_member_data_pointer_01.pass.cpp?rev=272823&r1=272822&r2=272823&view=diff
==
--- libcxxabi/trunk/test/catch_member_data_pointer_01.pass.cpp (original)
+++ libcxxabi/trunk/test/catch_member_data_pointer_01.pass.cpp Wed Jun 15 
14:48:26 2016
@@ -22,6 +22,7 @@ typedef   int A::*md2;
 
 struct B : public A
 {
+B() : k(42), l(0) {} // explicitly initialize 'k' to prevent warnings.
 const int k;
 int l;
 };


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


[libcxx] r272822 - Fix warning in tuple tests. The test suite should now run clean with most warnings enabled

2016-06-15 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Wed Jun 15 14:41:52 2016
New Revision: 272822

URL: http://llvm.org/viewvc/llvm-project?rev=272822&view=rev
Log:
Fix warning in tuple tests. The test suite should now run clean with most 
warnings enabled

Modified:
libcxx/trunk/test/std/utilities/tuple/tuple.general/tuple.smartptr.pass.cpp

Modified: 
libcxx/trunk/test/std/utilities/tuple/tuple.general/tuple.smartptr.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/tuple/tuple.general/tuple.smartptr.pass.cpp?rev=272822&r1=272821&r2=272822&view=diff
==
--- libcxx/trunk/test/std/utilities/tuple/tuple.general/tuple.smartptr.pass.cpp 
(original)
+++ libcxx/trunk/test/std/utilities/tuple/tuple.general/tuple.smartptr.pass.cpp 
Wed Jun 15 14:41:52 2016
@@ -21,18 +21,13 @@ int main () {
 std::tuple> up;
 std::tuple> sp;
 std::tuple> wp;
-// std::tuple> ap;
 }
 {
 std::tuple> up;
 std::tuple> sp;
 std::tuple> wp;
-// std::tuple> ap;
-}
-{
-std::tuple> up;
-std::tuple> sp;
-std::tuple> wp;
-// std::tuple> ap;
 }
+// Smart pointers of type 'T[N]' are not tested here since they are not
+// supported by the standard nor by libc++'s implementation.
+// See http://reviews.llvm.org/D21320 for move information.
 }
\ No newline at end of file


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


Re: [PATCH] D21396: [libcxxabi] Reorder base class initializers in libc++abi tests to prevent -Wreorder

2016-06-15 Thread Eric Fiselier via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272821: [libcxxabi] Reorder base class initializers in 
libc++abi tests to prevent… (authored by EricWF).

Changed prior to commit:
  http://reviews.llvm.org/D21396?vs=60876&id=60881#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21396

Files:
  libcxxabi/trunk/test/catch_class_04.pass.cpp
  libcxxabi/trunk/test/catch_ptr.pass.cpp

Index: libcxxabi/trunk/test/catch_ptr.pass.cpp
===
--- libcxxabi/trunk/test/catch_ptr.pass.cpp
+++ libcxxabi/trunk/test/catch_ptr.pass.cpp
@@ -66,8 +66,8 @@
 {
 static int count;
 int id_;
-explicit A(int id) : C1(id-1), C2(id-2), B(id+3), id_(id) {count++;}
-A(const A& a) : C1(a.id_-1), C2(a.id_-2), B(a.id_+3), id_(a.id_) {count++;}
+explicit A(int id) : B(id+3), C1(id-1), C2(id-2), id_(id) {count++;}
+A(const A& a) : B(a.id_+3), C1(a.id_-1), C2(a.id_-2),  id_(a.id_) 
{count++;}
 ~A() {count--;}
 };
 
Index: libcxxabi/trunk/test/catch_class_04.pass.cpp
===
--- libcxxabi/trunk/test/catch_class_04.pass.cpp
+++ libcxxabi/trunk/test/catch_class_04.pass.cpp
@@ -66,8 +66,8 @@
 {
 static int count;
 int id_;
-explicit A(int id) : C1(id-1), C2(id-2), B(id+3), id_(id) {count++;}
-A(const A& a) : C1(a.id_-1), C2(a.id_-2), B(a.id_+3), id_(a.id_) {count++;}
+explicit A(int id) : B(id+3), C1(id-1), C2(id-2), id_(id) {count++;}
+A(const A& a) :  B(a.id_+3), C1(a.id_-1), C2(a.id_-2), id_(a.id_) 
{count++;}
 ~A() {count--;}
 };
 


Index: libcxxabi/trunk/test/catch_ptr.pass.cpp
===
--- libcxxabi/trunk/test/catch_ptr.pass.cpp
+++ libcxxabi/trunk/test/catch_ptr.pass.cpp
@@ -66,8 +66,8 @@
 {
 static int count;
 int id_;
-explicit A(int id) : C1(id-1), C2(id-2), B(id+3), id_(id) {count++;}
-A(const A& a) : C1(a.id_-1), C2(a.id_-2), B(a.id_+3), id_(a.id_) {count++;}
+explicit A(int id) : B(id+3), C1(id-1), C2(id-2), id_(id) {count++;}
+A(const A& a) : B(a.id_+3), C1(a.id_-1), C2(a.id_-2),  id_(a.id_) {count++;}
 ~A() {count--;}
 };
 
Index: libcxxabi/trunk/test/catch_class_04.pass.cpp
===
--- libcxxabi/trunk/test/catch_class_04.pass.cpp
+++ libcxxabi/trunk/test/catch_class_04.pass.cpp
@@ -66,8 +66,8 @@
 {
 static int count;
 int id_;
-explicit A(int id) : C1(id-1), C2(id-2), B(id+3), id_(id) {count++;}
-A(const A& a) : C1(a.id_-1), C2(a.id_-2), B(a.id_+3), id_(a.id_) {count++;}
+explicit A(int id) : B(id+3), C1(id-1), C2(id-2), id_(id) {count++;}
+A(const A& a) :  B(a.id_+3), C1(a.id_-1), C2(a.id_-2), id_(a.id_) {count++;}
 ~A() {count--;}
 };
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxxabi] r272821 - [libcxxabi] Reorder base class initializers in libc++abi tests to prevent -Wreorder

2016-06-15 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Wed Jun 15 14:33:01 2016
New Revision: 272821

URL: http://llvm.org/viewvc/llvm-project?rev=272821&view=rev
Log:
[libcxxabi] Reorder base class initializers in libc++abi tests to prevent 
-Wreorder

Summary:
This patch fixes -Wreorder warnings on test classes with virtual bases. Since 
the compiler is performing the reordering anyway this change *should* have NFC.

However the test notes that it is checking that "virtual base classes work 
properly". Since initialization order is clearly part of correctness I want to 
confirm that this wasn't an intentional mistake.



Reviewers: mclow.lists, howard.hinnant

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D21396

Modified:
libcxxabi/trunk/test/catch_class_04.pass.cpp
libcxxabi/trunk/test/catch_ptr.pass.cpp

Modified: libcxxabi/trunk/test/catch_class_04.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_class_04.pass.cpp?rev=272821&r1=272820&r2=272821&view=diff
==
--- libcxxabi/trunk/test/catch_class_04.pass.cpp (original)
+++ libcxxabi/trunk/test/catch_class_04.pass.cpp Wed Jun 15 14:33:01 2016
@@ -66,8 +66,8 @@ struct A
 {
 static int count;
 int id_;
-explicit A(int id) : C1(id-1), C2(id-2), B(id+3), id_(id) {count++;}
-A(const A& a) : C1(a.id_-1), C2(a.id_-2), B(a.id_+3), id_(a.id_) {count++;}
+explicit A(int id) : B(id+3), C1(id-1), C2(id-2), id_(id) {count++;}
+A(const A& a) :  B(a.id_+3), C1(a.id_-1), C2(a.id_-2), id_(a.id_) 
{count++;}
 ~A() {count--;}
 };
 

Modified: libcxxabi/trunk/test/catch_ptr.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_ptr.pass.cpp?rev=272821&r1=272820&r2=272821&view=diff
==
--- libcxxabi/trunk/test/catch_ptr.pass.cpp (original)
+++ libcxxabi/trunk/test/catch_ptr.pass.cpp Wed Jun 15 14:33:01 2016
@@ -66,8 +66,8 @@ struct A
 {
 static int count;
 int id_;
-explicit A(int id) : C1(id-1), C2(id-2), B(id+3), id_(id) {count++;}
-A(const A& a) : C1(a.id_-1), C2(a.id_-2), B(a.id_+3), id_(a.id_) {count++;}
+explicit A(int id) : B(id+3), C1(id-1), C2(id-2), id_(id) {count++;}
+A(const A& a) : B(a.id_+3), C1(a.id_-1), C2(a.id_-2),  id_(a.id_) 
{count++;}
 ~A() {count--;}
 };
 


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


Re: [PATCH] D21396: [libcxxabi] Reorder base class initializers in libc++abi tests to prevent -Wreorder

2016-06-15 Thread Howard Hinnant via cfe-commits
howard.hinnant added a comment.

Look good to me.


http://reviews.llvm.org/D21396



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


[PATCH] D21396: [libcxxabi] Reorder base class initializers in libc++abi tests to prevent -Wreorder

2016-06-15 Thread Eric Fiselier via cfe-commits
EricWF created this revision.
EricWF added reviewers: mclow.lists, howard.hinnant.
EricWF added a subscriber: cfe-commits.

This patch fixes -Wreorder warnings on test classes with virtual bases. Since 
the compiler is performing the reordering anyway this change *should* have NFC.

However the test notes that it is checking that "virtual base classes work 
properly". Since initialization order is clearly part of correctness I want to 
confirm that this wasn't an intentional mistake.



http://reviews.llvm.org/D21396

Files:
  test/catch_class_04.pass.cpp
  test/catch_ptr.pass.cpp

Index: test/catch_ptr.pass.cpp
===
--- test/catch_ptr.pass.cpp
+++ test/catch_ptr.pass.cpp
@@ -66,8 +66,8 @@
 {
 static int count;
 int id_;
-explicit A(int id) : C1(id-1), C2(id-2), B(id+3), id_(id) {count++;}
-A(const A& a) : C1(a.id_-1), C2(a.id_-2), B(a.id_+3), id_(a.id_) {count++;}
+explicit A(int id) : B(id+3), C1(id-1), C2(id-2), id_(id) {count++;}
+A(const A& a) : B(a.id_+3), C1(a.id_-1), C2(a.id_-2),  id_(a.id_) 
{count++;}
 ~A() {count--;}
 };
 
Index: test/catch_class_04.pass.cpp
===
--- test/catch_class_04.pass.cpp
+++ test/catch_class_04.pass.cpp
@@ -66,8 +66,8 @@
 {
 static int count;
 int id_;
-explicit A(int id) : C1(id-1), C2(id-2), B(id+3), id_(id) {count++;}
-A(const A& a) : C1(a.id_-1), C2(a.id_-2), B(a.id_+3), id_(a.id_) {count++;}
+explicit A(int id) : B(id+3), C1(id-1), C2(id-2), id_(id) {count++;}
+A(const A& a) :  B(a.id_+3), C1(a.id_-1), C2(a.id_-2), id_(a.id_) 
{count++;}
 ~A() {count--;}
 };
 


Index: test/catch_ptr.pass.cpp
===
--- test/catch_ptr.pass.cpp
+++ test/catch_ptr.pass.cpp
@@ -66,8 +66,8 @@
 {
 static int count;
 int id_;
-explicit A(int id) : C1(id-1), C2(id-2), B(id+3), id_(id) {count++;}
-A(const A& a) : C1(a.id_-1), C2(a.id_-2), B(a.id_+3), id_(a.id_) {count++;}
+explicit A(int id) : B(id+3), C1(id-1), C2(id-2), id_(id) {count++;}
+A(const A& a) : B(a.id_+3), C1(a.id_-1), C2(a.id_-2),  id_(a.id_) {count++;}
 ~A() {count--;}
 };
 
Index: test/catch_class_04.pass.cpp
===
--- test/catch_class_04.pass.cpp
+++ test/catch_class_04.pass.cpp
@@ -66,8 +66,8 @@
 {
 static int count;
 int id_;
-explicit A(int id) : C1(id-1), C2(id-2), B(id+3), id_(id) {count++;}
-A(const A& a) : C1(a.id_-1), C2(a.id_-2), B(a.id_+3), id_(a.id_) {count++;}
+explicit A(int id) : B(id+3), C1(id-1), C2(id-2), id_(id) {count++;}
+A(const A& a) :  B(a.id_+3), C1(a.id_-1), C2(a.id_-2), id_(a.id_) {count++;}
 ~A() {count--;}
 };
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libcxx] r272634 - Implement variadic lock_guard.

2016-06-15 Thread Craig, Ben via cfe-commits
It would be awesome if this kind of shadowing warning could be put into 
-Wall.  My recollection on the last set of -Wshadow reviews is that most 
shadowing warnings are from ctor arguments being used to initialize 
members.  Here's the last discussion / review regarding shadowing 
http://reviews.llvm.org/D18271



On 6/15/2016 2:22 PM, Eric Fiselier wrote:
Maybe we should add a new warning in Clang for this. -Wshadow 
diagnosis's this but -Wshadow isn't a part of -Wall or -Wextra so it's 
of limited utility.

A separate warning for shadowing 'x' caused by "T(x)" might be useful.

Do people actually use "T(x)" in the wild to default construct 'x'?

/Eric


On Wed, Jun 15, 2016 at 1:07 PM, Craig, Ben > wrote:


Makes sense.  Here's hoping parameter deduction for constructors
makes it in!

(better link)
http://open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0091r2.html


On 6/15/2016 1:54 PM, Eric Fiselier wrote:


I've had a change of heart. I think that lock_guard<> has some
utility in generic code, and I'm not sure removing it is a good
idea. For example a function like:

template 
void ExecuteUnderLocks(Func&& fn, Locks&... locks) {
  lock_guard g(locks...);
  fn();
}

I checked the proposal and it's clear that "lock_guard<>" is
expected to compile and be default constructable. For this reason
I'm not going to remove "lock_guard<>", at least not without
further discussion.

On Wed, Jun 15, 2016 at 12:47 PM, Craig, Ben
mailto:ben.cr...@codeaurora.org>> wrote:

On 6/15/2016 1:15 PM, Eric Fiselier wrote:

On Wed, Jun 15, 2016 at 11:45 AM, Craig, Ben via cfe-commits
mailto:cfe-commits@lists.llvm.org>> wrote:

Does this change (and the paper) permit declarations
like the following?

lock_guard<> guard();

If that syntax is allowed, then this is also likely
allowed...

lock_guard<>(guard);

I would really like the prior two examples to not
compile.  Here is a common bug that I see in the wild...

unique_guard(some_member_mutex);

That defines a new, default constructed unique_guard
named "some_member_mutex", that likely shadows the
member variable some_member_mutex.  It is almost never
what users want.


I had no idea that syntax did that. I would have assumed it
created an unnamed temporary. I can see how that would cause
bugs.

It's also strong rationale for deduced constructor templates.
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0091r0.html)
auto guard = unique_guard(some_member_mutex);
You don't need to repeat types there, and it's very difficult
to forget to name the guard variable.


Is it possible to have the empty template remain
undefined, and let the one element lock_guard be the
base case of the recursion?  Does that help any with the
mangling?

Nothing in the spec says the empty template should be
undefined. The default constructor on the empty template is
technically implementing "lock_guard(MutexTypes...)" for an
empty pack.
However your example provides ample motivation to make it
undefined. I'll go ahead and make that change and I'll file
a LWG defect to change the standard.

There is actually no recursion in the variadic lock_guard
implementation, so the change is trivial.

As for mangling I'm not sure what you mean? It definitely
doesn't change the fact that this change is ABI breaking.
(Note this change is not enabled by default for that reason).

My thought regarding the mangling was that you could still
provide a one argument lock_guard, as well as a variadic
lock_guard.  The one argument lock_guard would have the same
mangling as before.  I think some of your other comments have
convinced me that that won't work, as I think the variadic
lock_guard has to be made the primary template, and I think
the primary template dictates the mangling.


Exactly.


I'm also going to guess that throwing inline namespaces at
the problem won't help, as that would probably cause
compile-time ambiguity.

If I'm not mistaken, this only breaks ABI for those foolish
enough to pass a lock_guard reference or pointer as a
parameter across a libcxx version boundary.  Does that sound
accurate?


It breaks the ABI any time "lock_guard" participates in
the mangling of some function or type. In addition to your
example this will also break any time "lock_guard" is used
as a template parameter: ie

using T = MyType>;
MyFunction>();

The two different implementations are st

Re: [PATCH] D21338: cc1_main: Do not print statistics in -disable_free mode.

2016-06-15 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272820: cc1_main: Do not print statistics twice in 
-disable_free mode. (authored by matze).

Changed prior to commit:
  http://reviews.llvm.org/D21338?vs=60732&id=60877#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21338

Files:
  cfe/trunk/tools/driver/cc1_main.cpp

Index: cfe/trunk/tools/driver/cc1_main.cpp
===
--- cfe/trunk/tools/driver/cc1_main.cpp
+++ cfe/trunk/tools/driver/cc1_main.cpp
@@ -126,8 +126,6 @@
 
   // When running with -disable-free, don't do any destruction or shutdown.
   if (Clang->getFrontendOpts().DisableFree) {
-if (llvm::AreStatisticsEnabled() || Clang->getFrontendOpts().ShowStats)
-  llvm::PrintStatistics();
 BuryPointer(std::move(Clang));
 return !Success;
   }


Index: cfe/trunk/tools/driver/cc1_main.cpp
===
--- cfe/trunk/tools/driver/cc1_main.cpp
+++ cfe/trunk/tools/driver/cc1_main.cpp
@@ -126,8 +126,6 @@
 
   // When running with -disable-free, don't do any destruction or shutdown.
   if (Clang->getFrontendOpts().DisableFree) {
-if (llvm::AreStatisticsEnabled() || Clang->getFrontendOpts().ShowStats)
-  llvm::PrintStatistics();
 BuryPointer(std::move(Clang));
 return !Success;
   }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r272820 - cc1_main: Do not print statistics twice in -disable_free mode.

2016-06-15 Thread Matthias Braun via cfe-commits
Author: matze
Date: Wed Jun 15 14:24:55 2016
New Revision: 272820

URL: http://llvm.org/viewvc/llvm-project?rev=272820&view=rev
Log:
cc1_main: Do not print statistics twice in -disable_free mode.

llvm statistics are currently printed when the destructor of a "static
ManagedStatic StatInfo" in llvm runs.  This destructor
currently runs in each case as part of llvm_shutdown() which is run even
in disable_free mode as part of main(). I assume that this hasn't always
been the case.

Removing the special code here avoids the statistics getting printed
twice.

Differential Revision: http://reviews.llvm.org/D21338

Modified:
cfe/trunk/tools/driver/cc1_main.cpp

Modified: cfe/trunk/tools/driver/cc1_main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1_main.cpp?rev=272820&r1=272819&r2=272820&view=diff
==
--- cfe/trunk/tools/driver/cc1_main.cpp (original)
+++ cfe/trunk/tools/driver/cc1_main.cpp Wed Jun 15 14:24:55 2016
@@ -126,8 +126,6 @@ int cc1_main(ArrayRef Argv
 
   // When running with -disable-free, don't do any destruction or shutdown.
   if (Clang->getFrontendOpts().DisableFree) {
-if (llvm::AreStatisticsEnabled() || Clang->getFrontendOpts().ShowStats)
-  llvm::PrintStatistics();
 BuryPointer(std::move(Clang));
 return !Success;
   }


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


Re: [libcxx] r272634 - Implement variadic lock_guard.

2016-06-15 Thread Eric Fiselier via cfe-commits
Maybe we should add a new warning in Clang for this. -Wshadow diagnosis's
this but -Wshadow isn't a part of -Wall or -Wextra so it's of limited
utility.
A separate warning for shadowing 'x' caused by "T(x)" might be useful.

Do people actually use "T(x)" in the wild to default construct 'x'?

/Eric


On Wed, Jun 15, 2016 at 1:07 PM, Craig, Ben 
wrote:

> Makes sense.  Here's hoping parameter deduction for constructors makes it
> in!
>
> (better link)
> http://open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0091r2.html
>
> On 6/15/2016 1:54 PM, Eric Fiselier wrote:
>
>
> I've had a change of heart. I think that lock_guard<> has some utility in
> generic code, and I'm not sure removing it is a good idea. For example a
> function like:
>
> template 
> void ExecuteUnderLocks(Func&& fn, Locks&... locks) {
>   lock_guard g(locks...);
>   fn();
> }
>
> I checked the proposal and it's clear that "lock_guard<>" is expected to
> compile and be default constructable. For this reason I'm not going to
> remove "lock_guard<>", at least not without further discussion.
>
>
> On Wed, Jun 15, 2016 at 12:47 PM, Craig, Ben 
> wrote:
>
>> On 6/15/2016 1:15 PM, Eric Fiselier wrote:
>>
>> On Wed, Jun 15, 2016 at 11:45 AM, Craig, Ben via cfe-commits <
>> cfe-commits@lists.llvm.org> wrote:
>>
>>> Does this change (and the paper) permit declarations like the following?
>>>
>>> lock_guard<> guard();
>>>
>>> If that syntax is allowed, then this is also likely allowed...
>>>
>>> lock_guard<>(guard);
>>>
>>> I would really like the prior two examples to not compile.  Here is a
>>> common bug that I see in the wild...
>>>
>>> unique_guard(some_member_mutex);
>>>
>>> That defines a new, default constructed unique_guard named
>>> "some_member_mutex", that likely shadows the member variable
>>> some_member_mutex.  It is almost never what users want.
>>>
>>
>> I had no idea that syntax did that. I would have assumed it created an
>> unnamed temporary. I can see how that would cause bugs.
>>
>> It's also strong rationale for deduced constructor templates. (
>> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0091r0.html)
>> auto guard = unique_guard(some_member_mutex);
>> You don't need to repeat types there, and it's very difficult to forget
>> to name the guard variable.
>>
>>
>>
>>> Is it possible to have the empty template remain undefined, and let the
>>> one element lock_guard be the base case of the recursion?  Does that help
>>> any with the mangling?
>>>
>> Nothing in the spec says the empty template should be undefined. The
>> default constructor on the empty template is technically implementing
>> "lock_guard(MutexTypes...)" for an empty pack.
>> However your example provides ample motivation to make it undefined. I'll
>> go ahead and make that change and I'll file a LWG defect to change the
>> standard.
>>
>> There is actually no recursion in the variadic lock_guard implementation,
>> so the change is trivial.
>>
>> As for mangling I'm not sure what you mean? It definitely doesn't change
>> the fact that this change is ABI breaking. (Note this change is not enabled
>> by default for that reason).
>>
>> My thought regarding the mangling was that you could still provide a one
>> argument lock_guard, as well as a variadic lock_guard.  The one argument
>> lock_guard would have the same mangling as before.  I think some of your
>> other comments have convinced me that that won't work, as I think the
>> variadic lock_guard has to be made the primary template, and I think the
>> primary template dictates the mangling.
>>
>
> Exactly.
>
>
>>
>> I'm also going to guess that throwing inline namespaces at the problem
>> won't help, as that would probably cause compile-time ambiguity.
>>
>> If I'm not mistaken, this only breaks ABI for those foolish enough to
>> pass a lock_guard reference or pointer as a parameter across a libcxx
>> version boundary.  Does that sound accurate?
>>
>
> It breaks the ABI any time "lock_guard" participates in the
> mangling of some function or type. In addition to your example this will
> also break any time "lock_guard" is used as a template parameter: ie
>
> using T = MyType>;
> MyFunction>();
>
> The two different implementations are still layout compatible, so if
> mangling were not an issue I think this change would have been safe.
>
>
>
>> --
>> Employee of Qualcomm Innovation Center, Inc.
>> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux 
>> Foundation Collaborative Project
>>
>>
>
> --
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux 
> Foundation Collaborative Project
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxxabi] r272819 - Suppress warnings about the operations currently under test.

2016-06-15 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Wed Jun 15 14:07:19 2016
New Revision: 272819

URL: http://llvm.org/viewvc/llvm-project?rev=272819&view=rev
Log:
Suppress warnings about the operations currently under test.

Modified:
libcxxabi/trunk/test/catch_class_03.pass.cpp
libcxxabi/trunk/test/catch_class_04.pass.cpp
libcxxabi/trunk/test/catch_const_pointer_nullptr.pass.cpp
libcxxabi/trunk/test/catch_ptr.pass.cpp
libcxxabi/trunk/test/catch_ptr_02.pass.cpp
libcxxabi/trunk/test/dynamic_cast3.pass.cpp
libcxxabi/trunk/test/dynamic_cast5.pass.cpp
libcxxabi/trunk/test/inherited_exception.pass.cpp

Modified: libcxxabi/trunk/test/catch_class_03.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_class_03.pass.cpp?rev=272819&r1=272818&r2=272819&view=diff
==
--- libcxxabi/trunk/test/catch_class_03.pass.cpp (original)
+++ libcxxabi/trunk/test/catch_class_03.pass.cpp Wed Jun 15 14:07:19 2016
@@ -19,6 +19,13 @@
 #include 
 #include 
 
+// Clang emits  warnings about exceptions of type 'Child' being caught by
+// an earlier handler of type 'Base'. Congrats clang, you've just
+// diagnosed the behavior under test.
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wexceptions"
+#endif
+
 struct B
 {
 static int count;

Modified: libcxxabi/trunk/test/catch_class_04.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_class_04.pass.cpp?rev=272819&r1=272818&r2=272819&view=diff
==
--- libcxxabi/trunk/test/catch_class_04.pass.cpp (original)
+++ libcxxabi/trunk/test/catch_class_04.pass.cpp Wed Jun 15 14:07:19 2016
@@ -19,6 +19,13 @@
 #include 
 #include 
 
+// Clang emits  warnings about exceptions of type 'Child' being caught by
+// an earlier handler of type 'Base'. Congrats clang, you've just
+// diagnosed the behavior under test.
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wexceptions"
+#endif
+
 struct B
 {
 static int count;

Modified: libcxxabi/trunk/test/catch_const_pointer_nullptr.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_const_pointer_nullptr.pass.cpp?rev=272819&r1=272818&r2=272819&view=diff
==
--- libcxxabi/trunk/test/catch_const_pointer_nullptr.pass.cpp (original)
+++ libcxxabi/trunk/test/catch_const_pointer_nullptr.pass.cpp Wed Jun 15 
14:07:19 2016
@@ -11,6 +11,13 @@
 
 #include 
 
+// Clang emits  warnings about exceptions of type 'Child' being caught by
+// an earlier handler of type 'Base'. Congrats clang, you've just
+// diagnosed the behavior under test.
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wexceptions"
+#endif
+
 #if __has_feature(cxx_nullptr)
 
 struct A {};

Modified: libcxxabi/trunk/test/catch_ptr.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_ptr.pass.cpp?rev=272819&r1=272818&r2=272819&view=diff
==
--- libcxxabi/trunk/test/catch_ptr.pass.cpp (original)
+++ libcxxabi/trunk/test/catch_ptr.pass.cpp Wed Jun 15 14:07:19 2016
@@ -19,6 +19,13 @@
 #include 
 #include 
 
+// Clang emits  warnings about exceptions of type 'Child' being caught by
+// an earlier handler of type 'Base'. Congrats clang, you've just
+// diagnosed the behavior under test.
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wexceptions"
+#endif
+
 struct B
 {
 static int count;

Modified: libcxxabi/trunk/test/catch_ptr_02.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_ptr_02.pass.cpp?rev=272819&r1=272818&r2=272819&view=diff
==
--- libcxxabi/trunk/test/catch_ptr_02.pass.cpp (original)
+++ libcxxabi/trunk/test/catch_ptr_02.pass.cpp Wed Jun 15 14:07:19 2016
@@ -11,6 +11,13 @@
 
 #include 
 
+// Clang emits  warnings about exceptions of type 'Child' being caught by
+// an earlier handler of type 'Base'. Congrats clang, you've just
+// diagnosed the behavior under test.
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wexceptions"
+#endif
+
 #if __cplusplus < 201103L
 #define DISABLE_NULLPTR_TESTS
 #endif

Modified: libcxxabi/trunk/test/dynamic_cast3.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/dynamic_cast3.pass.cpp?rev=272819&r1=272818&r2=272819&view=diff
==
--- libcxxabi/trunk/test/dynamic_cast3.pass.cpp (original)
+++ libcxxabi/trunk/test/dynamic_cast3.pass.cpp Wed Jun 15 14:07:19 2016
@@ -10,6 +10,12 @@
 #include 
 #include "support/timer.hpp"
 
+// This test explicitly tests dynamic cast with types that have inaccessible
+// bases.
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Winaccessible-base"
+#endif
+
 /*
 
 A1

Re: [libcxx] r272634 - Implement variadic lock_guard.

2016-06-15 Thread Craig, Ben via cfe-commits
Makes sense.  Here's hoping parameter deduction for constructors makes 
it in!


(better link) 
http://open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0091r2.html



On 6/15/2016 1:54 PM, Eric Fiselier wrote:


I've had a change of heart. I think that lock_guard<> has some utility 
in generic code, and I'm not sure removing it is a good idea. For 
example a function like:


template 
void ExecuteUnderLocks(Func&& fn, Locks&... locks) {
  lock_guard g(locks...);
  fn();
}

I checked the proposal and it's clear that "lock_guard<>" is expected 
to compile and be default constructable. For this reason I'm not going 
to remove "lock_guard<>", at least not without further discussion.


On Wed, Jun 15, 2016 at 12:47 PM, Craig, Ben > wrote:


On 6/15/2016 1:15 PM, Eric Fiselier wrote:

On Wed, Jun 15, 2016 at 11:45 AM, Craig, Ben via cfe-commits
mailto:cfe-commits@lists.llvm.org>>
wrote:

Does this change (and the paper) permit declarations like the
following?

lock_guard<> guard();

If that syntax is allowed, then this is also likely allowed...

lock_guard<>(guard);

I would really like the prior two examples to not compile. 
Here is a common bug that I see in the wild...


unique_guard(some_member_mutex);

That defines a new, default constructed unique_guard named
"some_member_mutex", that likely shadows the member variable
some_member_mutex.  It is almost never what users want.


I had no idea that syntax did that. I would have assumed it
created an unnamed temporary. I can see how that would cause bugs.

It's also strong rationale for deduced constructor templates.
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0091r0.html)
auto guard = unique_guard(some_member_mutex);
You don't need to repeat types there, and it's very difficult to
forget to name the guard variable.


Is it possible to have the empty template remain undefined,
and let the one element lock_guard be the base case of the
recursion?  Does that help any with the mangling?

Nothing in the spec says the empty template should be undefined.
The default constructor on the empty template is technically
implementing "lock_guard(MutexTypes...)" for an empty pack.
However your example provides ample motivation to make it
undefined. I'll go ahead and make that change and I'll file a LWG
defect to change the standard.

There is actually no recursion in the variadic lock_guard
implementation, so the change is trivial.

As for mangling I'm not sure what you mean? It definitely doesn't
change the fact that this change is ABI breaking. (Note this
change is not enabled by default for that reason).

My thought regarding the mangling was that you could still provide
a one argument lock_guard, as well as a variadic lock_guard.  The
one argument lock_guard would have the same mangling as before.  I
think some of your other comments have convinced me that that
won't work, as I think the variadic lock_guard has to be made the
primary template, and I think the primary template dictates the
mangling.


Exactly.


I'm also going to guess that throwing inline namespaces at the
problem won't help, as that would probably cause compile-time
ambiguity.

If I'm not mistaken, this only breaks ABI for those foolish enough
to pass a lock_guard reference or pointer as a parameter across a
libcxx version boundary.  Does that sound accurate?


It breaks the ABI any time "lock_guard" participates in the 
mangling of some function or type. In addition to your example this 
will also break any time "lock_guard" is used as a template 
parameter: ie


using T = MyType>;
MyFunction>();

The two different implementations are still layout compatible, so if 
mangling were not an issue I think this change would have been safe.


-- 
Employee of Qualcomm Innovation Center, Inc.

Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux 
Foundation Collaborative Project




--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux 
Foundation Collaborative Project

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


Re: [libcxx] r272634 - Implement variadic lock_guard.

2016-06-15 Thread Eric Fiselier via cfe-commits
I've had a change of heart. I think that lock_guard<> has some utility in
generic code, and I'm not sure removing it is a good idea. For example a
function like:

template 
void ExecuteUnderLocks(Func&& fn, Locks&... locks) {
  lock_guard g(locks...);
  fn();
}

I checked the proposal and it's clear that "lock_guard<>" is expected to
compile and be default constructable. For this reason I'm not going to
remove "lock_guard<>", at least not without further discussion.


On Wed, Jun 15, 2016 at 12:47 PM, Craig, Ben 
wrote:

> On 6/15/2016 1:15 PM, Eric Fiselier wrote:
>
> On Wed, Jun 15, 2016 at 11:45 AM, Craig, Ben via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> Does this change (and the paper) permit declarations like the following?
>>
>> lock_guard<> guard();
>>
>> If that syntax is allowed, then this is also likely allowed...
>>
>> lock_guard<>(guard);
>>
>> I would really like the prior two examples to not compile.  Here is a
>> common bug that I see in the wild...
>>
>> unique_guard(some_member_mutex);
>>
>> That defines a new, default constructed unique_guard named
>> "some_member_mutex", that likely shadows the member variable
>> some_member_mutex.  It is almost never what users want.
>>
>
> I had no idea that syntax did that. I would have assumed it created an
> unnamed temporary. I can see how that would cause bugs.
>
> It's also strong rationale for deduced constructor templates. (
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0091r0.html)
> auto guard = unique_guard(some_member_mutex);
> You don't need to repeat types there, and it's very difficult to forget to
> name the guard variable.
>
>
>
>> Is it possible to have the empty template remain undefined, and let the
>> one element lock_guard be the base case of the recursion?  Does that help
>> any with the mangling?
>>
> Nothing in the spec says the empty template should be undefined. The
> default constructor on the empty template is technically implementing
> "lock_guard(MutexTypes...)" for an empty pack.
> However your example provides ample motivation to make it undefined. I'll
> go ahead and make that change and I'll file a LWG defect to change the
> standard.
>
> There is actually no recursion in the variadic lock_guard implementation,
> so the change is trivial.
>
> As for mangling I'm not sure what you mean? It definitely doesn't change
> the fact that this change is ABI breaking. (Note this change is not enabled
> by default for that reason).
>
> My thought regarding the mangling was that you could still provide a one
> argument lock_guard, as well as a variadic lock_guard.  The one argument
> lock_guard would have the same mangling as before.  I think some of your
> other comments have convinced me that that won't work, as I think the
> variadic lock_guard has to be made the primary template, and I think the
> primary template dictates the mangling.
>

Exactly.


>
> I'm also going to guess that throwing inline namespaces at the problem
> won't help, as that would probably cause compile-time ambiguity.
>
> If I'm not mistaken, this only breaks ABI for those foolish enough to pass
> a lock_guard reference or pointer as a parameter across a libcxx version
> boundary.  Does that sound accurate?
>

It breaks the ABI any time "lock_guard" participates in the mangling
of some function or type. In addition to your example this will also break
any time "lock_guard" is used as a template parameter: ie

using T = MyType>;
MyFunction>();

The two different implementations are still layout compatible, so if
mangling were not an issue I think this change would have been safe.



> --
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux 
> Foundation Collaborative Project
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libcxx] r272634 - Implement variadic lock_guard.

2016-06-15 Thread Craig, Ben via cfe-commits

On 6/15/2016 1:15 PM, Eric Fiselier wrote:
On Wed, Jun 15, 2016 at 11:45 AM, Craig, Ben via cfe-commits 
mailto:cfe-commits@lists.llvm.org>> wrote:


Does this change (and the paper) permit declarations like the
following?

lock_guard<> guard();

If that syntax is allowed, then this is also likely allowed...

lock_guard<>(guard);

I would really like the prior two examples to not compile.  Here
is a common bug that I see in the wild...

unique_guard(some_member_mutex);

That defines a new, default constructed unique_guard named
"some_member_mutex", that likely shadows the member variable
some_member_mutex.  It is almost never what users want.


I had no idea that syntax did that. I would have assumed it created an 
unnamed temporary. I can see how that would cause bugs.
It's also strong rationale for deduced constructor templates. 
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0091r0.html)

auto guard = unique_guard(some_member_mutex);
You don't need to repeat types there, and it's very difficult to forget 
to name the guard variable.



Is it possible to have the empty template remain undefined, and
let the one element lock_guard be the base case of the recursion? 
Does that help any with the mangling?


Nothing in the spec says the empty template should be undefined. The 
default constructor on the empty template is technically implementing 
"lock_guard(MutexTypes...)" for an empty pack.
However your example provides ample motivation to make it undefined. 
I'll go ahead and make that change and I'll file a LWG defect to 
change the standard.


There is actually no recursion in the variadic lock_guard 
implementation, so the change is trivial.


As for mangling I'm not sure what you mean? It definitely doesn't 
change the fact that this change is ABI breaking. (Note this change is 
not enabled by default for that reason).
My thought regarding the mangling was that you could still provide a one 
argument lock_guard, as well as a variadic lock_guard.  The one argument 
lock_guard would have the same mangling as before.  I think some of your 
other comments have convinced me that that won't work, as I think the 
variadic lock_guard has to be made the primary template, and I think the 
primary template dictates the mangling.


I'm also going to guess that throwing inline namespaces at the problem 
won't help, as that would probably cause compile-time ambiguity.


If I'm not mistaken, this only breaks ABI for those foolish enough to 
pass a lock_guard reference or pointer as a parameter across a libcxx 
version boundary.  Does that sound accurate?


--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux 
Foundation Collaborative Project

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


Re: [PATCH] D21338: cc1_main: Do not print statistics in -disable_free mode.

2016-06-15 Thread Bruno Cardoso Lopes via cfe-commits
bruno accepted this revision.
bruno added a comment.
This revision is now accepted and ready to land.

Assuming that it's guaranteed that the other path would always print out the 
statistics, LGTM


Repository:
  rL LLVM

http://reviews.llvm.org/D21338



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


[clang-tools-extra] r272816 - clang-rename: implement renaming of classes with a dtor

2016-06-15 Thread Miklos Vajna via cfe-commits
Author: vmiklos
Date: Wed Jun 15 13:35:41 2016
New Revision: 272816

URL: http://llvm.org/viewvc/llvm-project?rev=272816&view=rev
Log:
clang-rename: implement renaming of classes with a dtor

The declaration wasn't renamed. Also neither part of the declaration
wasn't renamed.

Reviewers: klimek

Differential Revision: http://reviews.llvm.org/D21364

Added:
clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp
Modified:
clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp

Modified: clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp?rev=272816&r1=272815&r2=272816&view=diff
==
--- clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp (original)
+++ clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp Wed Jun 15 13:35:41 
2016
@@ -87,6 +87,28 @@ public:
 return true;
   }
 
+  bool VisitCXXDestructorDecl(clang::CXXDestructorDecl *DestructorDecl) {
+if (getUSRForDecl(DestructorDecl->getParent()) == USR) {
+  // Handles "~Foo" from "Foo::~Foo".
+  SourceLocation Location = DestructorDecl->getLocation();
+  const ASTContext &Context = DestructorDecl->getASTContext();
+  StringRef TokenName = Lexer::getSourceText(
+  CharSourceRange::getTokenRange(Location), Context.getSourceManager(),
+  Context.getLangOpts());
+  // 1 is the length of the "~" string that is not to be touched by the
+  // rename.
+  assert(TokenName.startswith("~"));
+  LocationsFound.push_back(Location.getLocWithOffset(1));
+
+  if (DestructorDecl->isThisDeclarationADefinition()) {
+// Handles "Foo" from "Foo::~Foo".
+LocationsFound.push_back(DestructorDecl->getLocStart());
+  }
+}
+
+return true;
+  }
+
   // Expression visitors:
 
   bool VisitDeclRefExpr(const DeclRefExpr *Expr) {

Added: clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp?rev=272816&view=auto
==
--- clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp (added)
+++ clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp Wed Jun 15 
13:35:41 2016
@@ -0,0 +1,17 @@
+// RUN: cat %s > %t.cpp
+// RUN: clang-rename -offset=135 -new-name=Bar %t.cpp -i --
+// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
+class Foo {
+public:
+  Foo();
+  ~Foo(); // CHECK: ~Bar();
+};
+
+Foo::Foo() {
+}
+
+Foo::~Foo() { // CHECK: Bar::~Bar()
+}
+
+// Use grep -FUbo 'Foo'  to get the correct offset of foo when changing
+// this file.


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


Re: [PATCH] D21364: clang-rename: implement renaming of classes with a dtor

2016-06-15 Thread Miklos Vajna via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272816: clang-rename: implement renaming of classes with a 
dtor (authored by vmiklos).

Changed prior to commit:
  http://reviews.llvm.org/D21364?vs=60801&id=60869#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21364

Files:
  clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
  clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp

Index: clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
===
--- clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
+++ clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
@@ -87,6 +87,28 @@
 return true;
   }
 
+  bool VisitCXXDestructorDecl(clang::CXXDestructorDecl *DestructorDecl) {
+if (getUSRForDecl(DestructorDecl->getParent()) == USR) {
+  // Handles "~Foo" from "Foo::~Foo".
+  SourceLocation Location = DestructorDecl->getLocation();
+  const ASTContext &Context = DestructorDecl->getASTContext();
+  StringRef TokenName = Lexer::getSourceText(
+  CharSourceRange::getTokenRange(Location), Context.getSourceManager(),
+  Context.getLangOpts());
+  // 1 is the length of the "~" string that is not to be touched by the
+  // rename.
+  assert(TokenName.startswith("~"));
+  LocationsFound.push_back(Location.getLocWithOffset(1));
+
+  if (DestructorDecl->isThisDeclarationADefinition()) {
+// Handles "Foo" from "Foo::~Foo".
+LocationsFound.push_back(DestructorDecl->getLocStart());
+  }
+}
+
+return true;
+  }
+
   // Expression visitors:
 
   bool VisitDeclRefExpr(const DeclRefExpr *Expr) {
Index: clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp
===
--- clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp
+++ clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp
@@ -0,0 +1,17 @@
+// RUN: cat %s > %t.cpp
+// RUN: clang-rename -offset=135 -new-name=Bar %t.cpp -i --
+// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
+class Foo {
+public:
+  Foo();
+  ~Foo(); // CHECK: ~Bar();
+};
+
+Foo::Foo() {
+}
+
+Foo::~Foo() { // CHECK: Bar::~Bar()
+}
+
+// Use grep -FUbo 'Foo'  to get the correct offset of foo when changing
+// this file.


Index: clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
===
--- clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
+++ clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
@@ -87,6 +87,28 @@
 return true;
   }
 
+  bool VisitCXXDestructorDecl(clang::CXXDestructorDecl *DestructorDecl) {
+if (getUSRForDecl(DestructorDecl->getParent()) == USR) {
+  // Handles "~Foo" from "Foo::~Foo".
+  SourceLocation Location = DestructorDecl->getLocation();
+  const ASTContext &Context = DestructorDecl->getASTContext();
+  StringRef TokenName = Lexer::getSourceText(
+  CharSourceRange::getTokenRange(Location), Context.getSourceManager(),
+  Context.getLangOpts());
+  // 1 is the length of the "~" string that is not to be touched by the
+  // rename.
+  assert(TokenName.startswith("~"));
+  LocationsFound.push_back(Location.getLocWithOffset(1));
+
+  if (DestructorDecl->isThisDeclarationADefinition()) {
+// Handles "Foo" from "Foo::~Foo".
+LocationsFound.push_back(DestructorDecl->getLocStart());
+  }
+}
+
+return true;
+  }
+
   // Expression visitors:
 
   bool VisitDeclRefExpr(const DeclRefExpr *Expr) {
Index: clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp
===
--- clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp
+++ clang-tools-extra/trunk/test/clang-rename/DtorDefTest.cpp
@@ -0,0 +1,17 @@
+// RUN: cat %s > %t.cpp
+// RUN: clang-rename -offset=135 -new-name=Bar %t.cpp -i --
+// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
+class Foo {
+public:
+  Foo();
+  ~Foo(); // CHECK: ~Bar();
+};
+
+Foo::Foo() {
+}
+
+Foo::~Foo() { // CHECK: Bar::~Bar()
+}
+
+// Use grep -FUbo 'Foo'  to get the correct offset of foo when changing
+// this file.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: Buildbot numbers for the last week of 6/05/2016 - 6/11/2016

2016-06-15 Thread Galina Kistanova via cfe-commits
Maybe a comma-separated attachments?
The tables relay positioning and font.

Thanks

Galina


On Tue, Jun 14, 2016 at 6:59 PM, Sean Silva  wrote:

> Some of these tables are getting quite mangled somewhere along the line
> (email client? mailing list handling? idk). Could you re-send with the
> tables also attached or something else that avoids that problem?
>
> -- Sean Silva
>
>
> On Tue, Jun 14, 2016 at 4:23 PM, Galina Kistanova via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> Hello everyone,
>>
>> Below are some buildbot numbers for the last week of 6/05/2016 -
>> 6/11/2016.
>>
>> Thanks
>>
>> Galina
>>
>>
>>
>>  buildername   |  was_red
>> ---+---
>>  sanitizer-x86_64-linux-bootstrap  | 134:12:25
>>  perf-x86_64-penryn-O3-polly-parallel-fast | 46:29:26
>>  llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast| 37:56:11
>>  polly-amd64-linux | 34:53:03
>>  sanitizer-x86_64-linux-fuzzer | 30:17:25
>>  clang-x64-ninja-win7  | 25:37:00
>>  llvm-clang-lld-x86_64-debian-fast | 25:32:54
>>  clang-cmake-thumbv7-a15-full-sh   | 25:31:44
>>  clang-x86-win2008-selfhost| 25:25:42
>>  clang-atom-d525-fedora-rel| 24:52:25
>>  sanitizer-x86_64-linux| 24:21:15
>>  clang-ppc64be-linux-lnt   | 24:19:40
>>  clang-ppc64be-linux   | 24:02:53
>>  sanitizer-ppc64le-linux   | 22:44:45
>>  lldb-windows7-android | 20:42:45
>>  sanitizer-ppc64be-linux   | 19:49:26
>>  llvm-sphinx-docs  | 19:44:43
>>  clang-s390x-linux | 17:18:07
>>  clang-cmake-mips  | 16:39:48
>>  perf-x86_64-penryn-O3 | 16:32:12
>>  clang-cuda-build  | 12:52:45
>>  llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast  | 11:58:08
>>  perf-x86_64-penryn-O3-polly-before-vectorizer-detect-only | 11:23:05
>>  clang-ppc64le-linux   | 10:55:20
>>  perf-x86_64-penryn-O3-polly   | 10:09:52
>>  libcxx-libcxxabi-x86_64-linux-debian  | 06:31:45
>>  clang-cmake-armv7-a15-selfhost| 04:54:20
>>  clang-ppc64le-linux-multistage| 04:39:08
>>  clang-cmake-mipsel| 04:07:57
>>  lldb-x86_64-darwin-13.4   | 04:07:15
>>  clang-native-arm-lnt  | 04:02:19
>>  lld-x86_64-win7   | 04:01:13
>>  clang-cmake-aarch64-full  | 03:44:15
>>  clang-cmake-armv7-a15-full| 03:39:18
>>  clang-cmake-armv7-a15 | 03:28:48
>>  clang-cmake-thumbv7-a15   | 03:28:06
>>  libcxx-libcxxabi-arm-linux| 03:19:42
>>  clang-ppc64le-linux-lnt   | 03:17:11
>>  clang-x86_64-linux-selfhost-modules   | 02:58:31
>>  clang-cmake-aarch64-quick | 02:39:58
>>  libcxx-libcxxabi-x86_64-linux-ubuntu-unstable-abi | 02:25:49
>>  libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11  | 02:25:33
>>  libcxx-libcxxabi-x86_64-linux-ubuntu-msan | 02:22:56
>>  llvm-mips-linux   | 02:22:54
>>  libcxx-libcxxabi-x86_64-linux-ubuntu-tsan | 02:22:39
>>  libcxx-libcxxabi-x86_64-linux-ubuntu-cxx03| 02:19:56
>>  libcxx-libcxxabi-x86_64-linux-ubuntu-asan | 02:19:30
>>  libcxx-libcxxabi-x86_64-linux-ubuntu-cxx1z| 02:17:10
>>  libcxx-libcxxabi-x86_64-linux-ubuntu-cxx14| 02:14:04
>>  libcxx-libcxxabi-x86_64-linux-ubuntu-cxx11| 02:13:58
>>  libcxx-libcxxabi-libunwind-x86_64-linux-ubuntu| 02:13:27
>>  lldb-x86_64-ubuntu-14.04-android  | 02:10:25
>>  lldb-x86_64-ubuntu-14.04-buildserver  | 02:02:39
>>  clang-x86_64-debian-fast  | 01:52:47
>>  sanitizer-x86_64-linux-fast   | 01:41:33
>>  lldb-amd64-ninja-netbsd7  | 01:36:27
>>  perf-x86_64-penryn-O3-polly-unprofitable  | 01:33:54
>>  clang-x86_64-linux-abi-test   

Re: [PATCH] D20347: Add support to clang-cl driver for /GS switch

2016-06-15 Thread Reid Kleckner via cfe-commits
rnk accepted this revision.
rnk added a reviewer: rnk.
rnk added a comment.

lgtm

Surely this is going to break something, but let's throw the switch and find 
out.


http://reviews.llvm.org/D20347



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


Re: r272253 - clang/test/CodeGenCXX/debug-info-method.cpp: Tweak for thiscall, for targeting Win32 x86.

2016-06-15 Thread Reid Kleckner via cfe-commits
On Wed, Jun 15, 2016 at 11:05 AM, David Blaikie  wrote:

> Perhaps we shouldn't emit it if it's the logical platform default as it
> (to my naive understanding) appears to be here?
>

It is only the default for member functions, and member functions can be
cdecl (the free function default). I think it makes more sense to be
explicit, otherwise the debugger has to infer that, because this is a
member function, it uses a different calling convention.

It looks like there is an open bug to have GCC and GDB use
DW_AT_calling_convention in this way, but it is not closed:
https://sourceware.org/bugzilla/show_bug.cgi?id=15559
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libcxx] r272634 - Implement variadic lock_guard.

2016-06-15 Thread Eric Fiselier via cfe-commits
On Wed, Jun 15, 2016 at 11:45 AM, Craig, Ben via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Does this change (and the paper) permit declarations like the following?
>
> lock_guard<> guard();
>
> If that syntax is allowed, then this is also likely allowed...
>
> lock_guard<>(guard);
>
> I would really like the prior two examples to not compile.  Here is a
> common bug that I see in the wild...
>
> unique_guard(some_member_mutex);
>
> That defines a new, default constructed unique_guard named
> "some_member_mutex", that likely shadows the member variable
> some_member_mutex.  It is almost never what users want.
>

I had no idea that syntax did that. I would have assumed it created an
unnamed temporary. I can see how that would cause bugs.


> Is it possible to have the empty template remain undefined, and let the
> one element lock_guard be the base case of the recursion?  Does that help
> any with the mangling?
>
Nothing in the spec says the empty template should be undefined. The
default constructor on the empty template is technically implementing
"lock_guard(MutexTypes...)" for an empty pack.
However your example provides ample motivation to make it undefined. I'll
go ahead and make that change and I'll file a LWG defect to change the
standard.

There is actually no recursion in the variadic lock_guard implementation,
so the change is trivial.

As for mangling I'm not sure what you mean? It definitely doesn't change
the fact that this change is ABI breaking. (Note this change is not enabled
by default for that reason).

>
> On 6/14/2016 8:24 PM, Eric Fiselier via cfe-commits wrote:
>
> Update on the bot failures:
>
> I've spoken to the owner of the bots and they are planning to upgrade
> their Clang versions.
> This will get the bots green again.
>
> /Eric
>
> On Mon, Jun 13, 2016 at 11:49 PM, Eric Fiselier  wrote:
>
>> This is causing some of the libc++ bots to go red.
>> `variadic_copy.fail.cpp` is encountering an error, which seems to be a
>> clang bug which temporarily existed in 3.9.
>> The test passes against current ToT and older clang releases and GCC.
>>
>> Please do not revert this commit due to that specific failure. I am aware
>> of it and I am working to fix it.
>>
>> On Mon, Jun 13, 2016 at 9:48 PM, Eric Fiselier via cfe-commits <
>> cfe-commits@lists.llvm.org> wrote:
>>
>>> Author: ericwf
>>> Date: Mon Jun 13 22:48:09 2016
>>> New Revision: 272634
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=272634&view=rev
>>> Log:
>>> Implement variadic lock_guard.
>>>
>>> Summary:
>>> This patch implements the variadic `lock_guard` paper.
>>>
>>> Making `lock_guard` variadic is a ABI breaking change because the
>>> specialization `lock_guard<_Mutex>` mangles differently then when it was
>>> the primary template. This change only provides variadic `lock_guard` in
>>> ABI V2 or when `_LIBCPP_ABI_VARIADIC_LOCK_GUARD` is defined.
>>>
>>> Note that in ABI V2 `lock_guard` must always be declared as a variadic
>>> template, even in C++03, in order to keep the ABI consistent. For this
>>> reason `lock_guard` is forward declared as a variadic template in all
>>> standard dialects and therefore depends on variadic templates being
>>> provided as an extension in C++03. All supported versions of Clang and GCC
>>> provide this extension.
>>>
>>>
>>>
>>>
>>> Reviewers: mclow.lists
>>>
>>> Subscribers: K-ballo, mclow.lists, cfe-commits
>>>
>>> Differential Revision: http://reviews.llvm.org/D21260
>>>
>>> Added:
>>> libcxx/trunk/test/libcxx/thread/thread.mutex/thread.lock/
>>>
>>> libcxx/trunk/test/libcxx/thread/thread.mutex/thread.lock/thread.lock.guard/
>>>
>>> libcxx/trunk/test/libcxx/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_mangling.pass.cpp
>>>
>>> libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_adopt_lock.pass.cpp
>>>
>>> libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_assign.fail.cpp
>>>
>>> libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_copy.fail.cpp
>>>
>>> libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.fail.cpp
>>>
>>> libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.pass.cpp
>>>
>>> libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_cxx03.pass.cpp
>>>
>>> libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_types.pass.cpp
>>> Modified:
>>> libcxx/trunk/include/__config
>>> libcxx/trunk/include/__mutex_base
>>> libcxx/trunk/include/mutex
>>>
>>> libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/mutex.fail.cpp
>>> libcxx/trunk/www/cxx1z_status.html
>>>
>>> Modified: libcxx/trunk/include/__config
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=272634&r1=272633&r2=272634&view=diff
>>>
>>> ===

Re: [PATCH] D19274: Compilation for Intel MCU (Part 2/3)

2016-06-15 Thread Bruno Cardoso Lopes via cfe-commits
bruno accepted this revision.
bruno added a comment.
This revision is now accepted and ready to land.

Sure! LGTM


http://reviews.llvm.org/D19274



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


Re: r272253 - clang/test/CodeGenCXX/debug-info-method.cpp: Tweak for thiscall, for targeting Win32 x86.

2016-06-15 Thread David Blaikie via cfe-commits
On Wed, Jun 15, 2016 at 10:59 AM, Reid Kleckner  wrote:

> On Thu, Jun 9, 2016 at 8:59 AM, David Blaikie  wrote:
>
>> Reid - is this intended fallout? (seems plausible, but just checking)
>>
>> Is MinGW a good analogy for any of this work? (does it produce DWARF?
>> Does it use the Windows ABI? Does it emit Calling Convention attributes?)
>>
>
> It is intended fallout, but I didn't see it because I build 64-bit. This
> causes LLVM to emit DW_AT_calling_convention in DWARF as well as the
> equivalent in CodeView.
>
> My version of mingw (GCC 4.8) doesn't appear to emit any calling
> convention attributes, so we're doing something new here.
>

Perhaps we shouldn't emit it if it's the logical platform default as it (to
my naive understanding) appears to be here?

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


Re: r272253 - clang/test/CodeGenCXX/debug-info-method.cpp: Tweak for thiscall, for targeting Win32 x86.

2016-06-15 Thread Reid Kleckner via cfe-commits
On Thu, Jun 9, 2016 at 8:59 AM, David Blaikie  wrote:

> Reid - is this intended fallout? (seems plausible, but just checking)
>
> Is MinGW a good analogy for any of this work? (does it produce DWARF? Does
> it use the Windows ABI? Does it emit Calling Convention attributes?)
>

It is intended fallout, but I didn't see it because I build 64-bit. This
causes LLVM to emit DW_AT_calling_convention in DWARF as well as the
equivalent in CodeView.

My version of mingw (GCC 4.8) doesn't appear to emit any calling convention
attributes, so we're doing something new here.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libcxx] r272634 - Implement variadic lock_guard.

2016-06-15 Thread Craig, Ben via cfe-commits

Does this change (and the paper) permit declarations like the following?

lock_guard<> guard();

If that syntax is allowed, then this is also likely allowed...

lock_guard<>(guard);

I would really like the prior two examples to not compile.  Here is a 
common bug that I see in the wild...


unique_guard(some_member_mutex);

That defines a new, default constructed unique_guard named 
"some_member_mutex", that likely shadows the member variable 
some_member_mutex.  It is almost never what users want.


Is it possible to have the empty template remain undefined, and let the 
one element lock_guard be the base case of the recursion? Does that help 
any with the mangling?



On 6/14/2016 8:24 PM, Eric Fiselier via cfe-commits wrote:

Update on the bot failures:

I've spoken to the owner of the bots and they are planning to upgrade 
their Clang versions.

This will get the bots green again.

/Eric

On Mon, Jun 13, 2016 at 11:49 PM, Eric Fiselier > wrote:


This is causing some of the libc++ bots to go red.
`variadic_copy.fail.cpp` is encountering an error, which seems to
be a clang bug which temporarily existed in 3.9.
The test passes against current ToT and older clang releases and GCC.

Please do not revert this commit due to that specific failure. I
am aware of it and I am working to fix it.

On Mon, Jun 13, 2016 at 9:48 PM, Eric Fiselier via cfe-commits
mailto:cfe-commits@lists.llvm.org>>
wrote:

Author: ericwf
Date: Mon Jun 13 22:48:09 2016
New Revision: 272634

URL: http://llvm.org/viewvc/llvm-project?rev=272634&view=rev
Log:
Implement variadic lock_guard.

Summary:
This patch implements the variadic `lock_guard` paper.

Making `lock_guard` variadic is a ABI breaking change because
the specialization `lock_guard<_Mutex>` mangles differently
then when it was the primary template. This change only
provides variadic `lock_guard` in ABI V2 or when
`_LIBCPP_ABI_VARIADIC_LOCK_GUARD` is defined.

Note that in ABI V2 `lock_guard` must always be declared as a
variadic template, even in C++03, in order to keep the ABI
consistent. For this reason `lock_guard` is forward declared
as a variadic template in all standard dialects and therefore
depends on variadic templates being provided as an extension
in C++03. All supported versions of Clang and GCC provide this
extension.




Reviewers: mclow.lists

Subscribers: K-ballo, mclow.lists, cfe-commits

Differential Revision: http://reviews.llvm.org/D21260

Added:
libcxx/trunk/test/libcxx/thread/thread.mutex/thread.lock/

libcxx/trunk/test/libcxx/thread/thread.mutex/thread.lock/thread.lock.guard/

libcxx/trunk/test/libcxx/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_mangling.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_adopt_lock.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_assign.fail.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_copy.fail.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.fail.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_cxx03.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_types.pass.cpp
Modified:
libcxx/trunk/include/__config
libcxx/trunk/include/__mutex_base
libcxx/trunk/include/mutex

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/mutex.fail.cpp
libcxx/trunk/www/cxx1z_status.html

Modified: libcxx/trunk/include/__config
URL:

http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=272634&r1=272633&r2=272634&view=diff

==
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Mon Jun 13 22:48:09 2016
@@ -43,6 +43,7 @@
 #define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB
 #define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB
 #define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE
+#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
 #endif

 #define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y

Modified: libcxx/trunk/include/__mutex_base
URL:

http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__mutex_base?rev=272634&r1=272633&r2=272634&view=diff

=

Re: [PATCH] D21277: Resubmit r270688: Using new TargetParser in Clang.

2016-06-15 Thread Renato Golin via cfe-commits
rengolin added inline comments.


Comment at: lib/Basic/Targets.cpp:5709
@@ -5716,3 +5708,3 @@
 
   void getTargetDefines(const LangOptions &Opts,
 MacroBuilder &Builder) const override {

We'll have to re-work these parts anyway. When I was looking to do the target 
parser for aarch64 last year, I realised that there are a lot of weird 
decisions (like this one), and I'd rather do it slowly and surely, to make sure 
we do it right.

IIRC, this function was being used as "checkCPU" instead on the ARM target as 
well, and we made it do what it says in the tin. There are a lot of changed in 
the ARM world that we can easily translate here.

But not on this patch. :)


Repository:
  rL LLVM

http://reviews.llvm.org/D21277



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


[libcxx] r272809 - Add -Wno-unused-command-line-argument when running the test suite to prevent errors

2016-06-15 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Wed Jun 15 12:25:05 2016
New Revision: 272809

URL: http://llvm.org/viewvc/llvm-project?rev=272809&view=rev
Log:
Add -Wno-unused-command-line-argument when running the test suite to prevent 
errors

Modified:
libcxx/trunk/test/libcxx/test/config.py

Modified: libcxx/trunk/test/libcxx/test/config.py
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/test/config.py?rev=272809&r1=272808&r2=272809&view=diff
==
--- libcxx/trunk/test/libcxx/test/config.py (original)
+++ libcxx/trunk/test/libcxx/test/config.py Wed Jun 15 12:25:05 2016
@@ -538,6 +538,7 @@ class Configuration(object):
 '-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER',
 '-Wall', '-Wextra', '-Werror'
 ]
+
self.cxx.addWarningFlagIfSupported('-Wno-unused-command-line-argument')
 self.cxx.addWarningFlagIfSupported('-Wno-attributes')
 self.cxx.addWarningFlagIfSupported('-Wno-pessimizing-move')
 self.cxx.addWarningFlagIfSupported('-Wno-c++11-extensions')


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


r272807 - [x86] generate IR for SSE integer min/max builtins

2016-06-15 Thread Sanjay Patel via cfe-commits
Author: spatel
Date: Wed Jun 15 12:18:50 2016
New Revision: 272807

URL: http://llvm.org/viewvc/llvm-project?rev=272807&view=rev
Log:
[x86] generate IR for SSE integer min/max builtins
Sibling patch to r272806:
http://reviews.llvm.org/rL272806

Modified:
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/test/CodeGen/sse2-builtins.c
cfe/trunk/test/CodeGen/sse41-builtins.c

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=272807&r1=272806&r2=272807&view=diff
==
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Wed Jun 15 12:18:50 2016
@@ -6788,6 +6788,33 @@ Value *CodeGenFunction::EmitX86BuiltinEx
   case X86::BI__builtin_ia32_pcmpgtq256_mask:
   case X86::BI__builtin_ia32_pcmpgtq512_mask:
 return EmitX86MaskedCompare(*this, ICmpInst::ICMP_SGT, Ops);
+
+  // TODO: Handle 64/256/512-bit vector widths of min/max.
+  case X86::BI__builtin_ia32_pmaxsb128:
+  case X86::BI__builtin_ia32_pmaxsw128:
+  case X86::BI__builtin_ia32_pmaxsd128: {
+Value *Cmp = Builder.CreateICmp(ICmpInst::ICMP_SGT, Ops[0], Ops[1]);
+return Builder.CreateSelect(Cmp, Ops[0], Ops[1]);
+  }
+  case X86::BI__builtin_ia32_pmaxub128:
+  case X86::BI__builtin_ia32_pmaxuw128:
+  case X86::BI__builtin_ia32_pmaxud128: {
+Value *Cmp = Builder.CreateICmp(ICmpInst::ICMP_UGT, Ops[0], Ops[1]);
+return Builder.CreateSelect(Cmp, Ops[0], Ops[1]);
+  }
+  case X86::BI__builtin_ia32_pminsb128:
+  case X86::BI__builtin_ia32_pminsw128:
+  case X86::BI__builtin_ia32_pminsd128: {
+Value *Cmp = Builder.CreateICmp(ICmpInst::ICMP_SLT, Ops[0], Ops[1]);
+return Builder.CreateSelect(Cmp, Ops[0], Ops[1]);
+  }
+  case X86::BI__builtin_ia32_pminub128:
+  case X86::BI__builtin_ia32_pminuw128:
+  case X86::BI__builtin_ia32_pminud128: {
+Value *Cmp = Builder.CreateICmp(ICmpInst::ICMP_ULT, Ops[0], Ops[1]);
+return Builder.CreateSelect(Cmp, Ops[0], Ops[1]);
+  }
+
   // 3DNow!
   case X86::BI__builtin_ia32_pswapdsf:
   case X86::BI__builtin_ia32_pswapdsi: {

Modified: cfe/trunk/test/CodeGen/sse2-builtins.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=272807&r1=272806&r2=272807&view=diff
==
--- cfe/trunk/test/CodeGen/sse2-builtins.c (original)
+++ cfe/trunk/test/CodeGen/sse2-builtins.c Wed Jun 15 12:18:50 2016
@@ -679,13 +679,15 @@ void test_mm_maskmoveu_si128(__m128i A,
 
 __m128i test_mm_max_epi16(__m128i A, __m128i B) {
   // CHECK-LABEL: test_mm_max_epi16
-  // CHECK: call <8 x i16> @llvm.x86.sse2.pmaxs.w(<8 x i16> %{{.*}}, <8 x i16> 
%{{.*}})
+  // CHECK:   [[CMP:%.*]] = icmp sgt <8 x i16> [[X:%.*]], [[Y:%.*]]
+  // CHECK-NEXT:  select <8 x i1> [[CMP]], <8 x i16> [[X]], <8 x i16> [[Y]]
   return _mm_max_epi16(A, B);
 }
 
 __m128i test_mm_max_epu8(__m128i A, __m128i B) {
   // CHECK-LABEL: test_mm_max_epu8
-  // CHECK: call <16 x i8> @llvm.x86.sse2.pmaxu.b(<16 x i8> %{{.*}}, <16 x i8> 
%{{.*}})
+  // CHECK:   [[CMP:%.*]] = icmp ugt <16 x i8> [[X:%.*]], [[Y:%.*]]
+  // CHECK-NEXT:  select <16 x i1> [[CMP]], <16 x i8> [[X]], <16 x i8> [[Y]]
   return _mm_max_epu8(A, B);
 }
 
@@ -709,13 +711,15 @@ void test_mm_mfence() {
 
 __m128i test_mm_min_epi16(__m128i A, __m128i B) {
   // CHECK-LABEL: test_mm_min_epi16
-  // CHECK: call <8 x i16> @llvm.x86.sse2.pmins.w(<8 x i16> %{{.*}}, <8 x i16> 
%{{.*}})
+  // CHECK:   [[CMP:%.*]] = icmp slt <8 x i16> [[X:%.*]], [[Y:%.*]]
+  // CHECK-NEXT:  select <8 x i1> [[CMP]], <8 x i16> [[X]], <8 x i16> [[Y]]
   return _mm_min_epi16(A, B);
 }
 
 __m128i test_mm_min_epu8(__m128i A, __m128i B) {
   // CHECK-LABEL: test_mm_min_epu8
-  // CHECK: call <16 x i8> @llvm.x86.sse2.pminu.b(<16 x i8> %{{.*}}, <16 x i8> 
%{{.*}})
+  // CHECK:   [[CMP:%.*]] = icmp ult <16 x i8> [[X:%.*]], [[Y:%.*]]
+  // CHECK-NEXT:  select <16 x i1> [[CMP]], <16 x i8> [[X]], <16 x i8> [[Y]]
   return _mm_min_epu8(A, B);
 }
 

Modified: cfe/trunk/test/CodeGen/sse41-builtins.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse41-builtins.c?rev=272807&r1=272806&r2=272807&view=diff
==
--- cfe/trunk/test/CodeGen/sse41-builtins.c (original)
+++ cfe/trunk/test/CodeGen/sse41-builtins.c Wed Jun 15 12:18:50 2016
@@ -245,49 +245,57 @@ __m128 test_mm_insert_ps(__m128 x, __m12
 
 __m128i test_mm_max_epi8(__m128i x, __m128i y) {
   // CHECK-LABEL: test_mm_max_epi8
-  // CHECK: call <16 x i8> @llvm.x86.sse41.pmaxsb(<16 x i8> %{{.*}}, <16 x i8> 
%{{.*}})
+  // CHECK:   [[CMP:%.*]] = icmp sgt <16 x i8> [[X:%.*]], [[Y:%.*]]
+  // CHECK-NEXT:  select <16 x i1> [[CMP]], <16 x i8> [[X]], <16 x i8> [[Y]]
   return _mm_max_epi8(x, y);
 }
 
 __m128i test_mm_max_epi32(__m128i x, __m128i y) {
   // CHECK-LABEL: test_mm_max_epi32
-  // CH

[libcxx] r272804 - Fix const default initialization of lock_guard<>

2016-06-15 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Wed Jun 15 12:04:40 2016
New Revision: 272804

URL: http://llvm.org/viewvc/llvm-project?rev=272804&view=rev
Log:
Fix const default initialization of lock_guard<>

Modified:
libcxx/trunk/include/mutex

Modified: libcxx/trunk/include/mutex
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/mutex?rev=272804&r1=272803&r2=272804&view=diff
==
--- libcxx/trunk/include/mutex (original)
+++ libcxx/trunk/include/mutex Wed Jun 15 12:04:40 2016
@@ -617,7 +617,7 @@ call_once(once_flag& __flag, const _Call
 template <>
 class _LIBCPP_TYPE_VIS_ONLY lock_guard<> {
 public:
-explicit lock_guard() = default;
+explicit lock_guard() {}
 ~lock_guard() = default;
 
 _LIBCPP_INLINE_VISIBILITY


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


Re: [PATCH] D21375: Remove a redundant set of applyAllReplacements declarations.

2016-06-15 Thread Eric Liu via cfe-commits
ioeric abandoned this revision.
ioeric added a comment.

Abandon this patch in favor of http://reviews.llvm.org/D21382


http://reviews.llvm.org/D21375



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


Re: [PATCH] D21306: [x86] AVX FP compare builtins should require AVX target feature (PR28112)

2016-06-15 Thread Simon Pilgrim via cfe-commits
RKSimon added a comment.

It seems like part of the need for this is because the _mm_cmp_ps style 
intrinsics are defined as macros (to get around the problem of trying to use an 
immediate as an argument):

  #define _mm_cmp_ps(a, b, c) __extension__ ({ \
(__m128)__builtin_ia32_cmpps((__v4sf)(__m128)(a), \
 (__v4sf)(__m128)(b), (c)); })

which means clang can't use a __target__("avx") attribute to stop their use.

Given that I'm happy with this patch's approach - anyone else have any 
suggestions?


http://reviews.llvm.org/D21306



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


[clang-tools-extra] r272803 - [clang-tidy] Remove dead code. NFC.

2016-06-15 Thread Benjamin Kramer via cfe-commits
Author: d0k
Date: Wed Jun 15 11:51:04 2016
New Revision: 272803

URL: http://llvm.org/viewvc/llvm-project?rev=272803&view=rev
Log:
[clang-tidy] Remove dead code. NFC.

Modified:
clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.cpp
clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.h

Modified: clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.cpp?rev=272803&r1=272802&r2=272803&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.cpp Wed Jun 
15 11:51:04 2016
@@ -878,20 +878,6 @@ bool VariableNamer::declarationExists(St
   return DeclFinder.findUsages(SourceStmt);
 }
 
-std::string VariableNamer::AppendWithStyle(StringRef Str,
-   StringRef Suffix) const {
-  std::string Name = Str;
-  if (!Suffix.empty()) {
-if (Style == NS_LowerCase || Style == NS_UpperCase)
-  Name += "_";
-int SuffixStart = Name.size();
-Name += Suffix;
-if (Style == NS_CamelBack)
-  Name[SuffixStart] = toupper(Name[SuffixStart]);
-  }
-  return Name;
-}
-
 } // namespace modernize
 } // namespace tidy
 } // namespace clang

Modified: clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.h
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.h?rev=272803&r1=272802&r2=272803&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.h (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.h Wed Jun 15 
11:51:04 2016
@@ -450,9 +450,6 @@ private:
   // Determine whether or not a declaration that would conflict with Symbol
   // exists in an outer context or in any statement contained in SourceStmt.
   bool declarationExists(llvm::StringRef Symbol);
-
-  // Concatenates two identifiers following the current naming style.
-  std::string AppendWithStyle(StringRef Str, StringRef Suffix) const;
 };
 
 } // namespace modernize


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


Re: [PATCH] D21187: Allow use of lambda expressions in array bounds

2016-06-15 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment.

Sorry for my late reply.



Comment at: lib/Sema/SemaExpr.cpp:12825
@@ -12824,1 +12824,3 @@
+  // BlockContext.
+  } else if (!Rec.IsArrayBound) {
 // C++1y [expr.const]p2:

rsmith wrote:
> This isn't correct; you still need to produce the diagnostic even if we're in 
> an array bound, but it should be an `ExtWarn` controlled by `-Wvla`. A case 
> like
> 
> void f() {
>   int arr[ true ? 1 : []{return 0}() ];
> }
> 
> is ill-formed in standard C++, but as we can evaluate the array bound as a 
> constant, Clang will no longer diagnose it with this change in place.
Is this ill-formed too in standard c++?

int a[true ? 2 : !dynamic_cast(s1) + 1];

clang doesn't warn or error out when compiling the expression above.



Comment at: lib/Sema/SemaExpr.cpp:12848-12853
@@ -12846,8 +12847,8 @@
   if (Rec.isUnevaluated() || Rec.Context == ConstantEvaluated) {
 ExprCleanupObjects.erase(ExprCleanupObjects.begin() + 
Rec.NumCleanupObjects,
  ExprCleanupObjects.end());
 ExprNeedsCleanups = Rec.ParentNeedsCleanups;
 CleanupVarDeclMarking();
 std::swap(MaybeODRUseExprs, Rec.SavedMaybeODRUseExprs);
   // Otherwise, merge the contexts together.
   } else {

rsmith wrote:
> This also looks wrong for your lambda-in-VLA-bound case.
> 
> Perhaps the best thing to do is to check whether we have a VLA *before* we 
> pop the ExpressionEvaluationContextRecord, and if so, convert the context 
> from ConstantEvaluated to Evaluated.
It seems like we won't be able to warn about lambdas in constant expressions at 
all if we change the context before popping ExpressionEvaluationContextRecord, 
so there would be no warnings for your example code (ternary expression used 
for array bound). Is that your intention?


http://reviews.llvm.org/D21187



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


Re: [PATCH] D21343: Implement `lcm` and `gcd` from library fundamentals V2

2016-06-15 Thread Marshall Clow via cfe-commits
mclow.lists marked 8 inline comments as done.
mclow.lists added a comment.

http://reviews.llvm.org/D21343



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


Re: [PATCH] D21343: Implement `lcm` and `gcd` from library fundamentals V2

2016-06-15 Thread Marshall Clow via cfe-commits
mclow.lists updated this revision to Diff 60856.
mclow.lists added a comment.

Updated based on comments here and elsewhere.

- Do the abs once, rather than at every level of recursion
- Add tests for `bool`.
- Constexpr

Also, add an assertion to detect overflow in `lcm`.

I have not yet incorporated Eric's constexpr tests.


http://reviews.llvm.org/D21343

Files:
  include/experimental/numeric
  test/std/experimental/numeric/numeric.ops.overview/nothing_to_do.pass.cpp
  test/std/experimental/numeric/numeric.ops/nothing_to_do.pass.cpp
  
test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp
  
test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp
  test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
  
test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp
  
test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp
  test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp

Index: test/std/experimental/numeric/numeric.ops.overview/nothing_to_do.pass.cpp
===
--- test/std/experimental/numeric/numeric.ops.overview/nothing_to_do.pass.cpp
+++ test/std/experimental/numeric/numeric.ops.overview/nothing_to_do.pass.cpp
@@ -0,0 +1,15 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+//
+// UNSUPPORTED: c++98, c++03, c++11
+// 
+
+#include 
+
+int main () {}
Index: test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
===
--- test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
+++ test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
@@ -0,0 +1,260 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+// 
+// UNSUPPORTED: c++98, c++03, c++11
+// 
+
+// template
+// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
+
+#include 
+#include 
+#include 
+
+template 
+void test0(Input1 in1, Input2 in2, Output out)
+{
+static_assert((std::is_same::value), "" );
+static_assert((std::is_same::value), "" );
+assert(out == std::experimental::lcm(in1, in2));
+assert(out == std::experimental::lcm(in2, in1));
+}
+
+
+template 
+void test_same_signed()
+{
+static_assert(( std::is_signed::value), "" );
+
+//  Returns: zero when either m or n is zero.
+test0( 0,  0,  0);
+test0( 1,  0,  0);
+test0( 0,  1,  0);
+test0(-1,  0,  0);
+test0( 0, -1,  0);
+
+//  Otherwise, returns the least common multiple of |m| and |n|.
+test0(  1,   1,  1);
+test0(  2,   3,  6);
+test0(  2,   4,  4);
+test0(  3,  17, 51);
+test0( 36,  18, 36);
+
+test0( -1,   1,  1);
+test0( -2,   3,  6);
+test0( -2,   4,  4);
+test0( -3,  17, 51);
+test0(-36,  18, 36);
+
+test0(  1,  -1,  1);
+test0(  2,  -3,  6);
+test0(  2,  -4,  4);
+test0(  3, -17, 51);
+test0( 36, -18, 36);
+
+test0( -1,  -1,  1);
+test0( -2,  -3,  6);
+test0( -2,  -4,  4);
+test0( -3, -17, 51);
+test0(-36, -18, 36);
+}
+
+template 
+void test_same_unsigned()
+{
+static_assert((!std::is_signed::value), "" );
+
+//  Returns: zero when either m or n is zero.
+test0( 0,  0,  0);
+test0( 1,  0,  0);
+test0( 0,  1,  0);
+
+//  Otherwise, returns the least common multiple of |m| and |n|.
+test0(  1,   1,  1);
+test0(  2,   3,  6);
+test0(  2,   4,  4);
+test0(  3,  17, 51);
+test0( 36,  18, 36);
+}
+
+
+template 
+void test_different_signed()
+{
+static_assert(( std::is_signed::value), "" );
+static_assert(( std::is_signed::value), "" );
+
+//  Returns: zero when either m or n is zero.
+test0( 0,  0,  0);
+test0( 1,  0,  0);
+test0( 0,  1,  0);
+test0(-1,  0,  0);
+test0( 0, -1,  0);
+
+//  Otherwise, returns the least common multiple of |m| and |n|.
+test0(  1,   1,  1);
+test0(  2,   3,  6);
+test0(  2,   4,  4);
+test0(  3,  17, 51);
+test0( 36,  18, 36);
+
+test0( -1,   1,  1);
+test0( -2,   3,  6);
+test0( -2,   4,  4);
+test0( -3,  17, 51);
+test0(-36,  18, 36);
+
+test0(  1,  -1,  1);
+test0(  2,  -3,  6);
+test0(  2,  -4,  4);
+test0(  3, -17, 51);
+test0( 36, -18, 36);
+
+test0( -1,  -1,  1

r272798 - [Sparc] setjmp and longjmp intrinsic support update to add unit tests and remove accidentally checked-in code.

2016-06-15 Thread Chris Dewhurst via cfe-commits
Author: lerochris
Date: Wed Jun 15 11:08:13 2016
New Revision: 272798

URL: http://llvm.org/viewvc/llvm-project?rev=272798&view=rev
Log:
[Sparc] setjmp and longjmp intrinsic support update to add unit tests and 
remove accidentally checked-in code.

Related to revision r272782

Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/Sema/builtin-longjmp.c

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=272798&r1=272797&r2=272798&view=diff
==
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Jun 15 11:08:13 2016
@@ -6566,7 +6566,6 @@ public:
   SparcV8TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
   : SparcTargetInfo(Triple, Opts) {
 resetDataLayout("E-m:e-p:32:32-i64:64-f128:64-n32-S64");
-MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
 // NetBSD / OpenBSD use long (same as llvm default); everyone else uses 
int.
 switch (getTriple().getOS()) {
 default:

Modified: cfe/trunk/test/Sema/builtin-longjmp.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/builtin-longjmp.c?rev=272798&r1=272797&r2=272798&view=diff
==
--- cfe/trunk/test/Sema/builtin-longjmp.c (original)
+++ cfe/trunk/test/Sema/builtin-longjmp.c Wed Jun 15 11:08:13 2016
@@ -3,6 +3,7 @@
 // RUN: %clang_cc1 -triple x86_64-windows -emit-llvm < %s| FileCheck %s
 // RUN: %clang_cc1 -triple powerpc-unknown-unknown -emit-llvm < %s| FileCheck 
%s
 // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -emit-llvm < %s| 
FileCheck %s
+// RUN: %clang_cc1 -triple sparc-eabi-unknown -emit-llvm < %s | FileCheck %s
 
 // RUN: %clang_cc1 -triple aarch64-unknown-unknown -emit-llvm-only -verify %s
 // RUN: %clang_cc1 -triple mips-unknown-unknown -emit-llvm-only -verify %s


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


[PATCH] D21385: Adjust Registry interface to not require plugins to export a registry

2016-06-15 Thread John Brawn via cfe-commits
john.brawn created this revision.
john.brawn added reviewers: ehsan, reames, chapuni.
john.brawn added subscribers: llvm-commits, cfe-commits.
john.brawn set the repository for this revision to rL LLVM.
Herald added a subscriber: klimek.

Currently the Registry class contains the vestiges of a previous attempt to 
allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a 
plugin would have its own copy of a registry and export it to be imported by 
the tool that's loading the plugin. This only works if the plugin is entirely 
self-contained with the only interface between the plugin and tool being the 
registry, and in particular this conflicts with how IR pass plugins work.

This patch changes things so that instead the add_node function of the registry 
is exported by the tool and then imported by the plugin, which solves this 
problem and also means that instead of every plugin having to export every 
registry they use instead LLVM only has to export the add_node functions. This 
allows plugins that use a registry to work on Windows if 
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used.


Repository:
  rL LLVM

http://reviews.llvm.org/D21385

Files:
  cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt
  cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt
  cfe/trunk/examples/analyzer-plugin/CMakeLists.txt
  cfe/trunk/include/clang/Frontend/FrontendPluginRegistry.h
  cfe/trunk/include/clang/Lex/Preprocessor.h
  cfe/trunk/lib/Frontend/FrontendAction.cpp
  cfe/trunk/lib/Lex/Preprocessor.cpp
  cfe/trunk/lib/Tooling/CompilationDatabase.cpp
  llvm/trunk/include/llvm/Support/Registry.h
  llvm/trunk/lib/CodeGen/GCMetadataPrinter.cpp
  llvm/trunk/lib/CodeGen/GCStrategy.cpp

Index: llvm/trunk/lib/CodeGen/GCStrategy.cpp
===
--- llvm/trunk/lib/CodeGen/GCStrategy.cpp
+++ llvm/trunk/lib/CodeGen/GCStrategy.cpp
@@ -16,6 +16,8 @@
 
 using namespace llvm;
 
+LLVM_INSTANTIATE_REGISTRY(GCRegistry)
+
 GCStrategy::GCStrategy()
 : UseStatepoints(false), NeededSafePoints(0), CustomReadBarriers(false),
   CustomWriteBarriers(false), CustomRoots(false), InitRoots(true),
Index: llvm/trunk/lib/CodeGen/GCMetadataPrinter.cpp
===
--- llvm/trunk/lib/CodeGen/GCMetadataPrinter.cpp
+++ llvm/trunk/lib/CodeGen/GCMetadataPrinter.cpp
@@ -14,6 +14,8 @@
 #include "llvm/CodeGen/GCMetadataPrinter.h"
 using namespace llvm;
 
+LLVM_INSTANTIATE_REGISTRY(GCMetadataPrinterRegistry)
+
 GCMetadataPrinter::GCMetadataPrinter() {}
 
 GCMetadataPrinter::~GCMetadataPrinter() {}
Index: llvm/trunk/include/llvm/Support/Registry.h
===
--- llvm/trunk/include/llvm/Support/Registry.h
+++ llvm/trunk/include/llvm/Support/Registry.h
@@ -69,13 +69,14 @@
   node(const entry &V) : Next(nullptr), Val(V) {}
 };
 
-static void add_node(node *N) {
-  if (Tail)
-Tail->Next = N;
-  else
-Head = N;
-  Tail = N;
-}
+/// Add a node to the Registry: this is the interface between the plugin and
+/// the executable.
+///
+/// This function is exported by the executable and called by the plugin to
+/// add a node to the executable's registry. Therefore it's not defined here
+/// to avoid it being instantiated in the plugin and is instead defined in
+/// the executable (see LLVM_INSTANTIATE_REGISTRY below).
+static void add_node(node *N);
 
 /// Iterators for registry entries.
 ///
@@ -120,61 +121,23 @@
 add_node(&Node);
   }
 };
-
-/// A dynamic import facility.  This is used on Windows to
-/// import the entries added in the plugin.
-static void import(sys::DynamicLibrary &DL, const char *RegistryName) {
-  typedef void *(*GetRegistry)();
-  std::string Name("LLVMGetRegistry_");
-  Name.append(RegistryName);
-  GetRegistry Getter =
-  (GetRegistry)(intptr_t)DL.getAddressOfSymbol(Name.c_str());
-  if (Getter) {
-// Call the getter function in order to get the full copy of the
-// registry defined in the plugin DLL, and copy them over to the
-// current Registry.
-typedef std::pair Info;
-Info *I = static_cast(Getter());
-iterator begin(I->first);
-iterator end(I->second);
-for (++end; begin != end; ++begin) {
-  // This Node object needs to remain alive for the
-  // duration of the program.
-  add_node(new node(*begin));
-}
-  }
-}
-
-/// Retrieve the data to be passed across DLL boundaries when
-/// importing registries from another DLL on Windows.
-static void *exportRegistry() {
-  static std::pair Info(Head, Tail);
-  return &Info;
-}
   };
-
-  
-  // Since these are defined in a header file, plugins must be sure to export
-  // these symbols.
-  template 
-  typename Registry::node *Registry::Head;
-
-  te

[clang-tools-extra] r272795 - Apply performance-unnecessary-value-param to clang-tidy.

2016-06-15 Thread Benjamin Kramer via cfe-commits
Author: d0k
Date: Wed Jun 15 10:46:10 2016
New Revision: 272795

URL: http://llvm.org/viewvc/llvm-project?rev=272795&view=rev
Log:
Apply performance-unnecessary-value-param to clang-tidy.

With minor manual tweaks. No functionality change intended.

Modified:
clang-tools-extra/trunk/clang-tidy/ClangTidyModule.cpp
clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/DanglingHandleCheck.cpp

clang-tools-extra/trunk/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp

Modified: clang-tools-extra/trunk/clang-tidy/ClangTidyModule.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidyModule.cpp?rev=272795&r1=272794&r2=272795&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/ClangTidyModule.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidyModule.cpp Wed Jun 15 10:46:10 
2016
@@ -18,7 +18,7 @@ namespace tidy {
 
 void ClangTidyCheckFactories::registerCheckFactory(StringRef Name,
CheckFactory Factory) {
-  Factories[Name] = Factory;
+  Factories[Name] = std::move(Factory);
 }
 
 void ClangTidyCheckFactories::createChecks(

Modified: clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp?rev=272795&r1=272794&r2=272795&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp 
(original)
+++ clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp Wed 
Jun 15 10:46:10 2016
@@ -29,7 +29,8 @@ void ExplicitConstructorCheck::registerM
 
 // Looks for the token matching the predicate and returns the range of the 
found
 // token including trailing whitespace.
-static SourceRange FindToken(const SourceManager &Sources, LangOptions 
LangOpts,
+static SourceRange FindToken(const SourceManager &Sources,
+ const LangOptions &LangOpts,
  SourceLocation StartLoc, SourceLocation EndLoc,
  bool (*Pred)(const Token &)) {
   if (StartLoc.isMacroID() || EndLoc.isMacroID())

Modified: clang-tools-extra/trunk/clang-tidy/misc/DanglingHandleCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/DanglingHandleCheck.cpp?rev=272795&r1=272794&r2=272795&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/misc/DanglingHandleCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/DanglingHandleCheck.cpp Wed Jun 15 
10:46:10 2016
@@ -21,14 +21,14 @@ namespace misc {
 namespace {
 
 ast_matchers::internal::BindableMatcher
-handleFrom(ast_matchers::internal::Matcher IsAHandle,
-   ast_matchers::internal::Matcher Arg) {
+handleFrom(const ast_matchers::internal::Matcher &IsAHandle,
+   const ast_matchers::internal::Matcher &Arg) {
   return cxxConstructExpr(hasDeclaration(cxxMethodDecl(ofClass(IsAHandle))),
   hasArgument(0, Arg));
 }
 
 ast_matchers::internal::Matcher handleFromTemporaryValue(
-ast_matchers::internal::Matcher IsAHandle) {
+const ast_matchers::internal::Matcher &IsAHandle) {
   // If a ternary operator returns a temporary value, then both branches hold a
   // temporary value. If one of them is not a temporary then it must be copied
   // into one to satisfy the type of the operator.
@@ -54,8 +54,8 @@ ast_matchers::internal::Matcher
-makeContainerMatcher(ast_matchers::internal::Matcher IsAHandle) {
+ast_matchers::internal::BindableMatcher makeContainerMatcher(
+const ast_matchers::internal::Matcher &IsAHandle) {
   // This matcher could be expanded to detect:
   //  - Constructors: eg. vector(3, string("A"));
   //  - emplace*(): This requires a different logic to determine that

Modified: 
clang-tools-extra/trunk/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp?rev=272795&r1=272794&r2=272795&view=diff
==
--- 
clang-tools-extra/trunk/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp
 (original)
+++ 
clang-tools-extra/trunk/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp
 Wed Jun 15 10:46:10 2016
@@ -186,7 +186,7 @@ getParameterSourceDeclaration(const Func
 
 std::string joinParameterNames(
 const DifferingParamsContainer &DifferingParams,
-std::function Ch

Re: [PATCH] D21241: Add an ASTMatcher for ignoring ExprWithCleanups.

2016-06-15 Thread Etienne Bergeron via cfe-commits
etienneb added a subscriber: etienneb.
etienneb added a comment.

I was wondering why we didn't created that Matcher: IgnoreImplicit

I believe it's more commonly used than 'ignoringExprWithCleanups'.

It can be implemented by calling 'Stmt.IgnoreImplicit'.

  /// Skip past any implicit AST nodes which might surround this
  /// statement, such as ExprWithCleanups or ImplicitCastExpr nodes.
  Stmt *IgnoreImplicit();



Comment at: unittests/ASTMatchers/ASTMatchersTraversalTest.cpp:2018
@@ +2017,3 @@
+ ignoringParenImpCasts(unless(anything(;
+  EXPECT_TRUE(notMatches("float y = (float(0));",
+ varDecl(hasInitializer(ignoringExprWithCleanups(

nit: you can lift that expression to a local variable:

varDecl(hasInitializer(ignoringExprWithCleanups(
 ignoringParenImpCasts(integerLiteral()))

It's used 3 times.


http://reviews.llvm.org/D21241



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


r272790 - Reverting r272777 because one of the tests

2016-06-15 Thread Ranjeet Singh via cfe-commits
Author: rsingh
Date: Wed Jun 15 09:21:28 2016
New Revision: 272790

URL: http://llvm.org/viewvc/llvm-project?rev=272790&view=rev
Log:
Reverting r272777 because one of the tests
added in the llvm patch is causing an assertion
to fail.

Modified:
cfe/trunk/include/clang/Basic/BuiltinsARM.def
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/test/CodeGen/builtins-arm.c
cfe/trunk/test/Sema/builtins-arm.c

Modified: cfe/trunk/include/clang/Basic/BuiltinsARM.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsARM.def?rev=272790&r1=272789&r2=272790&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsARM.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsARM.def Wed Jun 15 09:21:28 2016
@@ -58,16 +58,14 @@ BUILTIN(__builtin_arm_stcl, "vUIiUIiv*",
 BUILTIN(__builtin_arm_stc2, "vUIiUIiv*", "")
 BUILTIN(__builtin_arm_stc2l, "vUIiUIiv*", "")
 
-BUILTIN(__builtin_arm_cdp, "vUIiUIiUIiUIiUIiUIi", "")
-BUILTIN(__builtin_arm_cdp2, "vUIiUIiUIiUIiUIiUIi", "")
 BUILTIN(__builtin_arm_mcr, "vUIiUIiUiUIiUIiUIi", "")
 BUILTIN(__builtin_arm_mcr2, "vUIiUIiUiUIiUIiUIi", "")
 BUILTIN(__builtin_arm_mrc, "UiUIiUIiUIiUIiUIi", "")
 BUILTIN(__builtin_arm_mrc2, "UiUIiUIiUIiUIiUIi", "")
-BUILTIN(__builtin_arm_mcrr, "vUIiUIiLLUiUIi", "")
-BUILTIN(__builtin_arm_mcrr2, "vUIiUIiLLUiUIi", "")
-BUILTIN(__builtin_arm_mrrc, "LLUiUIiUIiUIi", "")
-BUILTIN(__builtin_arm_mrrc2, "LLUiUIiUIiUIi", "")
+BUILTIN(__builtin_arm_cdp, "vUIiUIiUIiUIiUIiUIi", "")
+BUILTIN(__builtin_arm_cdp2, "vUIiUIiUIiUIiUIiUIi", "")
+BUILTIN(__builtin_arm_mcrr, "vUIiUIiUiUiUIi", "")
+BUILTIN(__builtin_arm_mcrr2, "vUIiUIiUiUiUIi", "")
 
 // CRC32
 BUILTIN(__builtin_arm_crc32b, "UiUiUc", "nc")

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=272790&r1=272789&r2=272790&view=diff
==
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Wed Jun 15 09:21:28 2016
@@ -3793,74 +3793,6 @@ Value *CodeGenFunction::EmitARMBuiltinEx
 return EmitNounwindRuntimeCall(CGM.CreateRuntimeFunction(FTy, Name), Ops);
   }
 
-  if (BuiltinID == ARM::BI__builtin_arm_mcrr ||
-  BuiltinID == ARM::BI__builtin_arm_mcrr2) {
-Function *F;
-
-switch (BuiltinID) {
-default: llvm_unreachable("unexpected builtin");
-case ARM::BI__builtin_arm_mcrr:
-  F = CGM.getIntrinsic(Intrinsic::arm_mcrr);
-  break;
-case ARM::BI__builtin_arm_mcrr2:
-  F = CGM.getIntrinsic(Intrinsic::arm_mcrr2);
-  break;
-}
-
-// MCRR{2} instruction has 5 operands but
-// the intrinsic has 4 because Rt and Rt2
-// are represented as a single unsigned 64
-// bit integer in the intrinsic definition
-// but internally it's represented as 2 32
-// bit integers.
-
-Value *Coproc = EmitScalarExpr(E->getArg(0));
-Value *Opc1 = EmitScalarExpr(E->getArg(1));
-Value *RtAndRt2 = EmitScalarExpr(E->getArg(2));
-Value *CRm = EmitScalarExpr(E->getArg(3));
-
-Value *C1 = llvm::ConstantInt::get(Int64Ty, 32);
-Value *Rt = Builder.CreateTruncOrBitCast(RtAndRt2, Int32Ty);
-Value *Rt2 = Builder.CreateLShr(RtAndRt2, C1);
-Rt2 = Builder.CreateTruncOrBitCast(Rt2, Int32Ty);
-
-return Builder.CreateCall(F, {Coproc, Opc1, Rt, Rt2, CRm});
-  }
-
-  if (BuiltinID == ARM::BI__builtin_arm_mrrc ||
-  BuiltinID == ARM::BI__builtin_arm_mrrc2) {
-Function *F;
-
-switch (BuiltinID) {
-default: llvm_unreachable("unexpected builtin");
-case ARM::BI__builtin_arm_mrrc:
-  F = CGM.getIntrinsic(Intrinsic::arm_mrrc);
-  break;
-case ARM::BI__builtin_arm_mrrc2:
-  F = CGM.getIntrinsic(Intrinsic::arm_mrrc2);
-  break;
-}
-
-Value *Coproc = EmitScalarExpr(E->getArg(0));
-Value *Opc1 = EmitScalarExpr(E->getArg(1));
-Value *CRm  = EmitScalarExpr(E->getArg(2));
-Value *RtAndRt2 = Builder.CreateCall(F, {Coproc, Opc1, CRm});
-
-// Returns an unsigned 64 bit integer, represented
-// as two 32 bit integers.
-
-Value *Rt = Builder.CreateExtractValue(RtAndRt2, 1);
-Value *Rt1 = Builder.CreateExtractValue(RtAndRt2, 0);
-Rt = Builder.CreateZExt(Rt, Int64Ty);
-Rt1 = Builder.CreateZExt(Rt1, Int64Ty);
-
-Value *ShiftCast = llvm::ConstantInt::get(Int64Ty, 32);
-RtAndRt2 = Builder.CreateShl(Rt, ShiftCast, "shl", true);
-RtAndRt2 = Builder.CreateOr(RtAndRt2, Rt1);
-
-return Builder.CreateBitCast(RtAndRt2, ConvertType(E->getType()));
-  }
-
   if (BuiltinID == ARM::BI__builtin_arm_ldrexd ||
   ((BuiltinID == ARM::BI__builtin_arm_ldrex ||
 BuiltinID == ARM::BI__builtin_arm_ldaex) &&

Modified: cfe/trunk/test/CodeGen/builtins-arm.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins-arm.c?rev=272790&r1=272789&r2=272790&view=diff
=

r272789 - Apply some suggestions from clang-tidy's performance-unnecessary-value-param.

2016-06-15 Thread Benjamin Kramer via cfe-commits
Author: d0k
Date: Wed Jun 15 09:20:56 2016
New Revision: 272789

URL: http://llvm.org/viewvc/llvm-project?rev=272789&view=rev
Log:
Apply some suggestions from clang-tidy's performance-unnecessary-value-param.

No functionality change intended.

Modified:
cfe/trunk/lib/AST/ASTDiagnostic.cpp
cfe/trunk/lib/ASTMatchers/ASTMatchFinder.cpp
cfe/trunk/lib/Sema/SemaChecking.cpp
cfe/trunk/lib/Sema/SemaExprCXX.cpp
cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
cfe/trunk/lib/Tooling/CommonOptionsParser.cpp
cfe/trunk/lib/Tooling/Tooling.cpp

Modified: cfe/trunk/lib/AST/ASTDiagnostic.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDiagnostic.cpp?rev=272789&r1=272788&r2=272789&view=diff
==
--- cfe/trunk/lib/AST/ASTDiagnostic.cpp (original)
+++ cfe/trunk/lib/AST/ASTDiagnostic.cpp Wed Jun 15 09:20:56 2016
@@ -616,7 +616,7 @@ class TemplateDiff {
   SetDefault(FromDefault, ToDefault);
 }
 
-void SetIntegerDiff(llvm::APSInt FromInt, llvm::APSInt ToInt,
+void SetIntegerDiff(const llvm::APSInt &FromInt, const llvm::APSInt &ToInt,
 bool IsValidFromInt, bool IsValidToInt,
 QualType FromIntType, QualType ToIntType,
 Expr *FromExpr, Expr *ToExpr, bool FromDefault,
@@ -653,7 +653,7 @@ class TemplateDiff {
 
 void SetFromDeclarationAndToIntegerDiff(
 ValueDecl *FromValueDecl, bool FromAddressOf, bool FromNullPtr,
-Expr *FromExpr, llvm::APSInt ToInt, bool IsValidToInt,
+Expr *FromExpr, const llvm::APSInt &ToInt, bool IsValidToInt,
 QualType ToIntType, Expr *ToExpr, bool FromDefault, bool ToDefault) {
   assert(FlatTree[CurrentNode].Kind == Invalid && "Node is not empty.");
   FlatTree[CurrentNode].Kind = FromDeclarationAndToInteger;
@@ -669,7 +669,7 @@ class TemplateDiff {
 }
 
 void SetFromIntegerAndToDeclarationDiff(
-llvm::APSInt FromInt, bool IsValidFromInt, QualType FromIntType,
+const llvm::APSInt &FromInt, bool IsValidFromInt, QualType FromIntType,
 Expr *FromExpr, ValueDecl *ToValueDecl, bool ToAddressOf,
 bool ToNullPtr, Expr *ToExpr, bool FromDefault, bool ToDefault) {
   assert(FlatTree[CurrentNode].Kind == Invalid && "Node is not empty.");
@@ -1705,7 +1705,7 @@ class TemplateDiff {
 
   /// PrintAPSInt - Handles printing of integral arguments, highlighting
   /// argument differences.
-  void PrintAPSInt(llvm::APSInt FromInt, llvm::APSInt ToInt,
+  void PrintAPSInt(const llvm::APSInt &FromInt, const llvm::APSInt &ToInt,
bool IsValidFromInt, bool IsValidToInt, QualType 
FromIntType,
QualType ToIntType, Expr *FromExpr, Expr *ToExpr,
bool FromDefault, bool ToDefault, bool Same) {
@@ -1738,8 +1738,8 @@ class TemplateDiff {
 
   /// PrintAPSInt - If valid, print the APSInt.  If the expression is
   /// gives more information, print it too.
-  void PrintAPSInt(llvm::APSInt Val, Expr *E, bool Valid, QualType IntType,
-   bool PrintType) {
+  void PrintAPSInt(const llvm::APSInt &Val, Expr *E, bool Valid,
+   QualType IntType, bool PrintType) {
 Bold();
 if (Valid) {
   if (HasExtraInfo(E)) {
@@ -1850,7 +1850,7 @@ class TemplateDiff {
   /// APSInt to print a mixed difference.
   void PrintValueDeclAndInteger(ValueDecl *VD, bool NeedAddressOf,
 bool IsNullPtr, Expr *VDExpr, bool DefaultDecl,
-llvm::APSInt Val, QualType IntType,
+const llvm::APSInt &Val, QualType IntType,
 Expr *IntExpr, bool DefaultInt) {
 if (!PrintTree) {
   OS << (DefaultDecl ? "(default) " : "");
@@ -1870,7 +1870,7 @@ class TemplateDiff {
 
   /// PrintIntegerAndValueDecl - Uses the print functions for APSInt and
   /// ValueDecl to print a mixed difference.
-  void PrintIntegerAndValueDecl(llvm::APSInt Val, QualType IntType,
+  void PrintIntegerAndValueDecl(const llvm::APSInt &Val, QualType IntType,
 Expr *IntExpr, bool DefaultInt, ValueDecl *VD,
 bool NeedAddressOf, bool IsNullPtr,
 Expr *VDExpr, bool DefaultDecl) {

Modified: cfe/trunk/lib/ASTMatchers/ASTMatchFinder.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ASTMatchers/ASTMatchFinder.cpp?rev=272789&r1=272788&r2=272789&view=diff
==
--- cfe/trunk/lib/ASTMatchers/ASTMatchFinder.cpp (original)
+++ cfe/trunk/lib/ASTMatchers/ASTMatchFinder.cpp Wed Jun 15 09:20:56 2016
@@ -712,7 +712,7 @@ private:
 
   // Returns true if 'TypeNode' has an alias that matches the given matcher.
   bool typeHasMatchingAlias(const Type *TypeNode,
-const Matcher Matcher,
+   

Re: [PATCH] D20732: Don't use static variables in LambdaCapture

2016-06-15 Thread John Brawn via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272788: Don't use static variables in LambdaCapture 
(authored by john.brawn).

Changed prior to commit:
  http://reviews.llvm.org/D20732?vs=58787&id=60831#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20732

Files:
  cfe/trunk/include/clang/AST/DeclBase.h
  cfe/trunk/include/clang/AST/LambdaCapture.h
  cfe/trunk/lib/AST/DeclBase.cpp
  cfe/trunk/lib/AST/ExprCXX.cpp

Index: cfe/trunk/include/clang/AST/LambdaCapture.h
===
--- cfe/trunk/include/clang/AST/LambdaCapture.h
+++ cfe/trunk/include/clang/AST/LambdaCapture.h
@@ -33,19 +33,21 @@
 /// given capture was by-copy.
 ///
 /// This includes the case of a non-reference init-capture.
-Capture_ByCopy = 0x02
+Capture_ByCopy = 0x02,
+
+/// \brief Flag used by the Capture class to distinguish between a capture
+/// of '*this' and a capture of a VLA type.
+Capture_This = 0x04
   };
-  struct LLVM_ALIGNAS(4) OpaqueCapturedEntity {};
-  static OpaqueCapturedEntity ThisSentinel;
-  static OpaqueCapturedEntity VLASentinel;
-  
-  // Captured Entity could represent:
+
+  // Decl could represent:
   // - a VarDecl* that represents the variable that was captured or the 
   //   init-capture.
-  // - or, points to the ThisSentinel if this represents a capture of '*this'
-  //   by value or reference.
-  // - or, points to the VLASentinel if this represents a capture of a VLA type.
-  llvm::PointerIntPair CapturedEntityAndBits;
+  // - or, is a nullptr and Capture_This is set in Bits if this represents a
+  //   capture of '*this' by value or reference.
+  // - or, is a nullptr and Capture_This is not set in Bits if this represents
+  //   a capture of a VLA type.
+  llvm::PointerIntPair DeclAndBits;
 
   SourceLocation Loc;
   SourceLocation EllipsisLoc;
@@ -79,21 +81,20 @@
   /// \brief Determine whether this capture handles the C++ \c this
   /// pointer.
   bool capturesThis() const {
-return CapturedEntityAndBits.getPointer() == &ThisSentinel;
+return DeclAndBits.getPointer() == nullptr &&
+  (DeclAndBits.getInt() & Capture_This);
   }
 
   /// \brief Determine whether this capture handles a variable.
   bool capturesVariable() const {
-void *Ptr = CapturedEntityAndBits.getPointer();
-if (Ptr != &ThisSentinel && Ptr != &VLASentinel)
-  return dyn_cast_or_null(static_cast(Ptr));
-return false;
+return dyn_cast_or_null(DeclAndBits.getPointer());
   }
 
   /// \brief Determine whether this captures a variable length array bound
   /// expression.
   bool capturesVLAType() const {
-return CapturedEntityAndBits.getPointer() == &VLASentinel;
+return DeclAndBits.getPointer() == nullptr &&
+   !(DeclAndBits.getInt() & Capture_This);
   }
 
   /// \brief Retrieve the declaration of the local variable being
@@ -103,13 +104,13 @@
   /// (other than a capture of \c this).
   VarDecl *getCapturedVar() const {
 assert(capturesVariable() && "No variable available for capture");
-return static_cast(CapturedEntityAndBits.getPointer());
+return static_cast(DeclAndBits.getPointer());
   }
 
   /// \brief Determine whether this was an implicit capture (not
   /// written between the square brackets introducing the lambda).
   bool isImplicit() const {
-return CapturedEntityAndBits.getInt() & Capture_Implicit;
+return DeclAndBits.getInt() & Capture_Implicit;
   }
 
   /// \brief Determine whether this was an explicit capture (written
Index: cfe/trunk/include/clang/AST/DeclBase.h
===
--- cfe/trunk/include/clang/AST/DeclBase.h
+++ cfe/trunk/include/clang/AST/DeclBase.h
@@ -73,13 +73,10 @@
 ///
 /// Note: There are objects tacked on before the *beginning* of Decl
 /// (and its subclasses) in its Decl::operator new(). Proper alignment
-/// of all subclasses (not requiring more than DeclObjAlignment) is
+/// of all subclasses (not requiring more than the alignment of Decl) is
 /// asserted in DeclBase.cpp.
-class Decl {
+class LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) Decl {
 public:
-  /// \brief Alignment guaranteed when allocating Decl and any subtypes.
-  enum { DeclObjAlignment = llvm::AlignOf::Alignment };
-
   /// \brief Lists the kind of concrete classes of Decl.
   enum Kind {
 #define DECL(DERIVED, BASE) DERIVED,
Index: cfe/trunk/lib/AST/ExprCXX.cpp
===
--- cfe/trunk/lib/AST/ExprCXX.cpp
+++ cfe/trunk/lib/AST/ExprCXX.cpp
@@ -808,13 +808,10 @@
   }
 }
 
-LambdaCapture::OpaqueCapturedEntity LambdaCapture::ThisSentinel;
-LambdaCapture::OpaqueCapturedEntity LambdaCapture::VLASentinel;
-
 LambdaCapture::LambdaCapture(SourceLocation Loc, bool Implicit,
  LambdaCaptureKind Kind, VarDecl *Var,
  SourceLocation EllipsisLoc)
-  : CapturedEntityAndBits(Var,

r272788 - Don't use static variables in LambdaCapture

2016-06-15 Thread John Brawn via cfe-commits
Author: john.brawn
Date: Wed Jun 15 09:14:51 2016
New Revision: 272788

URL: http://llvm.org/viewvc/llvm-project?rev=272788&view=rev
Log:
Don't use static variables in LambdaCapture

When static variables are used in inline functions in header files anything that
uses that function ends up with a reference to the variable. Because
RecursiveASTVisitor uses the inline functions in LambdaCapture that use static
variables any AST plugin that uses RecursiveASTVisitor, such as the
PrintFunctionNames example, ends up with a reference to these variables. This is
bad on Windows when building with MSVC with LLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON
as variables used across a DLL boundary need to be explicitly dllimported in
the DLL using them.

This patch avoids that by adjusting LambdaCapture to be similar to before
r263921, with a capture of either 'this' or a VLA represented by a null Decl
pointer in DeclAndBits with an extra flag added to the bits to distinguish
between the two. This requires the use of an extra bit, and while Decl does
happen to be sufficiently aligned to allow this it's done in a way that means
PointerIntPair doesn't realise it and gives an assertion failure. Therefore I
also adjust Decl slightly to use LLVM_ALIGNAS to allow this.

Differential Revision: http://reviews.llvm.org/D20732

Modified:
cfe/trunk/include/clang/AST/DeclBase.h
cfe/trunk/include/clang/AST/LambdaCapture.h
cfe/trunk/lib/AST/DeclBase.cpp
cfe/trunk/lib/AST/ExprCXX.cpp

Modified: cfe/trunk/include/clang/AST/DeclBase.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclBase.h?rev=272788&r1=272787&r2=272788&view=diff
==
--- cfe/trunk/include/clang/AST/DeclBase.h (original)
+++ cfe/trunk/include/clang/AST/DeclBase.h Wed Jun 15 09:14:51 2016
@@ -73,13 +73,10 @@ namespace clang {
 ///
 /// Note: There are objects tacked on before the *beginning* of Decl
 /// (and its subclasses) in its Decl::operator new(). Proper alignment
-/// of all subclasses (not requiring more than DeclObjAlignment) is
+/// of all subclasses (not requiring more than the alignment of Decl) is
 /// asserted in DeclBase.cpp.
-class Decl {
+class LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) Decl {
 public:
-  /// \brief Alignment guaranteed when allocating Decl and any subtypes.
-  enum { DeclObjAlignment = llvm::AlignOf::Alignment };
-
   /// \brief Lists the kind of concrete classes of Decl.
   enum Kind {
 #define DECL(DERIVED, BASE) DERIVED,

Modified: cfe/trunk/include/clang/AST/LambdaCapture.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/LambdaCapture.h?rev=272788&r1=272787&r2=272788&view=diff
==
--- cfe/trunk/include/clang/AST/LambdaCapture.h (original)
+++ cfe/trunk/include/clang/AST/LambdaCapture.h Wed Jun 15 09:14:51 2016
@@ -33,19 +33,21 @@ class LambdaCapture {
 /// given capture was by-copy.
 ///
 /// This includes the case of a non-reference init-capture.
-Capture_ByCopy = 0x02
+Capture_ByCopy = 0x02,
+
+/// \brief Flag used by the Capture class to distinguish between a capture
+/// of '*this' and a capture of a VLA type.
+Capture_This = 0x04
   };
-  struct LLVM_ALIGNAS(4) OpaqueCapturedEntity {};
-  static OpaqueCapturedEntity ThisSentinel;
-  static OpaqueCapturedEntity VLASentinel;
-  
-  // Captured Entity could represent:
+
+  // Decl could represent:
   // - a VarDecl* that represents the variable that was captured or the 
   //   init-capture.
-  // - or, points to the ThisSentinel if this represents a capture of '*this'
-  //   by value or reference.
-  // - or, points to the VLASentinel if this represents a capture of a VLA 
type.
-  llvm::PointerIntPair CapturedEntityAndBits;
+  // - or, is a nullptr and Capture_This is set in Bits if this represents a
+  //   capture of '*this' by value or reference.
+  // - or, is a nullptr and Capture_This is not set in Bits if this represents
+  //   a capture of a VLA type.
+  llvm::PointerIntPair DeclAndBits;
 
   SourceLocation Loc;
   SourceLocation EllipsisLoc;
@@ -79,21 +81,20 @@ public:
   /// \brief Determine whether this capture handles the C++ \c this
   /// pointer.
   bool capturesThis() const {
-return CapturedEntityAndBits.getPointer() == &ThisSentinel;
+return DeclAndBits.getPointer() == nullptr &&
+  (DeclAndBits.getInt() & Capture_This);
   }
 
   /// \brief Determine whether this capture handles a variable.
   bool capturesVariable() const {
-void *Ptr = CapturedEntityAndBits.getPointer();
-if (Ptr != &ThisSentinel && Ptr != &VLASentinel)
-  return dyn_cast_or_null(static_cast(Ptr));
-return false;
+return dyn_cast_or_null(DeclAndBits.getPointer());
   }
 
   /// \brief Determine whether this captures a variable length array bound
   /// expression.
   bool capturesVLAType() const {
-return CapturedEntityAndBits.g

r272787 - [AVX512] Use native IR for mask pcmpeq/pcmpgt intrinsics.

2016-06-15 Thread Craig Topper via cfe-commits
Author: ctopper
Date: Wed Jun 15 09:06:34 2016
New Revision: 272787

URL: http://llvm.org/viewvc/llvm-project?rev=272787&view=rev
Log:
[AVX512] Use native IR for mask pcmpeq/pcmpgt intrinsics.

Modified:
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/test/CodeGen/avx512bw-builtins.c
cfe/trunk/test/CodeGen/avx512f-builtins.c
cfe/trunk/test/CodeGen/avx512vl-builtins.c
cfe/trunk/test/CodeGen/avx512vlbw-builtins.c

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=272787&r1=272786&r2=272787&view=diff
==
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Wed Jun 15 09:06:34 2016
@@ -6414,6 +6414,29 @@ static Value *EmitX86Select(CodeGenFunct
   return CGF.Builder.CreateSelect(Mask, Op0, Op1);
 }
 
+static Value *EmitX86MaskedCompare(CodeGenFunction &CGF, CmpInst::Predicate P,
+   SmallVectorImpl &Ops) {
+  unsigned NumElts = Ops[0]->getType()->getVectorNumElements();
+  Value *Cmp = CGF.Builder.CreateICmp(P, Ops[0], Ops[1]);
+
+  const auto *C = dyn_cast(Ops[2]);
+  if (!C || !C->isAllOnesValue())
+Cmp = CGF.Builder.CreateAnd(Cmp, getMaskVecValue(CGF, Ops[2], NumElts));
+
+  if (NumElts < 8) {
+uint32_t Indices[8];
+for (unsigned i = 0; i != NumElts; ++i)
+  Indices[i] = i;
+for (unsigned i = NumElts; i != 8; ++i)
+  Indices[i] = NumElts;
+Cmp = CGF.Builder.CreateShuffleVector(Cmp, UndefValue::get(Cmp->getType()),
+  Indices);
+  }
+  return CGF.Builder.CreateBitCast(Cmp,
+   IntegerType::get(CGF.getLLVMContext(),
+std::max(NumElts, 8U)));
+}
+
 Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
const CallExpr *E) {
   if (BuiltinID == X86::BI__builtin_ms_va_start ||
@@ -6807,6 +6830,32 @@ Value *CodeGenFunction::EmitX86BuiltinEx
   case X86::BI__builtin_ia32_selectpd_256:
   case X86::BI__builtin_ia32_selectpd_512:
 return EmitX86Select(*this, Ops[0], Ops[1], Ops[2]);
+  case X86::BI__builtin_ia32_pcmpeqb128_mask:
+  case X86::BI__builtin_ia32_pcmpeqb256_mask:
+  case X86::BI__builtin_ia32_pcmpeqb512_mask:
+  case X86::BI__builtin_ia32_pcmpeqw128_mask:
+  case X86::BI__builtin_ia32_pcmpeqw256_mask:
+  case X86::BI__builtin_ia32_pcmpeqw512_mask:
+  case X86::BI__builtin_ia32_pcmpeqd128_mask:
+  case X86::BI__builtin_ia32_pcmpeqd256_mask:
+  case X86::BI__builtin_ia32_pcmpeqd512_mask:
+  case X86::BI__builtin_ia32_pcmpeqq128_mask:
+  case X86::BI__builtin_ia32_pcmpeqq256_mask:
+  case X86::BI__builtin_ia32_pcmpeqq512_mask:
+return EmitX86MaskedCompare(*this, ICmpInst::ICMP_EQ, Ops);
+  case X86::BI__builtin_ia32_pcmpgtb128_mask:
+  case X86::BI__builtin_ia32_pcmpgtb256_mask:
+  case X86::BI__builtin_ia32_pcmpgtb512_mask:
+  case X86::BI__builtin_ia32_pcmpgtw128_mask:
+  case X86::BI__builtin_ia32_pcmpgtw256_mask:
+  case X86::BI__builtin_ia32_pcmpgtw512_mask:
+  case X86::BI__builtin_ia32_pcmpgtd128_mask:
+  case X86::BI__builtin_ia32_pcmpgtd256_mask:
+  case X86::BI__builtin_ia32_pcmpgtd512_mask:
+  case X86::BI__builtin_ia32_pcmpgtq128_mask:
+  case X86::BI__builtin_ia32_pcmpgtq256_mask:
+  case X86::BI__builtin_ia32_pcmpgtq512_mask:
+return EmitX86MaskedCompare(*this, ICmpInst::ICMP_SGT, Ops);
   // 3DNow!
   case X86::BI__builtin_ia32_pswapdsf:
   case X86::BI__builtin_ia32_pswapdsi: {

Modified: cfe/trunk/test/CodeGen/avx512bw-builtins.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512bw-builtins.c?rev=272787&r1=272786&r2=272787&view=diff
==
--- cfe/trunk/test/CodeGen/avx512bw-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512bw-builtins.c Wed Jun 15 09:06:34 2016
@@ -8,49 +8,53 @@
 
 __mmask64 test_mm512_cmpeq_epi8_mask(__m512i __a, __m512i __b) {
   // CHECK-LABEL: @test_mm512_cmpeq_epi8_mask
-  // CHECK: @llvm.x86.avx512.mask.pcmpeq.b.512
+  // CHECK: icmp eq <64 x i8> %{{.*}}, %{{.*}}
   return (__mmask64)_mm512_cmpeq_epi8_mask(__a, __b);
 }
 
 __mmask64 test_mm512_mask_cmpeq_epi8_mask(__mmask64 __u, __m512i __a, __m512i 
__b) {
   // CHECK-LABEL: @test_mm512_mask_cmpeq_epi8_mask
-  // CHECK: @llvm.x86.avx512.mask.pcmpeq.b.512
+  // CHECK: icmp eq <64 x i8> %{{.*}}, %{{.*}}
+  // CHECK: and <64 x i1> %{{.*}}, %{{.*}}
   return (__mmask64)_mm512_mask_cmpeq_epi8_mask(__u, __a, __b);
 }
 
 __mmask32 test_mm512_cmpeq_epi16_mask(__m512i __a, __m512i __b) {
   // CHECK-LABEL: @test_mm512_cmpeq_epi16_mask
-  // CHECK: @llvm.x86.avx512.mask.pcmpeq.w.512
+  // CHECK: icmp eq <32 x i16> %{{.*}}, %{{.*}}
   return (__mmask32)_mm512_cmpeq_epi16_mask(__a, __b);
 }
 
 __mmask32 test_mm512_mask_cmpeq_epi16_mask(__mmask32 __u, __m512i __a, __m512i 
__b) {
   //

Re: [PATCH] D21373: [Clang][bmi][intrinsics] Adding _mm_tzcnt_64 _mm_tzcnt_32 intrinsics to clang.

2016-06-15 Thread Simon Pilgrim via cfe-commits
RKSimon added a subscriber: RKSimon.
RKSimon added a reviewer: RKSimon.


Comment at: lib/Headers/bmiintrin.h:296
@@ -290,1 +295,3 @@
+}
+
 #ifdef __x86_64__

Why not just #define to __tzcnt_u32 like the (many) other duplicate tzcnt 
intrinsics we have:

```
#define _mm_tzcnt_32(a) (__tzcnt_u32((a)))
```

Same for _mm_tzcnt_64

Also, please can you copy/paste/edit the doxygen comment so that its properly 
documented?


http://reviews.llvm.org/D21373



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


Re: [PATCH] D19274: Compilation for Intel MCU (Part 2/3)

2016-06-15 Thread Andrey Turetskiy via cfe-commits
aturetsk added inline comments.


Comment at: lib/Driver/Tools.cpp:3657
@@ +3656,3 @@
+  if (IsIAMCU && types::isCXX(Input.getType()))
+D.Diag(diag::err_drv_cxx_not_supported) << 
getToolChain().getTriple().str();
+

aturetsk wrote:
> bruno wrote:
> > aturetsk wrote:
> > > bruno wrote:
> > > > Taking a look at this again I don't think there's a real need for a new 
> > > > diagnostic here; instead of adding diag::err_drv_cxx_not_supported, you 
> > > > can do something similar to:
> > > > 
> > > > D.Diag(diag::err_drv_clang_unsupported) << "C++ is not supported with 
> > > > -miamcu"
> > > > 
> > > > Otherwise, LGTM!
> > > The best thing I could come up with is this:
> > > ```
> > > D.Diag(diag::err_drv_clang_unsupported) << "C++ for IAMCU";
> > > ```
> > > This code makes the error message look like this:
> > > ```
> > > error: the clang compiler does not support 'C++ for IAMCU'
> > > ```
> > > As you can see the message is a bit crooked. Do you thinks it's better to 
> > > keep it this way?
> > Sorry, but I didn't mean you should change the message. My only point here 
> > is that I don't see the need for adding a new diagnostic, you can still 
> > keep something more similar with your old intent, example:
> > 
> >   D.Diag(diag::err_drv_clang_unsupported) << "C++ for target" << 
> > getToolChain().getTriple().str();
> My concern is not the change in the message :) My concern is redundant 
> quotation marks which look a bit ugly and out of place.
> But if you're OK with them, so would I.
Bruno, are you ok if the message will be:
```
error: the clang compiler does not support 'C++ for IAMCU'
```
If so I'll proceed with committing the changes.


http://reviews.llvm.org/D19274



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


Re: [PATCH] D21279: Fix some issues in clang-format's AlignConsecutive modes

2016-06-15 Thread Ben Harper via cfe-commits
bmharper set the repository for this revision to rL LLVM.
bmharper updated this revision to Diff 60830.
bmharper added a comment.

Fix the recent two issues mentioned by Beren, ie the single-statement scopes 
(for loop without braces), and operator[] alignment.


Repository:
  rL LLVM

http://reviews.llvm.org/D21279

Files:
  lib/Format/WhitespaceManager.cpp
  lib/Format/WhitespaceManager.h
  unittests/Format/FormatTest.cpp

Index: unittests/Format/FormatTest.cpp
===
--- unittests/Format/FormatTest.cpp
+++ unittests/Format/FormatTest.cpp
@@ -9242,12 +9242,11 @@
"};",
Alignment);
 
-  // FIXME: Should align all three assignments
   verifyFormat(
   "int i  = 1;\n"
   "SomeType a = SomeFunction(looongParameterA,\n"
   "  loongParameterB);\n"
-  "int j = 2;",
+  "int j  = 2;",
   Alignment);
 
   verifyFormat("template  Changes;
   const SourceManager &SourceMgr;
   tooling::Replacements Replaces;
Index: lib/Format/WhitespaceManager.cpp
===
--- lib/Format/WhitespaceManager.cpp
+++ lib/Format/WhitespaceManager.cpp
@@ -29,18 +29,18 @@
 bool CreateReplacement, SourceRange OriginalWhitespaceRange,
 unsigned IndentLevel, int Spaces, unsigned StartOfTokenColumn,
 unsigned NewlinesBefore, StringRef PreviousLinePostfix,
-StringRef CurrentLinePrefix, tok::TokenKind Kind, bool ContinuesPPDirective,
-bool IsStartOfDeclName, bool IsInsideToken)
+StringRef CurrentLinePrefix, tok::TokenKind Kind, TokenType Type,
+bool ContinuesPPDirective, bool IsStartOfDeclName, bool IsInsideToken)
 : CreateReplacement(CreateReplacement),
   OriginalWhitespaceRange(OriginalWhitespaceRange),
   StartOfTokenColumn(StartOfTokenColumn), NewlinesBefore(NewlinesBefore),
   PreviousLinePostfix(PreviousLinePostfix),
-  CurrentLinePrefix(CurrentLinePrefix), Kind(Kind),
+  CurrentLinePrefix(CurrentLinePrefix), Kind(Kind), Type(Type),
   ContinuesPPDirective(ContinuesPPDirective),
   IsStartOfDeclName(IsStartOfDeclName), IndentLevel(IndentLevel),
   Spaces(Spaces), IsInsideToken(IsInsideToken), IsTrailingComment(false),
   TokenLength(0), PreviousEndOfTokenColumn(0), EscapedNewlineColumn(0),
-  StartOfBlockComment(nullptr), IndentationOffset(0) {}
+  StartOfBlockComment(nullptr), IndentationOffset(0), ScopeLevel(0) {}
 
 void WhitespaceManager::reset() {
   Changes.clear();
@@ -57,9 +57,8 @@
   Changes.push_back(
   Change(/*CreateReplacement=*/true, Tok.WhitespaceRange, IndentLevel,
  Spaces, StartOfTokenColumn, Newlines, "", "", Tok.Tok.getKind(),
- InPPDirective && !Tok.IsFirst,
- Tok.is(TT_StartOfName) || Tok.is(TT_FunctionDeclarationName),
- /*IsInsideToken=*/false));
+ Tok.Type, InPPDirective && !Tok.IsFirst,
+ IsStartOfDeclName(Tok), /*IsInsideToken=*/false));
 }
 
 void WhitespaceManager::addUntouchableToken(const FormatToken &Tok,
@@ -69,9 +68,8 @@
   Changes.push_back(Change(
   /*CreateReplacement=*/false, Tok.WhitespaceRange, /*IndentLevel=*/0,
   /*Spaces=*/0, Tok.OriginalColumn, Tok.NewlinesBefore, "", "",
-  Tok.Tok.getKind(), InPPDirective && !Tok.IsFirst,
-  Tok.is(TT_StartOfName) || Tok.is(TT_FunctionDeclarationName),
-  /*IsInsideToken=*/false));
+  Tok.Tok.getKind(), Tok.Type, InPPDirective && !Tok.IsFirst,
+  IsStartOfDeclName(Tok), /*IsInsideToken=*/false));
 }
 
 void WhitespaceManager::replaceWhitespaceInToken(
@@ -85,16 +83,16 @@
   true, SourceRange(Start, Start.getLocWithOffset(ReplaceChars)),
   IndentLevel, Spaces, std::max(0, Spaces), Newlines, PreviousPostfix,
   CurrentPrefix, Tok.is(TT_LineComment) ? tok::comment : tok::unknown,
-  InPPDirective && !Tok.IsFirst,
-  Tok.is(TT_StartOfName) || Tok.is(TT_FunctionDeclarationName),
+  Tok.Type, InPPDirective && !Tok.IsFirst, IsStartOfDeclName(Tok),
   /*IsInsideToken=*/Newlines == 0));
 }
 
 const tooling::Replacements &WhitespaceManager::generateReplacements() {
   if (Changes.empty())
 return Replaces;
 
   std::sort(Changes.begin(), Changes.end(), Change::IsBeforeInFile(SourceMgr));
+  calculateScopeLevel();
   calculateLineBreakInformation();
   alignConsecutiveDeclarations();
   alignConsecutiveAssignments();
@@ -160,59 +158,170 @@
   }
 }
 
+static tok::TokenKind OppositeNestingToken(tok::TokenKind t) {
+  switch (t) {
+  case tok::l_paren:
+return tok::r_paren;
+  case tok::l_brace:
+return tok::r_brace;
+  case tok::l_square:
+return tok::r_square;
+  default:
+assert(false && "Not a nesting token");
+return tok::unknown;
+  }
+}
+
+struct TokenTypeAndLevel {
+  TokenType Type;
+  int ScopeLevel;
+};
+
+// See comment in Change::ScopeLevel for an explanation of why we need
+// to run th

Re: [PATCH] D20732: Don't use static variables in LambdaCapture

2016-06-15 Thread James Y Knight via cfe-commits
jyknight accepted this revision.
jyknight added a comment.
This revision is now accepted and ready to land.

Fine with me.


Repository:
  rL LLVM

http://reviews.llvm.org/D20732



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


Re: r272782 - [Sparc] Change to let clang know that setjmp and longjmp intrinsics are implemented in the back-end.

2016-06-15 Thread Joerg Sonnenberger via cfe-commits
On Wed, Jun 15, 2016 at 12:44:48PM -, Chris Dewhurst via cfe-commits wrote:
> Modified: cfe/trunk/lib/Basic/Targets.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=272782&r1=272781&r2=272782&view=diff
> ==
> --- cfe/trunk/lib/Basic/Targets.cpp (original)
> +++ cfe/trunk/lib/Basic/Targets.cpp Wed Jun 15 07:44:47 2016
> @@ -6395,6 +6395,10 @@ public:
>   .Default(false);
>}
>  
> +  bool hasSjLjLowering() const override {
> +return true;
> +  }
> +
>ArrayRef getTargetBuiltins() const override {
>  // FIXME: Implement!
>  return None;

Please update Sema/builtin-longjmp.c.


> @@ -6562,6 +6566,7 @@ public:
>SparcV8TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
>: SparcTargetInfo(Triple, Opts) {
>  resetDataLayout("E-m:e-p:32:32-i64:64-f128:64-n32-S64");
> +MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
>  // NetBSD / OpenBSD use long (same as llvm default); everyone else uses 
> int.
>  switch (getTriple().getOS()) {
>  default:
> 
> 

Unrelated change?

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


r272782 - [Sparc] Change to let clang know that setjmp and longjmp intrinsics are implemented in the back-end.

2016-06-15 Thread Chris Dewhurst via cfe-commits
Author: lerochris
Date: Wed Jun 15 07:44:47 2016
New Revision: 272782

URL: http://llvm.org/viewvc/llvm-project?rev=272782&view=rev
Log:
[Sparc] Change to let clang know that setjmp and longjmp intrinsics are 
implemented in the back-end.

Differential Revision: http://reviews.llvm.org/D19798

Modified:
cfe/trunk/lib/Basic/Targets.cpp

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=272782&r1=272781&r2=272782&view=diff
==
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Jun 15 07:44:47 2016
@@ -6395,6 +6395,10 @@ public:
  .Default(false);
   }
 
+  bool hasSjLjLowering() const override {
+return true;
+  }
+
   ArrayRef getTargetBuiltins() const override {
 // FIXME: Implement!
 return None;
@@ -6562,6 +6566,7 @@ public:
   SparcV8TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
   : SparcTargetInfo(Triple, Opts) {
 resetDataLayout("E-m:e-p:32:32-i64:64-f128:64-n32-S64");
+MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
 // NetBSD / OpenBSD use long (same as llvm default); everyone else uses 
int.
 switch (getTriple().getOS()) {
 default:


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


[PATCH] D21375: Remove a redundant set of applyAllReplacements declarations.

2016-06-15 Thread Eric Liu via cfe-commits
ioeric created this revision.
ioeric added reviewers: djasper, klimek.
ioeric added a subscriber: cfe-commits.
Herald added a subscriber: klimek.

Not sure if this is intended, but there are two identical sets of
declarations of applyAllReplacements.

http://reviews.llvm.org/D21375

Files:
  include/clang/Tooling/Core/Replacement.h

Index: include/clang/Tooling/Core/Replacement.h
===
--- include/clang/Tooling/Core/Replacement.h
+++ include/clang/Tooling/Core/Replacement.h
@@ -198,29 +198,6 @@
   std::vector Replacements;
 };
 
-/// \brief Apply all replacements in \p Replaces to the Rewriter \p Rewrite.
-///
-/// Replacement applications happen independently of the success of
-/// other applications.
-///
-/// \returns true if all replacements apply. false otherwise.
-bool applyAllReplacements(const Replacements &Replaces, Rewriter &Rewrite);
-
-/// \brief Apply all replacements in \p Replaces to the Rewriter \p Rewrite.
-///
-/// Replacement applications happen independently of the success of
-/// other applications.
-///
-/// \returns true if all replacements apply. false otherwise.
-bool applyAllReplacements(const std::vector &Replaces,
-  Rewriter &Rewrite);
-
-/// \brief Applies all replacements in \p Replaces to \p Code.
-///
-/// This completely ignores the path stored in each replacement. If one or more
-/// replacements cannot be applied, this returns an empty \c string.
-std::string applyAllReplacements(StringRef Code, const Replacements &Replaces);
-
 /// \brief Calculates the ranges in a single file that are affected by the
 /// Replacements.
 ///


Index: include/clang/Tooling/Core/Replacement.h
===
--- include/clang/Tooling/Core/Replacement.h
+++ include/clang/Tooling/Core/Replacement.h
@@ -198,29 +198,6 @@
   std::vector Replacements;
 };
 
-/// \brief Apply all replacements in \p Replaces to the Rewriter \p Rewrite.
-///
-/// Replacement applications happen independently of the success of
-/// other applications.
-///
-/// \returns true if all replacements apply. false otherwise.
-bool applyAllReplacements(const Replacements &Replaces, Rewriter &Rewrite);
-
-/// \brief Apply all replacements in \p Replaces to the Rewriter \p Rewrite.
-///
-/// Replacement applications happen independently of the success of
-/// other applications.
-///
-/// \returns true if all replacements apply. false otherwise.
-bool applyAllReplacements(const std::vector &Replaces,
-  Rewriter &Rewrite);
-
-/// \brief Applies all replacements in \p Replaces to \p Code.
-///
-/// This completely ignores the path stored in each replacement. If one or more
-/// replacements cannot be applied, this returns an empty \c string.
-std::string applyAllReplacements(StringRef Code, const Replacements &Replaces);
-
 /// \brief Calculates the ranges in a single file that are affected by the
 /// Replacements.
 ///
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D21373: [Clang][bmi][intrinsics] Adding _mm_tzcnt_64 _mm_tzcnt_32 intrinsics to clang.

2016-06-15 Thread michael zuckerman via cfe-commits
m_zuckerman created this revision.
m_zuckerman added reviewers: AsafBadouh, igorb, delena.
m_zuckerman added a subscriber: cfe-commits.

http://reviews.llvm.org/D21373

Files:
  lib/Headers/bmiintrin.h
  test/CodeGen/bmi-builtins.c

Index: test/CodeGen/bmi-builtins.c
===
--- test/CodeGen/bmi-builtins.c
+++ test/CodeGen/bmi-builtins.c
@@ -64,6 +64,13 @@
   return __tzcnt_u32(__X);
 }
 
+int test_mm_tzcnt_32(unsigned int __X) {
+  // CHECK-LABEL: test_mm_tzcnt_32
+  // CHECK: icmp ne i32 %{{.*}}, 0
+  // CHECK: i32 @llvm.cttz.i32(i32 %{{.*}}, i1 true)
+  return _mm_tzcnt_32(__X);
+}
+
 unsigned long long test__andn_u64(unsigned long __X, unsigned long __Y) {
   // CHECK-LABEL: test__andn_u64
   // CHECK: xor i64 %{{.*}}, -1
@@ -105,6 +112,13 @@
   return __tzcnt_u64(__X);
 }
 
+long long test_mm_tzcnt_64(unsigned long long __X) {
+  // CHECK-LABEL: test_mm_tzcnt_64
+  // CHECK: icmp ne i64 %{{.*}}, 0
+  // CHECK: i64 @llvm.cttz.i64(i64 %{{.*}}, i1 true)
+  return _mm_tzcnt_64(__X);
+}
+
 // Intel intrinsics
 
 unsigned short test_tzcnt_u16(unsigned short __X) {
Index: lib/Headers/bmiintrin.h
===
--- lib/Headers/bmiintrin.h
+++ lib/Headers/bmiintrin.h
@@ -281,12 +281,19 @@
 ///An unsigned 32-bit integer whose trailing zeros are to be counted.
 /// \returns An unsigned 32-bit integer containing the number of trailing zero
 ///bits in the operand.
+
 static __inline__ unsigned int __RELAXED_FN_ATTRS
 __tzcnt_u32(unsigned int __X)
 {
   return __X ? __builtin_ctz(__X) : 32;
 }
 
+static __inline__ int __RELAXED_FN_ATTRS
+_mm_tzcnt_32(unsigned int __X)
+{
+  return __X ? __builtin_ctz(__X) : 32;
+}
+
 #ifdef __x86_64__
 
 /// \brief Performs a bitwise AND of the second operand with the one's
@@ -502,12 +509,19 @@
 ///An unsigned 64-bit integer whose trailing zeros are to be counted.
 /// \returns An unsigned 64-bit integer containing the number of trailing zero
 ///bits in the operand.
+
 static __inline__ unsigned long long __RELAXED_FN_ATTRS
 __tzcnt_u64(unsigned long long __X)
 {
   return __X ? __builtin_ctzll(__X) : 64;
 }
 
+static __inline__ long long __RELAXED_FN_ATTRS
+_mm_tzcnt_64(unsigned long long __X)
+{
+  return __X ? __builtin_ctzll(__X) : 64;
+}
+
 #endif /* __x86_64__ */
 
 #undef __DEFAULT_FN_ATTRS


Index: test/CodeGen/bmi-builtins.c
===
--- test/CodeGen/bmi-builtins.c
+++ test/CodeGen/bmi-builtins.c
@@ -64,6 +64,13 @@
   return __tzcnt_u32(__X);
 }
 
+int test_mm_tzcnt_32(unsigned int __X) {
+  // CHECK-LABEL: test_mm_tzcnt_32
+  // CHECK: icmp ne i32 %{{.*}}, 0
+  // CHECK: i32 @llvm.cttz.i32(i32 %{{.*}}, i1 true)
+  return _mm_tzcnt_32(__X);
+}
+
 unsigned long long test__andn_u64(unsigned long __X, unsigned long __Y) {
   // CHECK-LABEL: test__andn_u64
   // CHECK: xor i64 %{{.*}}, -1
@@ -105,6 +112,13 @@
   return __tzcnt_u64(__X);
 }
 
+long long test_mm_tzcnt_64(unsigned long long __X) {
+  // CHECK-LABEL: test_mm_tzcnt_64
+  // CHECK: icmp ne i64 %{{.*}}, 0
+  // CHECK: i64 @llvm.cttz.i64(i64 %{{.*}}, i1 true)
+  return _mm_tzcnt_64(__X);
+}
+
 // Intel intrinsics
 
 unsigned short test_tzcnt_u16(unsigned short __X) {
Index: lib/Headers/bmiintrin.h
===
--- lib/Headers/bmiintrin.h
+++ lib/Headers/bmiintrin.h
@@ -281,12 +281,19 @@
 ///An unsigned 32-bit integer whose trailing zeros are to be counted.
 /// \returns An unsigned 32-bit integer containing the number of trailing zero
 ///bits in the operand.
+
 static __inline__ unsigned int __RELAXED_FN_ATTRS
 __tzcnt_u32(unsigned int __X)
 {
   return __X ? __builtin_ctz(__X) : 32;
 }
 
+static __inline__ int __RELAXED_FN_ATTRS
+_mm_tzcnt_32(unsigned int __X)
+{
+  return __X ? __builtin_ctz(__X) : 32;
+}
+
 #ifdef __x86_64__
 
 /// \brief Performs a bitwise AND of the second operand with the one's
@@ -502,12 +509,19 @@
 ///An unsigned 64-bit integer whose trailing zeros are to be counted.
 /// \returns An unsigned 64-bit integer containing the number of trailing zero
 ///bits in the operand.
+
 static __inline__ unsigned long long __RELAXED_FN_ATTRS
 __tzcnt_u64(unsigned long long __X)
 {
   return __X ? __builtin_ctzll(__X) : 64;
 }
 
+static __inline__ long long __RELAXED_FN_ATTRS
+_mm_tzcnt_64(unsigned long long __X)
+{
+  return __X ? __builtin_ctzll(__X) : 64;
+}
+
 #endif /* __x86_64__ */
 
 #undef __DEFAULT_FN_ATTRS
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D21179: Add mrrc/mrrc2 intrinsics and update existing mcrr/mcrr2 intrinsics to accept a single uint64 type instead of 2 uint32 types

2016-06-15 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272777: [ARM] Add mrrc/mrrc2 intrinsics and update existing 
mcrr/mcrr2 intrinsics. (authored by rsingh).

Changed prior to commit:
  http://reviews.llvm.org/D21179?vs=60504&id=60815#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21179

Files:
  cfe/trunk/include/clang/Basic/BuiltinsARM.def
  cfe/trunk/lib/CodeGen/CGBuiltin.cpp
  cfe/trunk/test/CodeGen/builtins-arm.c
  cfe/trunk/test/Sema/builtins-arm.c

Index: cfe/trunk/include/clang/Basic/BuiltinsARM.def
===
--- cfe/trunk/include/clang/Basic/BuiltinsARM.def
+++ cfe/trunk/include/clang/Basic/BuiltinsARM.def
@@ -58,14 +58,16 @@
 BUILTIN(__builtin_arm_stc2, "vUIiUIiv*", "")
 BUILTIN(__builtin_arm_stc2l, "vUIiUIiv*", "")
 
+BUILTIN(__builtin_arm_cdp, "vUIiUIiUIiUIiUIiUIi", "")
+BUILTIN(__builtin_arm_cdp2, "vUIiUIiUIiUIiUIiUIi", "")
 BUILTIN(__builtin_arm_mcr, "vUIiUIiUiUIiUIiUIi", "")
 BUILTIN(__builtin_arm_mcr2, "vUIiUIiUiUIiUIiUIi", "")
 BUILTIN(__builtin_arm_mrc, "UiUIiUIiUIiUIiUIi", "")
 BUILTIN(__builtin_arm_mrc2, "UiUIiUIiUIiUIiUIi", "")
-BUILTIN(__builtin_arm_cdp, "vUIiUIiUIiUIiUIiUIi", "")
-BUILTIN(__builtin_arm_cdp2, "vUIiUIiUIiUIiUIiUIi", "")
-BUILTIN(__builtin_arm_mcrr, "vUIiUIiUiUiUIi", "")
-BUILTIN(__builtin_arm_mcrr2, "vUIiUIiUiUiUIi", "")
+BUILTIN(__builtin_arm_mcrr, "vUIiUIiLLUiUIi", "")
+BUILTIN(__builtin_arm_mcrr2, "vUIiUIiLLUiUIi", "")
+BUILTIN(__builtin_arm_mrrc, "LLUiUIiUIiUIi", "")
+BUILTIN(__builtin_arm_mrrc2, "LLUiUIiUIiUIi", "")
 
 // CRC32
 BUILTIN(__builtin_arm_crc32b, "UiUiUc", "nc")
Index: cfe/trunk/test/CodeGen/builtins-arm.c
===
--- cfe/trunk/test/CodeGen/builtins-arm.c
+++ cfe/trunk/test/CodeGen/builtins-arm.c
@@ -1,5 +1,7 @@
 // RUN: %clang_cc1 -Wall -Werror -triple thumbv7-eabi -target-cpu cortex-a8 -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
 
+#include 
+
 void *f0()
 {
   return __builtin_thread_pointer();
@@ -180,16 +182,28 @@
   __builtin_arm_mcr2(15, 0, a, 13, 0, 3);
 }
 
-void mcrr(unsigned a, unsigned b) {
-  // CHECK: define void @mcrr(i32 [[A:%.*]], i32 [[B:%.*]])
-  // CHECK: call void @llvm.arm.mcrr(i32 15, i32 0, i32 [[A]], i32 [[B]], i32 0)
-  __builtin_arm_mcrr(15, 0, a, b, 0);
+void mcrr(uint64_t a) {
+  // CHECK: define void @mcrr(i64 %{{.*}})
+  // CHECK: call void @llvm.arm.mcrr(i32 15, i32 0, i32 %{{[0-9]+}}, i32 %{{[0-9]+}}, i32 0)
+  __builtin_arm_mcrr(15, 0, a, 0);
+}
+
+void mcrr2(uint64_t a) {
+  // CHECK: define void @mcrr2(i64 %{{.*}})
+  // CHECK: call void @llvm.arm.mcrr2(i32 15, i32 0, i32 %{{[0-9]+}}, i32 %{{[0-9]+}}, i32 0)
+  __builtin_arm_mcrr2(15, 0, a, 0);
+}
+
+uint64_t mrrc() {
+  // CHECK: define i64 @mrrc()
+  // CHECK: call { i32, i32 } @llvm.arm.mrrc(i32 15, i32 0, i32 0)
+  return __builtin_arm_mrrc(15, 0, 0);
 }
 
-void mcrr2(unsigned a, unsigned b) {
-  // CHECK: define void @mcrr2(i32 [[A:%.*]], i32 [[B:%.*]])
-  // CHECK: call void @llvm.arm.mcrr2(i32 15, i32 0, i32 [[A]], i32 [[B]], i32 0)
-  __builtin_arm_mcrr2(15, 0, a, b, 0);
+uint64_t mrrc2() {
+  // CHECK: define i64 @mrrc2()
+  // CHECK: call { i32, i32 } @llvm.arm.mrrc2(i32 15, i32 0, i32 0)
+  return __builtin_arm_mrrc2(15, 0, 0);
 }
 
 unsigned rsr() {
Index: cfe/trunk/test/Sema/builtins-arm.c
===
--- cfe/trunk/test/Sema/builtins-arm.c
+++ cfe/trunk/test/Sema/builtins-arm.c
@@ -116,11 +116,23 @@
   __builtin_arm_mcr2(15, 0, b, 13, a, 3); // expected-error {{argument to '__builtin_arm_mcr2' must be a constant integer}}
   __builtin_arm_mcr2(15, 0, b, 13, 0, a); // expected-error {{argument to '__builtin_arm_mcr2' must be a constant integer}}
 
-  __builtin_arm_mcrr( a, 0, b, c, 0); // expected-error {{argument to '__builtin_arm_mcrr' must be a constant integer}}
-  __builtin_arm_mcrr(15, a, b, c, 0); // expected-error {{argument to '__builtin_arm_mcrr' must be a constant integer}}
-  __builtin_arm_mcrr(15, 0, b, c, a); // expected-error {{argument to '__builtin_arm_mcrr' must be a constant integer}}
-
-  __builtin_arm_mcrr2( a, 0, b, c, 0); // expected-error {{argument to '__builtin_arm_mcrr2' must be a constant integer}}
-  __builtin_arm_mcrr2(15, a, b, c, 0); // expected-error {{argument to '__builtin_arm_mcrr2' must be a constant integer}}
-  __builtin_arm_mcrr2(15, 0, b, c, a); // expected-error {{argument to '__builtin_arm_mcrr2' must be a constant integer}}
+  __builtin_arm_mcrr(15, 0, b, 0);
+  __builtin_arm_mcrr( a, 0, b, 0); // expected-error {{argument to '__builtin_arm_mcrr' must be a constant integer}}
+  __builtin_arm_mcrr(15, a, b, 0); // expected-error {{argument to '__builtin_arm_mcrr' must be a constant integer}}
+  __builtin_arm_mcrr(15, 0, b, a); // expected-error {{argument to '__builtin_arm_mcrr' must be a constant integer}}
+
+  __builtin_arm_mcrr2(15, 0, b, 0);
+  __builtin_arm_mcrr2( a, 0, b, 0); // exp

r272777 - [ARM] Add mrrc/mrrc2 intrinsics and update existing mcrr/mcrr2 intrinsics.

2016-06-15 Thread Ranjeet Singh via cfe-commits
Author: rsingh
Date: Wed Jun 15 06:32:18 2016
New Revision: 272777

URL: http://llvm.org/viewvc/llvm-project?rev=272777&view=rev
Log:
[ARM] Add mrrc/mrrc2 intrinsics and update existing mcrr/mcrr2 intrinsics.

Patch adds intrinsics for mrrc/mrrc2. The
intrinsics for mrrc/mrrc2 return a single
uint64_t to represent two 32 bit values.

The mcrr/mcrr2 intrinsic was changed to
accept a single uint64_t instead of two
32 bit values as the input for consistency.

Differential Revision: http://reviews.llvm.org/D21179


Modified:
cfe/trunk/include/clang/Basic/BuiltinsARM.def
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/test/CodeGen/builtins-arm.c
cfe/trunk/test/Sema/builtins-arm.c

Modified: cfe/trunk/include/clang/Basic/BuiltinsARM.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsARM.def?rev=272777&r1=272776&r2=272777&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsARM.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsARM.def Wed Jun 15 06:32:18 2016
@@ -58,14 +58,16 @@ BUILTIN(__builtin_arm_stcl, "vUIiUIiv*",
 BUILTIN(__builtin_arm_stc2, "vUIiUIiv*", "")
 BUILTIN(__builtin_arm_stc2l, "vUIiUIiv*", "")
 
+BUILTIN(__builtin_arm_cdp, "vUIiUIiUIiUIiUIiUIi", "")
+BUILTIN(__builtin_arm_cdp2, "vUIiUIiUIiUIiUIiUIi", "")
 BUILTIN(__builtin_arm_mcr, "vUIiUIiUiUIiUIiUIi", "")
 BUILTIN(__builtin_arm_mcr2, "vUIiUIiUiUIiUIiUIi", "")
 BUILTIN(__builtin_arm_mrc, "UiUIiUIiUIiUIiUIi", "")
 BUILTIN(__builtin_arm_mrc2, "UiUIiUIiUIiUIiUIi", "")
-BUILTIN(__builtin_arm_cdp, "vUIiUIiUIiUIiUIiUIi", "")
-BUILTIN(__builtin_arm_cdp2, "vUIiUIiUIiUIiUIiUIi", "")
-BUILTIN(__builtin_arm_mcrr, "vUIiUIiUiUiUIi", "")
-BUILTIN(__builtin_arm_mcrr2, "vUIiUIiUiUiUIi", "")
+BUILTIN(__builtin_arm_mcrr, "vUIiUIiLLUiUIi", "")
+BUILTIN(__builtin_arm_mcrr2, "vUIiUIiLLUiUIi", "")
+BUILTIN(__builtin_arm_mrrc, "LLUiUIiUIiUIi", "")
+BUILTIN(__builtin_arm_mrrc2, "LLUiUIiUIiUIi", "")
 
 // CRC32
 BUILTIN(__builtin_arm_crc32b, "UiUiUc", "nc")

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=272777&r1=272776&r2=272777&view=diff
==
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Wed Jun 15 06:32:18 2016
@@ -3793,6 +3793,74 @@ Value *CodeGenFunction::EmitARMBuiltinEx
 return EmitNounwindRuntimeCall(CGM.CreateRuntimeFunction(FTy, Name), Ops);
   }
 
+  if (BuiltinID == ARM::BI__builtin_arm_mcrr ||
+  BuiltinID == ARM::BI__builtin_arm_mcrr2) {
+Function *F;
+
+switch (BuiltinID) {
+default: llvm_unreachable("unexpected builtin");
+case ARM::BI__builtin_arm_mcrr:
+  F = CGM.getIntrinsic(Intrinsic::arm_mcrr);
+  break;
+case ARM::BI__builtin_arm_mcrr2:
+  F = CGM.getIntrinsic(Intrinsic::arm_mcrr2);
+  break;
+}
+
+// MCRR{2} instruction has 5 operands but
+// the intrinsic has 4 because Rt and Rt2
+// are represented as a single unsigned 64
+// bit integer in the intrinsic definition
+// but internally it's represented as 2 32
+// bit integers.
+
+Value *Coproc = EmitScalarExpr(E->getArg(0));
+Value *Opc1 = EmitScalarExpr(E->getArg(1));
+Value *RtAndRt2 = EmitScalarExpr(E->getArg(2));
+Value *CRm = EmitScalarExpr(E->getArg(3));
+
+Value *C1 = llvm::ConstantInt::get(Int64Ty, 32);
+Value *Rt = Builder.CreateTruncOrBitCast(RtAndRt2, Int32Ty);
+Value *Rt2 = Builder.CreateLShr(RtAndRt2, C1);
+Rt2 = Builder.CreateTruncOrBitCast(Rt2, Int32Ty);
+
+return Builder.CreateCall(F, {Coproc, Opc1, Rt, Rt2, CRm});
+  }
+
+  if (BuiltinID == ARM::BI__builtin_arm_mrrc ||
+  BuiltinID == ARM::BI__builtin_arm_mrrc2) {
+Function *F;
+
+switch (BuiltinID) {
+default: llvm_unreachable("unexpected builtin");
+case ARM::BI__builtin_arm_mrrc:
+  F = CGM.getIntrinsic(Intrinsic::arm_mrrc);
+  break;
+case ARM::BI__builtin_arm_mrrc2:
+  F = CGM.getIntrinsic(Intrinsic::arm_mrrc2);
+  break;
+}
+
+Value *Coproc = EmitScalarExpr(E->getArg(0));
+Value *Opc1 = EmitScalarExpr(E->getArg(1));
+Value *CRm  = EmitScalarExpr(E->getArg(2));
+Value *RtAndRt2 = Builder.CreateCall(F, {Coproc, Opc1, CRm});
+
+// Returns an unsigned 64 bit integer, represented
+// as two 32 bit integers.
+
+Value *Rt = Builder.CreateExtractValue(RtAndRt2, 1);
+Value *Rt1 = Builder.CreateExtractValue(RtAndRt2, 0);
+Rt = Builder.CreateZExt(Rt, Int64Ty);
+Rt1 = Builder.CreateZExt(Rt1, Int64Ty);
+
+Value *ShiftCast = llvm::ConstantInt::get(Int64Ty, 32);
+RtAndRt2 = Builder.CreateShl(Rt, ShiftCast, "shl", true);
+RtAndRt2 = Builder.CreateOr(RtAndRt2, Rt1);
+
+return Builder.CreateBitCast(RtAndRt2, ConvertType(E->getType()));
+  }
+
   if (BuiltinID == ARM::BI__builtin_arm_ldrexd ||
   ((BuiltinID

r272776 - Revert accidential "[MSVC] Late parsing of in-class defined member functions in template"

2016-06-15 Thread Alexey Bataev via cfe-commits
Author: abataev
Date: Wed Jun 15 06:24:54 2016
New Revision: 272776

URL: http://llvm.org/viewvc/llvm-project?rev=272776&view=rev
Log:
Revert accidential "[MSVC] Late parsing of in-class defined member functions in 
template"

This reverts commit 0253605771b8bd9d414aba74fe2742c730d6fd1a.

Modified:
cfe/trunk/include/clang-c/Index.h
cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
cfe/trunk/include/clang/AST/StmtCXX.h
cfe/trunk/include/clang/Basic/StmtNodes.td
cfe/trunk/include/clang/Parse/Parser.h
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/include/clang/Serialization/ASTBitCodes.h
cfe/trunk/lib/AST/StmtCXX.cpp
cfe/trunk/lib/AST/StmtPrinter.cpp
cfe/trunk/lib/AST/StmtProfile.cpp
cfe/trunk/lib/CodeGen/CGStmt.cpp
cfe/trunk/lib/Parse/ParseTemplate.cpp
cfe/trunk/lib/Parse/Parser.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/lib/Sema/SemaStmt.cpp
cfe/trunk/lib/Sema/TreeTransform.h
cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
cfe/trunk/lib/Serialization/ASTWriterStmt.cpp
cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp
cfe/trunk/test/SemaTemplate/ms-lookup-template-base-classes.cpp
cfe/trunk/tools/libclang/CIndex.cpp
cfe/trunk/tools/libclang/CXCursor.cpp

Modified: cfe/trunk/include/clang-c/Index.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=272776&r1=272775&r2=272776&view=diff
==
--- cfe/trunk/include/clang-c/Index.h (original)
+++ cfe/trunk/include/clang-c/Index.h Wed Jun 15 06:24:54 2016
@@ -2305,11 +2305,7 @@ enum CXCursorKind {
*/
   CXCursor_OMPTargetUpdateDirective  = 265,
 
-  /** \brief A MS-specific late parsed compound statement.
-   */
-  CXCursor_MSLateParsedCompoundStmt = 266,
-
-  CXCursor_LastStmt  = CXCursor_MSLateParsedCompoundStmt,
+  CXCursor_LastStmt  = CXCursor_OMPTargetUpdateDirective,
 
   /**
* \brief Cursor that represents the translation unit itself.

Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=272776&r1=272775&r2=272776&view=diff
==
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Wed Jun 15 06:24:54 2016
@@ -2332,7 +2332,6 @@ DEF_TRAVERSE_STMT(SEHExceptStmt, {})
 DEF_TRAVERSE_STMT(SEHFinallyStmt, {})
 DEF_TRAVERSE_STMT(SEHLeaveStmt, {})
 DEF_TRAVERSE_STMT(CapturedStmt, { TRY_TO(TraverseDecl(S->getCapturedDecl())); 
})
-DEF_TRAVERSE_STMT(MSLateParsedCompoundStmt, {})
 
 DEF_TRAVERSE_STMT(CXXOperatorCallExpr, {})
 DEF_TRAVERSE_STMT(OpaqueValueExpr, {})

Modified: cfe/trunk/include/clang/AST/StmtCXX.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtCXX.h?rev=272776&r1=272775&r2=272776&view=diff
==
--- cfe/trunk/include/clang/AST/StmtCXX.h (original)
+++ cfe/trunk/include/clang/AST/StmtCXX.h Wed Jun 15 06:24:54 2016
@@ -18,7 +18,6 @@
 #include "clang/AST/Expr.h"
 #include "clang/AST/NestedNameSpecifier.h"
 #include "clang/AST/Stmt.h"
-#include "clang/Lex/Token.h"
 #include "llvm/Support/Compiler.h"
 
 namespace clang {
@@ -418,51 +417,6 @@ public:
   }
 };
 
-/// This represents a group of statements like { stmt stmt } that must be 
parsed
-/// only during instantiation. Required for better MSVC compatibility.
-class MSLateParsedCompoundStmt final
-: public Stmt,
-  private llvm::TrailingObjects {
-  friend class TrailingObjects;
-  friend class ASTStmtReader;
-  SourceLocation LBraceLoc, RBraceLoc;
-  StringRef StringRep;
-  unsigned NumToks;
-
-  MSLateParsedCompoundStmt()
-  : Stmt(MSLateParsedCompoundStmtClass), NumToks(0) {}
-
-  /// Set tokens for the statement.
-  void init(ASTContext &C, SourceLocation LB, SourceLocation RB,
-ArrayRef Tokens, StringRef Rep);
-
-public:
-  static MSLateParsedCompoundStmt *Create(ASTContext &C, SourceLocation LB,
-  SourceLocation RB,
-  ArrayRef Tokens,
-  StringRef Rep);
-  /// Build an empty statement.
-  static MSLateParsedCompoundStmt *CreateEmpty(ASTContext &C,
-   unsigned NumTokens);
-
-  SourceLocation getLocStart() const LLVM_READONLY { return LBraceLoc; }
-  SourceLocation getLocEnd() const LLVM_READONLY { return RBraceLoc; }
-
-  /// Returns representation of the statement as a string.
-  StringRef getStringRepresentation() const { return StringRep; }
-
-  /// Get list of tokens associated with the statement.
-  ArrayRef tokens() const;
-
-  child_range children() {
-return child_range(child_iterator(), child_iterator());
-  }
-
-  static bo

r272775 - [OPENMP] Fix crash for 'schedule|dist_schedule' clauses during

2016-06-15 Thread Alexey Bataev via cfe-commits
Author: abataev
Date: Wed Jun 15 06:20:48 2016
New Revision: 272775

URL: http://llvm.org/viewvc/llvm-project?rev=272775&view=rev
Log:
[OPENMP] Fix crash for 'schedule|dist_schedule' clauses during
instantiation.

Added checks for non-dependent context when trygin to capture
non-constant schedule chunk expression for proper codegen of outlined
functions.

Modified:
cfe/trunk/lib/Sema/SemaOpenMP.cpp
cfe/trunk/test/OpenMP/distribute_codegen.cpp
cfe/trunk/test/OpenMP/for_codegen.cpp

Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=272775&r1=272774&r2=272775&view=diff
==
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Wed Jun 15 06:20:48 2016
@@ -7341,7 +7341,8 @@ OMPClause *Sema::ActOnOpenMPScheduleClau
   << "schedule" << 1 << ChunkSize->getSourceRange();
   return nullptr;
 }
-  } else if (isParallelOrTaskRegion(DSAStack->getCurrentDirective())) {
+  } else if (isParallelOrTaskRegion(DSAStack->getCurrentDirective()) &&
+ !CurContext->isDependentContext()) {
 llvm::MapVector Captures;
 ValExpr = tryBuildCapture(*this, ValExpr, Captures).get();
 HelperValStmt = buildPreInits(Context, Captures);
@@ -10877,7 +10878,8 @@ OMPClause *Sema::ActOnOpenMPDistSchedule
   << "dist_schedule" << ChunkSize->getSourceRange();
   return nullptr;
 }
-  } else if (isParallelOrTaskRegion(DSAStack->getCurrentDirective())) {
+  } else if (isParallelOrTaskRegion(DSAStack->getCurrentDirective()) &&
+ !CurContext->isDependentContext()) {
 llvm::MapVector Captures;
 ValExpr = tryBuildCapture(*this, ValExpr, Captures).get();
 HelperValStmt = buildPreInits(Context, Captures);

Modified: cfe/trunk/test/OpenMP/distribute_codegen.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_codegen.cpp?rev=272775&r1=272774&r2=272775&view=diff
==
--- cfe/trunk/test/OpenMP/distribute_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_codegen.cpp Wed Jun 15 06:20:48 2016
@@ -238,4 +238,26 @@ void test_precond() {
 
 // no templates for now, as these require special handling in target regions 
and/or declare target
 
+// HCHECK-LABEL: fint
+// HCHECK: call {{.*}}i32 {{.+}}ftemplate
+// HCHECK: ret i32
+
+// HCHECK: load i16, i16*
+// HCHECK: store i16 %
+// HCHECK: call i32 @__tgt_target_teams(
+// HCHECK: call void @__kmpc_for_static_init_4(
+template 
+T ftemplate() {
+  short aa = 0;
+
+#pragma omp target
+#pragma omp teams
+#pragma omp distribute dist_schedule(static, aa)
+  for (int i = 0; i < 100; i++) {
+  }
+  return T();
+}
+
+int fint(void) { return ftemplate(); }
+
 #endif

Modified: cfe/trunk/test/OpenMP/for_codegen.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_codegen.cpp?rev=272775&r1=272774&r2=272775&view=diff
==
--- cfe/trunk/test/OpenMP/for_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/for_codegen.cpp Wed Jun 15 06:20:48 2016
@@ -492,4 +492,25 @@ void loop_with_stmt_expr() {
 // CHECK: call void @__kmpc_for_static_init_4(
 // CHECK: call void @__kmpc_for_static_fini(
 
+
+// CHECK-LABEL: fint
+// CHECK: call {{.*}}i32 {{.*}}ftemplate
+// CHECK: ret i32
+
+// CHECK: load i16, i16*
+// CHECK: store i16 %
+// CHECK: call void {{.+}}@__kmpc_fork_call(
+// CHECK: call void @__kmpc_for_static_init_4(
+template 
+T ftemplate() {
+  short aa = 0;
+
+#pragma omp parallel for schedule(static, aa)
+  for (int i = 0; i < 100; i++) {
+  }
+  return T();
+}
+
+int fint(void) { return ftemplate(); }
+
 #endif // HEADER


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


r272774 - [MSVC] Late parsing of in-class defined member functions in template

2016-06-15 Thread Alexey Bataev via cfe-commits
Author: abataev
Date: Wed Jun 15 06:19:39 2016
New Revision: 272774

URL: http://llvm.org/viewvc/llvm-project?rev=272774&view=rev
Log:
[MSVC] Late parsing of in-class defined member functions in template
classes.

MSVC actively uses unqualified lookup in dependent bases, lookup at the
instantiation point (non-dependent names may be resolved on things
declared later) etc. and all this stuff is the main cause of
incompatibility between clang and MSVC.

Clang tries to emulate MSVC behavior but it may fail in many cases.
clang could store lexed tokens for member functions definitions within
ClassTemplateDecl for later parsing during template instantiation.

It will allow resolving many possible issues with lookup in dependent
base classes and removing many already existing MSVC-specific
hacks/workarounds from the clang code.

Modified:
cfe/trunk/include/clang-c/Index.h
cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
cfe/trunk/include/clang/AST/StmtCXX.h
cfe/trunk/include/clang/Basic/StmtNodes.td
cfe/trunk/include/clang/Parse/Parser.h
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/include/clang/Serialization/ASTBitCodes.h
cfe/trunk/lib/AST/StmtCXX.cpp
cfe/trunk/lib/AST/StmtPrinter.cpp
cfe/trunk/lib/AST/StmtProfile.cpp
cfe/trunk/lib/CodeGen/CGStmt.cpp
cfe/trunk/lib/Parse/ParseTemplate.cpp
cfe/trunk/lib/Parse/Parser.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/lib/Sema/SemaStmt.cpp
cfe/trunk/lib/Sema/TreeTransform.h
cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
cfe/trunk/lib/Serialization/ASTWriterStmt.cpp
cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp
cfe/trunk/test/SemaTemplate/ms-lookup-template-base-classes.cpp
cfe/trunk/tools/libclang/CIndex.cpp
cfe/trunk/tools/libclang/CXCursor.cpp

Modified: cfe/trunk/include/clang-c/Index.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=272774&r1=272773&r2=272774&view=diff
==
--- cfe/trunk/include/clang-c/Index.h (original)
+++ cfe/trunk/include/clang-c/Index.h Wed Jun 15 06:19:39 2016
@@ -2305,7 +2305,11 @@ enum CXCursorKind {
*/
   CXCursor_OMPTargetUpdateDirective  = 265,
 
-  CXCursor_LastStmt  = CXCursor_OMPTargetUpdateDirective,
+  /** \brief A MS-specific late parsed compound statement.
+   */
+  CXCursor_MSLateParsedCompoundStmt = 266,
+
+  CXCursor_LastStmt  = CXCursor_MSLateParsedCompoundStmt,
 
   /**
* \brief Cursor that represents the translation unit itself.

Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=272774&r1=272773&r2=272774&view=diff
==
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Wed Jun 15 06:19:39 2016
@@ -2332,6 +2332,7 @@ DEF_TRAVERSE_STMT(SEHExceptStmt, {})
 DEF_TRAVERSE_STMT(SEHFinallyStmt, {})
 DEF_TRAVERSE_STMT(SEHLeaveStmt, {})
 DEF_TRAVERSE_STMT(CapturedStmt, { TRY_TO(TraverseDecl(S->getCapturedDecl())); 
})
+DEF_TRAVERSE_STMT(MSLateParsedCompoundStmt, {})
 
 DEF_TRAVERSE_STMT(CXXOperatorCallExpr, {})
 DEF_TRAVERSE_STMT(OpaqueValueExpr, {})

Modified: cfe/trunk/include/clang/AST/StmtCXX.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtCXX.h?rev=272774&r1=272773&r2=272774&view=diff
==
--- cfe/trunk/include/clang/AST/StmtCXX.h (original)
+++ cfe/trunk/include/clang/AST/StmtCXX.h Wed Jun 15 06:19:39 2016
@@ -18,6 +18,7 @@
 #include "clang/AST/Expr.h"
 #include "clang/AST/NestedNameSpecifier.h"
 #include "clang/AST/Stmt.h"
+#include "clang/Lex/Token.h"
 #include "llvm/Support/Compiler.h"
 
 namespace clang {
@@ -417,6 +418,51 @@ public:
   }
 };
 
+/// This represents a group of statements like { stmt stmt } that must be 
parsed
+/// only during instantiation. Required for better MSVC compatibility.
+class MSLateParsedCompoundStmt final
+: public Stmt,
+  private llvm::TrailingObjects {
+  friend class TrailingObjects;
+  friend class ASTStmtReader;
+  SourceLocation LBraceLoc, RBraceLoc;
+  StringRef StringRep;
+  unsigned NumToks;
+
+  MSLateParsedCompoundStmt()
+  : Stmt(MSLateParsedCompoundStmtClass), NumToks(0) {}
+
+  /// Set tokens for the statement.
+  void init(ASTContext &C, SourceLocation LB, SourceLocation RB,
+ArrayRef Tokens, StringRef Rep);
+
+public:
+  static MSLateParsedCompoundStmt *Create(ASTContext &C, SourceLocation LB,
+  SourceLocation RB,
+  ArrayRef Tokens,
+  StringRef Rep);
+  /// Build an empty statement.
+  static MSLateParsedCompoundStmt *CreateEmpty(ASTContext &C,

Re: [PATCH] D21371: [include-fixer] Correct two wrong header mappings.

2016-06-15 Thread Haojian Wu via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272773: [include-fixer] Correct two wrong header mappings. 
(authored by hokein).

Changed prior to commit:
  http://reviews.llvm.org/D21371?vs=60812&id=60814#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21371

Files:
  clang-tools-extra/trunk/include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp

Index: 
clang-tools-extra/trunk/include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp
===
--- 
clang-tools-extra/trunk/include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp
+++ 
clang-tools-extra/trunk/include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp
@@ -111,7 +111,7 @@
   {"bits/hashtable.h", ""},
   {"bits/hashtable_policy.h", ""},
   {"bits/indirect_array.h", ""},
-  {"bits/ios_base.h", ""},
+  {"bits/ios_base.h", ""},
   {"bits/istream.tcc", ""},
   {"bits/list.tcc", ""},
   {"bits/locale_classes.h", ""},
@@ -171,7 +171,7 @@
   {"bits/stl_vector.h", ""},
   {"bits/stream_iterator.h", ""},
   {"bits/streambuf.tcc", ""},
-  {"bits/streambuf_iterator.h", ""},
+  {"bits/streambuf_iterator.h", ""},
   {"bits/stringfwd.h", ""},
   {"bits/unique_ptr.h", ""},
   {"bits/unordered_map.h", ""},


Index: clang-tools-extra/trunk/include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp
===
--- clang-tools-extra/trunk/include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp
+++ clang-tools-extra/trunk/include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp
@@ -111,7 +111,7 @@
   {"bits/hashtable.h", ""},
   {"bits/hashtable_policy.h", ""},
   {"bits/indirect_array.h", ""},
-  {"bits/ios_base.h", ""},
+  {"bits/ios_base.h", ""},
   {"bits/istream.tcc", ""},
   {"bits/list.tcc", ""},
   {"bits/locale_classes.h", ""},
@@ -171,7 +171,7 @@
   {"bits/stl_vector.h", ""},
   {"bits/stream_iterator.h", ""},
   {"bits/streambuf.tcc", ""},
-  {"bits/streambuf_iterator.h", ""},
+  {"bits/streambuf_iterator.h", ""},
   {"bits/stringfwd.h", ""},
   {"bits/unique_ptr.h", ""},
   {"bits/unordered_map.h", ""},
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] r272773 - [include-fixer] Correct two wrong header mappings.

2016-06-15 Thread Haojian Wu via cfe-commits
Author: hokein
Date: Wed Jun 15 06:15:12 2016
New Revision: 272773

URL: http://llvm.org/viewvc/llvm-project?rev=272773&view=rev
Log:
[include-fixer] Correct two wrong header mappings.

Reviewers: bkramer

Subscribers: ioeric, cfe-commits

Differential Revision: http://reviews.llvm.org/D21371

Modified:

clang-tools-extra/trunk/include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp

Modified: 
clang-tools-extra/trunk/include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp?rev=272773&r1=272772&r2=272773&view=diff
==
--- 
clang-tools-extra/trunk/include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp 
(original)
+++ 
clang-tools-extra/trunk/include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp 
Wed Jun 15 06:15:12 2016
@@ -111,7 +111,7 @@ const HeaderMapCollector::HeaderMap *get
   {"bits/hashtable.h", ""},
   {"bits/hashtable_policy.h", ""},
   {"bits/indirect_array.h", ""},
-  {"bits/ios_base.h", ""},
+  {"bits/ios_base.h", ""},
   {"bits/istream.tcc", ""},
   {"bits/list.tcc", ""},
   {"bits/locale_classes.h", ""},
@@ -171,7 +171,7 @@ const HeaderMapCollector::HeaderMap *get
   {"bits/stl_vector.h", ""},
   {"bits/stream_iterator.h", ""},
   {"bits/streambuf.tcc", ""},
-  {"bits/streambuf_iterator.h", ""},
+  {"bits/streambuf_iterator.h", ""},
   {"bits/stringfwd.h", ""},
   {"bits/unique_ptr.h", ""},
   {"bits/unordered_map.h", ""},


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


  1   2   >