Re: [PATCH] D14498: [Analyzer] Fix an assertion caused by r250237 (PR25392)

2015-11-10 Thread Sean Eveson via cfe-commits
seaneveson abandoned this revision.
seaneveson added a comment.

Fixed by r252506. Thanks Devin.


http://reviews.llvm.org/D14498



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


Re: [PATCH] D13759: [Clang] Fix Clang-tidy modernize-use-auto warnings in headers and generated files; other minor cleanups.

2015-11-10 Thread Hans Wennborg via cfe-commits
hans added a comment.

Some of these are great improvements, especially using auto for iterators etc.

But I'm not sure we'll want to start changing "Foo *foo = new Foo;" to use auto 
everywhere. I expect we'd have to do that in a huge number of places?



Comment at: include/clang/AST/ASTVector.h:385
@@ -383,3 +384,3 @@
   // Allocate the memory from the ASTContext.
-  T *NewElts = new (C, llvm::alignOf()) T[NewCapacity];
+  auto *NewElts = new (C, llvm::alignOf()) T[NewCapacity];
 

I'm not sure this one is an improvement.


Comment at: include/clang/AST/DeclContextInternals.h:90
@@ -88,3 +89,3 @@
 else {
-  DeclsTy *VT = new DeclsTy();
+  auto *VT = new DeclsTy();
   if (NamedDecl *OldD = getAsDecl())

Same here.


Comment at: include/clang/AST/DeclTemplate.h:1726
@@ -1725,4 +1725,3 @@
"Already set to a class template partial specialization!");
-SpecializedPartialSpecialization *PS
-  = new (getASTContext()) SpecializedPartialSpecialization();
+auto *PS = new (getASTContext()) SpecializedPartialSpecialization();
 PS->PartialSpecialization = PartialSpec;

But here it does make it nicer :-)


Repository:
  rL LLVM

http://reviews.llvm.org/D13759



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


Re: [PATCH] D14471: [AArch64] Fix a crash in driver

2015-11-10 Thread Renato Golin via cfe-commits
rengolin added a comment.

In http://reviews.llvm.org/D14471#285492, @ahatanak wrote:

> Which two calls? Do you mean getAArch64TargetCPU and 
> getAArch64ArchFeaturesFromMcpu?


No, the two getAArch64TargetCPU calls, but they don't even get called twice, 
and the value is write-only. Ignore that.

> Do you mean getAArch64TargetCPU should return "generic" when IsNative is null?


Something like that, yes. The problem here is that you're leaking out a 
specific fact about the cpu which should be handled by the function and not 
left as an exercise to the reader, in this case, the Diag message. Every other 
Diag or usage of that function will have to use the same convoluted pattern if 
they were to account for the "native" handling.

However, if you just return "native", then both 
getAArch64MicroArchFeaturesFromMcpu() and D.Diag() will be able to use it as 
any other CPU name. If getAArch64MicroArchFeaturesFromMcpu() can't cope with 
"native", than I think it should be changed to do so.

Makes sense?

cheers,
--renato


http://reviews.llvm.org/D14471



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


Re: [PATCH] D14354: Add new compiler flag to enable the generation of dwarf accelerator tables

2015-11-10 Thread Tamas Berghammer via cfe-commits
tberghammer added a comment.

I am not in a hurry with getting this change in, but happy to take a look for 
enabling the tuning if somebody can explain me what you mean under it (I have 
almost no llvm/clang development experience)


http://reviews.llvm.org/D14354



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


Re: [PATCH] D13351: [Power PC] add soft float support for ppc32

2015-11-10 Thread Strahinja Petrovic via cfe-commits
spetrovic added a comment.

ping


http://reviews.llvm.org/D13351



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


r252599 - [Analyzer] Fix comments and formatting. NFC.

2015-11-10 Thread Sean Eveson via cfe-commits
Author: seaneveson
Date: Tue Nov 10 05:48:55 2015
New Revision: 252599

URL: http://llvm.org/viewvc/llvm-project?rev=252599&view=rev
Log:
[Analyzer] Fix comments and formatting. NFC.

Modified:
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/LoopWidening.h
cfe/trunk/lib/StaticAnalyzer/Core/CallEvent.cpp
cfe/trunk/lib/StaticAnalyzer/Core/LoopWidening.cpp

Modified: 
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/LoopWidening.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/LoopWidening.h?rev=252599&r1=252598&r2=252599&view=diff
==
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/LoopWidening.h 
(original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/LoopWidening.h 
Tue Nov 10 05:48:55 2015
@@ -1,4 +1,4 @@
-//===--- LoopWidening.h - Instruction class definition --*- C++ 
-*-===//
+//===--- LoopWidening.h - Widen loops ---*- C++ 
-*-===//
 //
 // The LLVM Compiler Infrastructure
 //
@@ -28,8 +28,7 @@ namespace ento {
 /// by the loop body in any iteration.
 ProgramStateRef getWidenedLoopState(ProgramStateRef PrevState,
 const LocationContext *LCtx,
-unsigned BlockCount,
-const Stmt *LoopStmt);
+unsigned BlockCount, const Stmt *LoopStmt);
 
 } // end namespace ento
 } // end namespace clang

Modified: cfe/trunk/lib/StaticAnalyzer/Core/CallEvent.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/CallEvent.cpp?rev=252599&r1=252598&r2=252599&view=diff
==
--- cfe/trunk/lib/StaticAnalyzer/Core/CallEvent.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/CallEvent.cpp Tue Nov 10 05:48:55 2015
@@ -420,8 +420,8 @@ const FunctionDecl *CXXInstanceCall::get
   return getSVal(CE->getCallee()).getAsFunctionDecl();
 }
 
-void CXXInstanceCall::getExtraInvalidatedValues(ValueList &Values,
-RegionAndSymbolInvalidationTraits *ETraits) const {
+void CXXInstanceCall::getExtraInvalidatedValues(
+ValueList &Values, RegionAndSymbolInvalidationTraits *ETraits) const {
   SVal ThisVal = getCXXThisVal();
   Values.push_back(ThisVal);
 
@@ -442,7 +442,7 @@ void CXXInstanceCall::getExtraInvalidate
   return;
 
 ETraits->setTrait(ThisRegion->getBaseRegion(),
-  RegionAndSymbolInvalidationTraits::TK_PreserveContents);
+  RegionAndSymbolInvalidationTraits::TK_PreserveContents);
   }
 }
 

Modified: cfe/trunk/lib/StaticAnalyzer/Core/LoopWidening.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/LoopWidening.cpp?rev=252599&r1=252598&r2=252599&view=diff
==
--- cfe/trunk/lib/StaticAnalyzer/Core/LoopWidening.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/LoopWidening.cpp Tue Nov 10 05:48:55 2015
@@ -1,4 +1,4 @@
-//===--- LoopWidening.cpp - Instruction class definition *- C++ 
-*-===//
+//===--- LoopWidening.cpp - Widen loops -*- C++ 
-*-===//
 //
 // The LLVM Compiler Infrastructure
 //


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


r252601 - No longer creating the install-clang target for IDEs, as it was never meant for those.

2015-11-10 Thread Aaron Ballman via cfe-commits
Author: aaronballman
Date: Tue Nov 10 06:51:25 2015
New Revision: 252601

URL: http://llvm.org/viewvc/llvm-project?rev=252601&view=rev
Log:
No longer creating the install-clang target for IDEs, as it was never meant for 
those.

Modified:
cfe/trunk/tools/driver/CMakeLists.txt

Modified: cfe/trunk/tools/driver/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/CMakeLists.txt?rev=252601&r1=252600&r2=252601&view=diff
==
--- cfe/trunk/tools/driver/CMakeLists.txt (original)
+++ cfe/trunk/tools/driver/CMakeLists.txt Tue Nov 10 06:51:25 2015
@@ -54,11 +54,14 @@ add_dependencies(clang clang-headers)
 install(TARGETS clang
   RUNTIME DESTINATION bin
   COMPONENT clang)
-add_custom_target(install-clang
-  DEPENDS clang
-  COMMAND "${CMAKE_COMMAND}"
-  -DCMAKE_INSTALL_COMPONENT=clang
-  -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+
+if(NOT CMAKE_CONFIGURATION_TYPES)
+  add_custom_target(install-clang
+DEPENDS clang
+COMMAND "${CMAKE_COMMAND}"
+-DCMAKE_INSTALL_COMPONENT=clang
+-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+endif()
 
 if(NOT CLANG_LINKS_TO_CREATE)
   set(CLANG_LINKS_TO_CREATE clang++ clang-cl)


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


Re: [PATCH] D14502: [PATCH] Do not create a clang-install target for MSVC solutions

2015-11-10 Thread Aaron Ballman via cfe-commits
aaron.ballman closed this revision.
aaron.ballman marked an inline comment as done.
aaron.ballman added a comment.

Committed in r252601.


http://reviews.llvm.org/D14502



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


Re: [PATCH] D14292: [libcxx] Make it possible to build a no-exceptions variant of libcxx.

2015-11-10 Thread Asiri Rathnayake via cfe-commits
rmaprath closed this revision.
rmaprath added a comment.

Thanks Jon!

Committed as r252598. The current buildbots are happy (except for the ARM one, 
which seem to have gone away).

I will update http://reviews.llvm.org/D14293 to include the new runs.

Cheers,

- Asiri


http://reviews.llvm.org/D14292



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


[PATCH] D14540: clang-tidy: Fix FP in MacroParenthesesChecker when using object member pointer

2015-11-10 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki created this revision.
danielmarjamaki added a reviewer: alexfh.
danielmarjamaki added a subscriber: cfe-commits.

This fixes the FP in http://llvm.org/bugs/show_bug.cgi?id=25208

http://reviews.llvm.org/D14540

Files:
  clang-tidy/misc/MacroParenthesesCheck.cpp
  test/clang-tidy/misc-macro-parentheses.cpp

Index: test/clang-tidy/misc-macro-parentheses.cpp
===
--- test/clang-tidy/misc-macro-parentheses.cpp
+++ test/clang-tidy/misc-macro-parentheses.cpp
@@ -34,6 +34,8 @@
 #define GOOD23(type)  (type::Field)
 #define GOOD24(t) std::set s
 #define GOOD25(t) std::set s
+#define GOOD26(x) (a->*x)
+#define GOOD27(x) (a.*x)
 
 // These are allowed for now..
 #define MAYBE1*12.34
Index: clang-tidy/misc/MacroParenthesesCheck.cpp
===
--- clang-tidy/misc/MacroParenthesesCheck.cpp
+++ clang-tidy/misc/MacroParenthesesCheck.cpp
@@ -148,7 +148,8 @@
   continue;
 
 // Argument is a struct member.
-if (Prev.isOneOf(tok::period, tok::arrow, tok::coloncolon))
+if (Prev.isOneOf(tok::period, tok::arrow, tok::coloncolon, tok::arrowstar,
+ tok::periodstar))
   continue;
 
 // Argument is a namespace or class.


Index: test/clang-tidy/misc-macro-parentheses.cpp
===
--- test/clang-tidy/misc-macro-parentheses.cpp
+++ test/clang-tidy/misc-macro-parentheses.cpp
@@ -34,6 +34,8 @@
 #define GOOD23(type)  (type::Field)
 #define GOOD24(t) std::set s
 #define GOOD25(t) std::set s
+#define GOOD26(x) (a->*x)
+#define GOOD27(x) (a.*x)
 
 // These are allowed for now..
 #define MAYBE1*12.34
Index: clang-tidy/misc/MacroParenthesesCheck.cpp
===
--- clang-tidy/misc/MacroParenthesesCheck.cpp
+++ clang-tidy/misc/MacroParenthesesCheck.cpp
@@ -148,7 +148,8 @@
   continue;
 
 // Argument is a struct member.
-if (Prev.isOneOf(tok::period, tok::arrow, tok::coloncolon))
+if (Prev.isOneOf(tok::period, tok::arrow, tok::coloncolon, tok::arrowstar,
+ tok::periodstar))
   continue;
 
 // Argument is a namespace or class.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D13759: [Clang] Fix Clang-tidy modernize-use-auto warnings in headers and generated files; other minor cleanups.

2015-11-10 Thread Aaron Ballman via cfe-commits
aaron.ballman added inline comments.


Comment at: include/clang/Analysis/Analyses/Consumed.h:266
@@ -266,2 +265,3 @@
   };
-}} // end namespace clang::consumed
+} // end namespace consumed
+} // end namespace clang

I don't know whether this is an improvement or not.


Comment at: include/clang/Rewrite/Core/Rewriter.h:171
@@ -170,4 +170,3 @@
   const RewriteBuffer *getRewriteBufferFor(FileID FID) const {
-std::map::const_iterator I =
-  RewriteBuffers.find(FID);
+const auto I = RewriteBuffers.find(FID);
 return I == RewriteBuffers.end() ? nullptr : &I->second;

Not that this matters in the cases in this code, but const iterator is not the 
same as const_iterator. I think these changes are a step forward in terms of 
readability, but a step backwards in terms of the type system.


Comment at: tools/libclang/Indexing.cpp:672
@@ -671,5 +671,3 @@
   IdxCtx.indexTopLevelDecl(D);
-  if (IdxCtx.shouldAbort())
-return false;
-  return true;
+  return (!IdxCtx.shouldAbort());
 }

The extra parens do not add any value here.


Comment at: utils/TableGen/ClangAttrEmitter.cpp:959
@@ -958,3 +958,3 @@
 void writeTemplateInstantiation(raw_ostream &OS) const override {
-  OS << "  " << getType() << " *tempInst" << getUpperName()
+  OS << "  auto *tempInst" << getUpperName()
  << " = new (C, 16) " << getType()

I really like all of these changes to this file!


Repository:
  rL LLVM

http://reviews.llvm.org/D13759



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


Re: [PATCH] D14293: [libcxx] Add -fno-exceptions libcxx builders to zorg

2015-11-10 Thread Asiri Rathnayake via cfe-commits
rmaprath updated this revision to Diff 39806.
rmaprath added a comment.

Updated patch to remove the skipping of tests. Now that we have the appropriate 
XFAILs in place, these two builders should be green.

I've locally tested the x86 run, I expect the ARM run to be fairly similar.

@Renato: could you kindly test this builder locally? Just in case.

Thanks.

- Asiri


http://reviews.llvm.org/D14293

Files:
  buildbot/osuosl/master/config/builders.py

Index: buildbot/osuosl/master/config/builders.py
===
--- buildbot/osuosl/master/config/builders.py
+++ buildbot/osuosl/master/config/builders.py
@@ -740,6 +758,15 @@
  env={'CC': 'clang', 'CXX': 'clang++'}),
  'category': 'libcxx'},
 
+# x86_64 -fno-exceptions libcxx builder
+{'name': 'libcxx-libcxxabi-x86_64-linux-debian-noexceptions',
+ 'slavenames': ['gribozavr4'],
+ 'builddir': 'libcxx-libcxxabi-x86_64-linux-debian-noexceptions',
+ 'factory': LibcxxAndAbiBuilder.getLibcxxAndAbiBuilder(
+ env={'CC': 'clang', 'CXX': 'clang++'},
+ cmake_extra_opts={'LIBCXX_ENABLE_EXCEPTIONS': 'OFF'}),
+ 'category': 'libcxx'},
+
 {'name': 'libcxx-libcxxabi-singlethreaded-x86_64-linux-debian',
  'slavenames': ['gribozavr4'],
  'builddir': 'libcxx-libcxxabi-singlethreaded-x86_64-linux-debian',
@@ -840,6 +867,21 @@
 cmake_extra_opts={'LIBCXXABI_USE_LLVM_UNWINDER': 'True',
   'CMAKE_C_FLAGS': '-mcpu=cortex-a15',
   'CMAKE_CXX_FLAGS': '-mcpu=cortex-a15'})},
+
+# Cortex-A15 -fno-exceptions libcxx builder
+{'name': 'libcxx-libcxxabi-arm-linux-noexceptions',
+ 'slavenames': ['linaro-chrome-01'],
+ 'builddir': 'libcxx-libcxxabi-arm-linux-noexceptions',
+ 'category': 'libcxx',
+ 'factory': LibcxxAndAbiBuilder.getLibcxxAndAbiBuilder(
+env={'CC': 'clang', 'CXX': 'clang++'},
+# FIXME: there should be a way to merge autodetected with 
user-defined linker flags
+# See: libcxxabi/test/lit.cfg
+lit_extra_opts={'link_flags': '"-lc++abi -lc -lm -lpthread 
-lunwind -ldl -L/opt/llvm/lib/clang/3.6.0/lib/linux -lclang_rt.builtins-arm"'},
+cmake_extra_opts={'LIBCXXABI_USE_LLVM_UNWINDER': 'True',
+  'CMAKE_C_FLAGS': '-mcpu=cortex-a15',
+  'CMAKE_CXX_FLAGS': '-mcpu=cortex-a15',
+  'LIBCXX_ENABLE_EXCEPTIONS': 'OFF'})},
 ]
 
 # Experimental and stopped builders


Index: buildbot/osuosl/master/config/builders.py
===
--- buildbot/osuosl/master/config/builders.py
+++ buildbot/osuosl/master/config/builders.py
@@ -740,6 +758,15 @@
  env={'CC': 'clang', 'CXX': 'clang++'}),
  'category': 'libcxx'},
 
+# x86_64 -fno-exceptions libcxx builder
+{'name': 'libcxx-libcxxabi-x86_64-linux-debian-noexceptions',
+ 'slavenames': ['gribozavr4'],
+ 'builddir': 'libcxx-libcxxabi-x86_64-linux-debian-noexceptions',
+ 'factory': LibcxxAndAbiBuilder.getLibcxxAndAbiBuilder(
+ env={'CC': 'clang', 'CXX': 'clang++'},
+ cmake_extra_opts={'LIBCXX_ENABLE_EXCEPTIONS': 'OFF'}),
+ 'category': 'libcxx'},
+
 {'name': 'libcxx-libcxxabi-singlethreaded-x86_64-linux-debian',
  'slavenames': ['gribozavr4'],
  'builddir': 'libcxx-libcxxabi-singlethreaded-x86_64-linux-debian',
@@ -840,6 +867,21 @@
 cmake_extra_opts={'LIBCXXABI_USE_LLVM_UNWINDER': 'True',
   'CMAKE_C_FLAGS': '-mcpu=cortex-a15',
   'CMAKE_CXX_FLAGS': '-mcpu=cortex-a15'})},
+
+# Cortex-A15 -fno-exceptions libcxx builder
+{'name': 'libcxx-libcxxabi-arm-linux-noexceptions',
+ 'slavenames': ['linaro-chrome-01'],
+ 'builddir': 'libcxx-libcxxabi-arm-linux-noexceptions',
+ 'category': 'libcxx',
+ 'factory': LibcxxAndAbiBuilder.getLibcxxAndAbiBuilder(
+env={'CC': 'clang', 'CXX': 'clang++'},
+# FIXME: there should be a way to merge autodetected with user-defined linker flags
+# See: libcxxabi/test/lit.cfg
+lit_extra_opts={'link_flags': '"-lc++abi -lc -lm -lpthread -lunwind -ldl -L/opt/llvm/lib/clang/3.6.0/lib/linux -lclang_rt.builtins-arm"'},
+cmake_extra_opts={'LIBCXXABI_USE_LLVM_UNWINDER': 'True',
+  'CMAKE_C_FLAGS': '-mcpu=cortex-a15',
+  'CMAKE_CXX_FLAGS': '-mcpu=cortex-a15',
+  'LIBCXX_ENABLE_EXCEPTIONS': 'OFF'})},
 ]
 
 # Experimental and stopped builders
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D14517: Fix bug 25362 "cppcoreguidelines-pro-bounds-array-to-pointer-decay does not consider const"

2015-11-10 Thread Aaron Ballman via cfe-commits
aaron.ballman added a comment.

I generally think this LGTM, but I would wait for a second confirmation before 
committing.



Comment at: 
clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp:33
@@ +32,3 @@
+  ast_matchers::internal::Matcher, InnerMatcher) {
+  auto E = &Node;
+  do {

const auto *E, please.


http://reviews.llvm.org/D14517



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


Re: [PATCH] D14540: clang-tidy: Fix FP in MacroParenthesesChecker when using object member pointer

2015-11-10 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

Looks good. Thank you for the fix!


http://reviews.llvm.org/D14540



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


Re: [PATCH] D10305: [Clang Static Analyzer] Bug identification

2015-11-10 Thread Sean Eveson via cfe-commits
seaneveson added a comment.

We are working on tools that use the new hash for bug suppression. There seems 
to be no way to predict the names of future hashes. We have products (that will 
use the bug identification) that are on a different release schedule to our 
clang compiler. These tools will not be able to take advantage of new hashes, 
unless they know the future hash names.

Regarding the previous discussions on the hash name:

In http://reviews.llvm.org/D10305#250238, @zaks.anna wrote:

> Maybe we could have "issue_hash", "issue_hash_1"(offset based), and 
> "issue_hash_2"(content of line) and add another field "issue_hash_version" 
> that describes the version "issue_hash" is using?


This would allow tools to discern the order of the hashes from the plist file. 
It would also be possible to identify new hashes and those that are no longer 
supported. These are features we would like in order to make our tools as 
flexible as possible.

In http://reviews.llvm.org/D10305#258162, @zaks.anna wrote:

> I'd suggest to suffix each issue hash field with the description of that 
> hash. For example, we would remove "issue_hash" and replace it with 
> "issue_hash_function_offset" and add "issue_hash_content_of _line_in_context".


This makes forwards compatibility difficult, since there is no way to predict 
the names of future hashes (As far as I understand).

To resolve the forwards compatibility issues, what are peoples opinions on:

- Having a consistent name with an incrementing number (i.e. issue_hash_1)?
- Adding an ordered list of all the hash names to the plist file?

Regards,
Sean Eveson
SN Systems - Sony Computer Entertainment


http://reviews.llvm.org/D10305



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


Re: [PATCH] D14517: Fix bug 25362 "cppcoreguidelines-pro-bounds-array-to-pointer-decay does not consider const"

2015-11-10 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

Looks good with a couple of comments. Thank you for the fix!



Comment at: 
clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp:33
@@ +32,3 @@
+  ast_matchers::internal::Matcher, InnerMatcher) {
+  auto E = &Node;
+  do {

aaron.ballman wrote:
> const auto *E, please.
It's not immediately clear what type `auto` hides here. Please make it the 
concrete type instead. Same for `auto Parents` below.

I think, `auto` should be used, when the initializer contains the concrete type 
literally, or when the type is difficult to reproduce exactly, or specifying it 
doesn't add any clearness to the code (e.g. in `for (auto I = 
some_container.begin(); ...)` using `SomeContainerType<...>::iterator` instead 
of `auto` doesn't make code easier to read or understand). 


Comment at: 
test/clang-tidy/cppcoreguidelines-pro-bounds-array-to-pointer-decay.cpp:45
@@ +44,3 @@
+  void *addrlist[2];
+  void backtrace_symbols(void *const *buffer);
+  backtrace_symbols(static_cast(addrlist)); // OK, explicit cast

The function name and the variable name above don't add any value here. I'd 
shorten them to 1-2 character placeholders.


http://reviews.llvm.org/D14517



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


Re: [PATCH] D10305: [Clang Static Analyzer] Bug identification

2015-11-10 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment.

Thank you for pointing this out. I think it would be great to be forward 
compatible. 
Right now one could use a heuristic such as for every hash the key has the 
"hash" string in its name.
This information might not be sufficient, however, since it would be great to 
have some kind of ordering between the generated hashes, so a tool could choose 
the latest (and possibly greatest) one.

In http://reviews.llvm.org/D10305#286113, @seaneveson wrote:

> To resolve the forwards compatibility issues, what are peoples opinions on:
>
> - Having a consistent name with an incrementing number (i.e. issue_hash_1)?
> - Adding an ordered list of all the hash names to the plist file?


A third alternative would be to have both semantic names (containing hash) and 
a number suffix which indicates the ordering.


http://reviews.llvm.org/D10305



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


[clang-tools-extra] r252608 - [clang-tidy] misc-macro-parentheses: fix fp when using object member pointers

2015-11-10 Thread Daniel Marjamaki via cfe-commits
Author: danielmarjamaki
Date: Tue Nov 10 08:32:25 2015
New Revision: 252608

URL: http://llvm.org/viewvc/llvm-project?rev=252608&view=rev
Log:
[clang-tidy] misc-macro-parentheses: fix fp when using object member pointers

Fixes http://llvm.org/PR25208.


Modified:
clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp
clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp

Modified: clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp?rev=252608&r1=252607&r2=252608&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp Tue Nov 
10 08:32:25 2015
@@ -148,7 +148,8 @@ void MacroParenthesesPPCallbacks::argume
   continue;
 
 // Argument is a struct member.
-if (Prev.isOneOf(tok::period, tok::arrow, tok::coloncolon))
+if (Prev.isOneOf(tok::period, tok::arrow, tok::coloncolon, tok::arrowstar,
+ tok::periodstar))
   continue;
 
 // Argument is a namespace or class.

Modified: clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp?rev=252608&r1=252607&r2=252608&view=diff
==
--- clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp 
(original)
+++ clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp Tue Nov 
10 08:32:25 2015
@@ -34,6 +34,8 @@
 #define GOOD23(type)  (type::Field)
 #define GOOD24(t) std::set s
 #define GOOD25(t) std::set s
+#define GOOD26(x) (a->*x)
+#define GOOD27(x) (a.*x)
 
 // These are allowed for now..
 #define MAYBE1*12.34


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


Re: [PATCH] D14540: clang-tidy: Fix FP in MacroParenthesesChecker when using object member pointer

2015-11-10 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki closed this revision.
danielmarjamaki added a comment.

Committed with 252608


http://reviews.llvm.org/D14540



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


Re: [PATCH] D14293: [libcxx] Add -fno-exceptions libcxx builders to zorg

2015-11-10 Thread Jonathan Roelofs via cfe-commits
jroelofs added inline comments.


Comment at: buildbot/osuosl/master/config/builders.py:880
@@ +879,3 @@
+# See: libcxxabi/test/lit.cfg
+lit_extra_opts={'link_flags': '"-lc++abi -lc -lm -lpthread 
-lunwind -ldl -L/opt/llvm/lib/clang/3.6.0/lib/linux -lclang_rt.builtins-arm"'},
+cmake_extra_opts={'LIBCXXABI_USE_LLVM_UNWINDER': 'True',

The order here seems a bit off to me. I //think// it should be:

lit_extra_opts={'link_flags': '"-lc++abi -lpthread -lunwind -ldl -lc -lm  
-L/opt/llvm/lib/clang/3.6.0/lib/linux -lclang_rt.builtins-arm"'},


http://reviews.llvm.org/D14293



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


Re: [PATCH] D10305: [Clang Static Analyzer] Bug identification

2015-11-10 Thread Sean Eveson via cfe-commits
seaneveson added a comment.

In http://reviews.llvm.org/D10305#286119, @xazax.hun wrote:

> A third alternative would be to have both semantic names (containing hash) 
> and a number suffix which indicates the ordering.


Yes that would work, but I don't understand the benefit of having the semantic 
names in the plist file.


http://reviews.llvm.org/D10305



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


Re: [PATCH] D12906: [RFC] Bug identification("issue_hash") change for CmpRuns.py

2015-11-10 Thread Orbán György via cfe-commits
Hi,

Sorry for my late answer.
We fixed the plist parser for the CodeChecker it shoud process the
plist generated by the current trunk clang with the issue hash tags.

Right now CodeChecker does not support forwarding additional options
directly to clang (uses only the compiler options from the original
build command extended with options required for the static analyzer).
We already discussed such features. I think they will be implemented.
If you have any requirements feel free to create a new issue on our
github page, we can discuss them further there.

With the LD_PRELOAD (linux specific) technique we load a shared object
before every executable during the original build. In this shared
object we filter out the compiler calls (gcc, g++, clang ... it is
configurable) and create a compile command json file, like cmake. We
use these compilation commands to run the clang static analyzer.
With this technique we can create the compilation command json file
build system independent.

The official LD_PRELOAD documentation can be found here:
http://man7.org/linux/man-pages/man8/ld.so.8.html

Best regards,
Gyorgy



On Wed, Oct 28, 2015 at 1:59 PM, Honggyu Kim  wrote:
> honggyu.kim added a comment.
>
> In http://reviews.llvm.org/D12906#274724, @o.gyorgy wrote:
>
>> Hi,
>>
>> You are right the diff is is based on the hash. We already tried to
>>  use an earlier hash generator (before the patch was introduced), which
>>  generates a slightly different plist, that is why the current version
>>  does not work with the patch.
>>  We will fix CodeChecker to use new hash tag introduced in the final
>>  patch (we did not change it so far because we didn't know what will be
>>  the accepted naming convention and plist format).
>
>
> Hi, thanks for the explanation. I will try again when it is modified based on 
> the final patch.
>
>> We use LD_PRELOAD technique the log all the compiler calls, so no CC
>
>>  or CXX environment variable orverride is necessary.
>
>>  With the 'export CODECHECKER_VERBOSE=debug' enviromnet variable you
>
>>  can see the analyzer commands.
>
>
> I just cross-compiled Linux kernel using CodeChecker but I don't get the 
> proper analysis result. I have fixed cross-compilation issue by adding 
> --analyzer-target option to scan-build in http://reviews.llvm.org/D10356.
> Could you please explain more about LD_PRELOAD technique? I would like to 
> more understand how it works.
>
> Kind regards,
>
> Honggyu
>
>
> http://reviews.llvm.org/D12906
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12906: [RFC] Bug identification("issue_hash") change for CmpRuns.py

2015-11-10 Thread Gyorgy Orban via cfe-commits
o.gyorgy added a comment.

Hi,

Sorry for my late answer.
We fixed the plist parser for the CodeChecker it shoud process the
plist generated by the current trunk clang with the issue hash tags.

Right now CodeChecker does not support forwarding additional options
directly to clang (uses only the compiler options from the original
build command extended with options required for the static analyzer).
We already discussed such features. I think they will be implemented.
If you have any requirements feel free to create a new issue on our
github page, we can discuss them further there.

With the LD_PRELOAD (linux specific) technique we load a shared object
before every executable during the original build. In this shared
object we filter out the compiler calls (gcc, g++, clang ... it is
configurable) and create a compile command json file, like cmake. We
use these compilation commands to run the clang static analyzer.
With this technique we can create the compilation command json file
build system independent.

The official LD_PRELOAD documentation can be found here:
http://man7.org/linux/man-pages/man8/ld.so.8.html

Best regards,
Gyorgy


http://reviews.llvm.org/D12906



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


[libcxx] r252610 - Explicitly #include so that we get std::move. Thanks to Walter for the bug report.

2015-11-10 Thread Marshall Clow via cfe-commits
Author: marshall
Date: Tue Nov 10 09:22:08 2015
New Revision: 252610

URL: http://llvm.org/viewvc/llvm-project?rev=252610&view=rev
Log:
Explicitly #include  so that we get std::move. Thanks to Walter for 
the bug report.

Modified:
libcxx/trunk/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp

Modified: 
libcxx/trunk/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp?rev=252610&r1=252609&r2=252610&view=diff
==
--- 
libcxx/trunk/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp 
(original)
+++ 
libcxx/trunk/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp 
Tue Nov 10 09:22:08 2015
@@ -40,6 +40,7 @@
 
 #include 
 #include 
+#include  // for std::move
 #include 
 
 struct NonCopyable {


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


[libcxx] r252612 - Walter pointed out some missing includes in the tests. Fixing the includes uncovered a couple bugs in the _v type traits. Fixed those, too

2015-11-10 Thread Marshall Clow via cfe-commits
Author: marshall
Date: Tue Nov 10 09:48:23 2015
New Revision: 252612

URL: http://llvm.org/viewvc/llvm-project?rev=252612&view=rev
Log:
Walter pointed out some missing includes in the tests. Fixing the includes 
uncovered a couple bugs in the _v type traits. Fixed those, too

Modified:
libcxx/trunk/include/type_traits

libcxx/trunk/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_array.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_class.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_enum.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_floating_point.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_integral.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_lvalue_reference.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_object_pointer.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_pointer.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_null_pointer.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_pointer.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_rvalue_reference.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_union.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_void.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/nullptr.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.comp/is_arithmetic.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.comp/is_compound.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.comp/is_fundamental.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.comp/is_member_pointer.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.comp/is_object.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.comp/is_reference.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.comp/is_scalar.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_const.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_copy_assignable.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_copy_constructible.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_final.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_constructible.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_assignable.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_assignable.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_constructible.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_destructible.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_assignable.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_constructible.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_pod.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_signed.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_assignable.pass.cpp

libcxx/trunk/test/std/utilities/meta/meta.unary/me

Re: [PATCH] D14293: [libcxx] Add -fno-exceptions libcxx builders to zorg

2015-11-10 Thread Asiri Rathnayake via cfe-commits
rmaprath added inline comments.


Comment at: buildbot/osuosl/master/config/builders.py:880
@@ +879,3 @@
+# See: libcxxabi/test/lit.cfg
+lit_extra_opts={'link_flags': '"-lc++abi -lc -lm -lpthread 
-lunwind -ldl -L/opt/llvm/lib/clang/3.6.0/lib/linux -lclang_rt.builtins-arm"'},
+cmake_extra_opts={'LIBCXXABI_USE_LLVM_UNWINDER': 'True',

jroelofs wrote:
> The order here seems a bit off to me. I //think// it should be:
> 
> lit_extra_opts={'link_flags': '"-lc++abi -lpthread -lunwind -ldl -lc -lm  
> -L/opt/llvm/lib/clang/3.6.0/lib/linux -lclang_rt.builtins-arm"'},
@rengolin: If you are OK with Jon's suggestion, I can update both the 
configurations (I copied these lines from your existing A15 builder).


http://reviews.llvm.org/D14293



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


[libcxx] r252613 - std:: qualify ptrdiff_t in the test. Thanks to Walter for the catch

2015-11-10 Thread Marshall Clow via cfe-commits
Author: marshall
Date: Tue Nov 10 10:04:13 2015
New Revision: 252613

URL: http://llvm.org/viewvc/llvm-project?rev=252613&view=rev
Log:
std:: qualify ptrdiff_t in the test. Thanks to Walter for the catch

Modified:
libcxx/trunk/test/std/depr/depr.c.headers/stdint_h.pass.cpp

Modified: libcxx/trunk/test/std/depr/depr.c.headers/stdint_h.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/stdint_h.pass.cpp?rev=252613&r1=252612&r2=252613&view=diff
==
--- libcxx/trunk/test/std/depr/depr.c.headers/stdint_h.pass.cpp (original)
+++ libcxx/trunk/test/std/depr/depr.c.headers/stdint_h.pass.cpp Tue Nov 10 
10:04:13 2015
@@ -223,10 +223,10 @@ int main()
 assert(UINTMAX_MAX == std::numeric_limits::max());
 
 // PTRDIFF_MIN
-assert(PTRDIFF_MIN == std::numeric_limits::min());
+assert(PTRDIFF_MIN == std::numeric_limits::min());
 
 // PTRDIFF_MAX
-assert(PTRDIFF_MAX == std::numeric_limits::max());
+assert(PTRDIFF_MAX == std::numeric_limits::max());
 
 // SIG_ATOMIC_MIN
 assert(SIG_ATOMIC_MIN == std::numeric_limits::min());


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


[libcxx] r252614 - Fix typo I just introduced.

2015-11-10 Thread Marshall Clow via cfe-commits
Author: marshall
Date: Tue Nov 10 10:10:17 2015
New Revision: 252614

URL: http://llvm.org/viewvc/llvm-project?rev=252614&view=rev
Log:
Fix typo I just introduced.

Modified:
libcxx/trunk/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp

Modified: 
libcxx/trunk/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp?rev=252614&r1=252613&r2=252614&view=diff
==
--- 
libcxx/trunk/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp 
(original)
+++ 
libcxx/trunk/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp 
Tue Nov 10 10:10:17 2015
@@ -40,7 +40,7 @@
 
 #include 
 #include 
-#include  // for std::move
+#include  // for std::move
 #include 
 
 struct NonCopyable {


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


Re: [PATCH] D14441: [OpenCL] Pipe types support.

2015-11-10 Thread Pekka Jääskeläinen via cfe-commits
pekka.jaaskelainen requested changes to this revision.
pekka.jaaskelainen added a comment.
This revision now requires changes to proceed.

Only small issues found, plus it could use some more test cases.



Comment at: include/clang/AST/TypeLoc.h:2049
@@ +2048,3 @@
+  SourceRange getLocalSourceRange() const {
+return SourceRange( getKWLoc() );
+  }

Extra white spaces.


Comment at: include/clang/Sema/DeclSpec.h:1425
@@ -1415,1 +1424,3 @@
 
+struct PipeTypeInfo : TypeInfoCommon {
+/// The access writes.

Indent error.


Comment at: include/clang/Sema/DeclSpec.h:1426
@@ +1425,3 @@
+struct PipeTypeInfo : TypeInfoCommon {
+/// The access writes.
+unsigned AccessWrites : 3;

I think this needs a better comment than duplicating the variable name. What is 
the purpose of the variable?


Comment at: include/clang/Sema/DeclSpec.h:1554
@@ +1553,3 @@
+  static DeclaratorChunk getPipe(unsigned TypeQuals,
+  SourceLocation Loc) {
+DeclaratorChunk I;

Indent issue.


Comment at: include/clang/Serialization/ASTBitCodes.h:911
@@ +910,3 @@
+  TYPE_ADJUSTED  = 42,
+  /// \brief An PipeType record.
+  TYPE_PIPE  = 43

A


Comment at: lib/AST/ASTContext.cpp:3121
@@ +3120,3 @@
+/// getPipeType - Return pipe type for the specified type.
+QualType ASTContext::getPipeType(QualType T ) const {
+  // Unique pointers, to guarantee there is only one pointer of a particular

White space errror.


Comment at: lib/AST/ASTContext.cpp:3141
@@ +3140,3 @@
+  }
+  PipeType *New = new (*this, TypeAlignment) PipeType(T, Canonical);
+  Types.push_back(New);

Should we assign T to 'Canonical' if it already was Canonical or is this 
intentional somehow?


Comment at: lib/AST/ItaniumMangle.cpp:2672
@@ +2671,3 @@
+  //  ::= U   # vendor extended type qualifier
+  // (Until there's a standardized mangling...)
+  Out << "8ocl_pipe";

This seems to conform to SPIR 2.0, should we mention it here?


Comment at: lib/Parse/ParseDecl.cpp:4954
@@ +4953,3 @@
+
+  if ( D.getDeclSpec().isTypeSpecPipe() ) {
+DeclSpec &DS = D.getMutableDeclSpec();

WS issues.


Comment at: lib/Parse/ParseDecl.cpp:4958
@@ +4957,3 @@
+  D.AddTypeInfo(DeclaratorChunk::getPipe(DS.getTypeQualifiers(),
+   DS.getPipeLoc()),
+  DS.getAttributes(),

Indent issues.


Comment at: lib/Sema/DeclSpec.cpp:729
@@ +728,3 @@
+
+  if ( TypeSpecType != TST_unspecified ) {
+PrevSpec = DeclSpec::getSpecifierName((TST) TypeSpecType, Policy);

WS issues.


Comment at: lib/Sema/DeclSpec.cpp:735
@@ +734,3 @@
+
+  if ( isPipe ) {
+TypeSpecPipe = TSP_pipe;

ditto


Comment at: lib/Sema/SemaType.cpp:1570
@@ -1564,3 +1569,3 @@
   // attributes are pushed around.
-  if (AttributeList *attrs = DS.getAttributes().getList())
-processTypeAttrs(state, Result, TAL_DeclSpec, attrs);
+  if ( !DS.isTypeSpecPipe() ) { // pipe attributes will be handled 
later ( at GetFullTypeForDeclarator )
+if ( AttributeList *attrs = DS.getAttributes().getList())

WS issues and an overlong line.


Comment at: lib/Sema/SemaType.cpp:1571
@@ +1570,3 @@
+  if ( !DS.isTypeSpecPipe() ) { // pipe attributes will be handled 
later ( at GetFullTypeForDeclarator )
+if ( AttributeList *attrs = DS.getAttributes().getList())
+  processTypeAttrs(state, Result, TAL_DeclSpec, attrs);

WS issues.


Comment at: lib/Sema/SemaType.cpp:1945
@@ +1944,3 @@
+QualType Sema::BuildPipeType(QualType T,
+SourceLocation Loc) {
+  assert(!T->isObjCObjectType() && "Should build ObjCObjectPointerType");

Indent


Comment at: lib/Sema/TreeTransform.h:5254
@@ +5253,3 @@
+QualType TreeTransform::TransformPipeType(TypeLocBuilder &TLB,
+ PipeTypeLoc TL) {
+  QualType ValueType = getDerived().TransformType(TLB, TL.getValueLoc());

Indent


Comment at: test/CodeGenOpenCL/pipe_types.cl:1
@@ +1,2 @@
+// RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL2.0 -o - %s | FileCheck %s
+

Can you add a couple of more checks? For example:
- the behavior when using CL1.2
- when the inner type of the pipe has a 'const' or similar qualifier
- It can only by a function arg. What if it's a local variable?



http://reviews.llvm.org/D14441



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

Re: [Diffusion] rL246882: Don't crash on a self-alias declaration

2015-11-10 Thread John McCall via cfe-commits
rjmccall added a subscriber: rjmccall.
rjmccall added a comment.

Hmm.  That cast to GlobalAlias seems quite brittle anyway; it would be good to 
fix it (and diagnose the fact that forming the alias failed).  But this change 
seems independently useful.

Approved for 3.7.


Users:
  hfinkel (Author, Auditor)
  3.7-release (Auditor)
  cfe-commits (Auditor)
  tstellarAMD (Auditor)
  rjmccall (Auditor)

http://reviews.llvm.org/rL246882



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


Re: [PATCH] D13759: [Clang] Fix Clang-tidy modernize-use-auto warnings in headers and generated files; other minor cleanups.

2015-11-10 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added inline comments.


Comment at: include/clang/AST/ASTVector.h:385
@@ -383,3 +384,3 @@
   // Allocate the memory from the ASTContext.
-  T *NewElts = new (C, llvm::alignOf()) T[NewCapacity];
+  auto *NewElts = new (C, llvm::alignOf()) T[NewCapacity];
 

hans wrote:
> I'm not sure this one is an improvement.
At least handling of new will be consistent. This will also silent Clang-tidy 
warning.


Comment at: include/clang/Analysis/Analyses/Consumed.h:266
@@ -266,2 +265,3 @@
   };
-}} // end namespace clang::consumed
+} // end namespace consumed
+} // end namespace clang

aaron.ballman wrote:
> I don't know whether this is an improvement or not.
This was changed for consistency with other code. I also think that it's good 
idea to place one statement per line.


Comment at: include/clang/Rewrite/Core/Rewriter.h:171
@@ -170,4 +170,3 @@
   const RewriteBuffer *getRewriteBufferFor(FileID FID) const {
-std::map::const_iterator I =
-  RewriteBuffers.find(FID);
+const auto I = RewriteBuffers.find(FID);
 return I == RewriteBuffers.end() ? nullptr : &I->second;

aaron.ballman wrote:
> Not that this matters in the cases in this code, but const iterator is not 
> the same as const_iterator. I think these changes are a step forward in terms 
> of readability, but a step backwards in terms of the type system.
I'm still learning C++11, so advices how to handle such situations properly are 
welcome!


Comment at: tools/libclang/Indexing.cpp:672
@@ -671,5 +671,3 @@
   IdxCtx.indexTopLevelDecl(D);
-  if (IdxCtx.shouldAbort())
-return false;
-  return true;
+  return (!IdxCtx.shouldAbort());
 }

aaron.ballman wrote:
> The extra parens do not add any value here.
Will remove them.


Repository:
  rL LLVM

http://reviews.llvm.org/D13759



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


Re: [PATCH] D12686: Add support for GCC's '__auto_type' extension.

2015-11-10 Thread Nicholas Allegra via cfe-commits
comex updated this revision to Diff 39838.
comex marked 16 inline comments as done.

http://reviews.llvm.org/D12686

Files:
  include/clang/AST/ASTContext.h
  include/clang/AST/Type.h
  include/clang/Basic/DiagnosticGroups.td
  include/clang/Basic/DiagnosticParseKinds.td
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Basic/Specifiers.h
  include/clang/Basic/TokenKinds.def
  include/clang/Sema/DeclSpec.h
  lib/AST/ASTContext.cpp
  lib/AST/ASTImporter.cpp
  lib/AST/ItaniumMangle.cpp
  lib/AST/MicrosoftMangle.cpp
  lib/AST/Type.cpp
  lib/AST/TypePrinter.cpp
  lib/Format/TokenAnnotator.cpp
  lib/Parse/ParseDecl.cpp
  lib/Parse/ParseObjc.cpp
  lib/Parse/ParseTentative.cpp
  lib/Sema/DeclSpec.cpp
  lib/Sema/SemaDecl.cpp
  lib/Sema/SemaExpr.cpp
  lib/Sema/SemaTemplateDeduction.cpp
  lib/Sema/SemaTemplateVariadic.cpp
  lib/Sema/SemaType.cpp
  lib/Sema/TreeTransform.h
  lib/Serialization/ASTReader.cpp
  lib/Serialization/ASTWriter.cpp
  test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3-1y.cpp
  test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-1y.cpp
  test/Sema/auto-type.c
  test/Sema/bitfield.c
  test/Sema/exprs.c
  test/SemaCXX/auto-type-from-cxx.cpp
  test/SemaCXX/cxx98-compat.cpp

Index: test/SemaCXX/cxx98-compat.cpp
===
--- test/SemaCXX/cxx98-compat.cpp
+++ test/SemaCXX/cxx98-compat.cpp
@@ -100,6 +100,9 @@
 };
 
 auto f() -> int; // expected-warning {{trailing return types are incompatible with C++98}}
+#ifdef CXX14COMPAT
+auto ff() { return 5; } // expected-warning {{'auto' type specifier is incompatible with C++98}}
+#endif
 
 void RangeFor() {
   int xs[] = {1, 2, 3};
Index: test/SemaCXX/auto-type-from-cxx.cpp
===
--- /dev/null
+++ test/SemaCXX/auto-type-from-cxx.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s
+
+struct A {
+operator __auto_type() {} // expected-error {{'__auto_type' not allowed in conversion function type}}
+};
+
+__auto_type a() -> int; // expected-error {{'__auto_type' not allowed in function return type}}
+template 
+__auto_type b() { return T::x; } // expected-error {{'__auto_type' not allowed in function return type}}
+auto c() -> __auto_type { __builtin_unreachable(); } // expected-error {{'__auto_type' not allowed in function return type}}
+int d() {
+  decltype(__auto_type) e = 1; // expected-error {{expected expression}}
+  auto _ = [](__auto_type f) {}; // expected-error {{'__auto_type' not allowed in lambda parameter}}
+  __auto_type g = 2;
+  struct BitField { int field:2; };
+  __auto_type h = BitField{1}.field; // (should work from C++)
+  new __auto_type; // expected-error {{'__auto_type' not allowed in type allocated by 'new'}}
+}
+
Index: test/Sema/exprs.c
===
--- test/Sema/exprs.c
+++ test/Sema/exprs.c
@@ -97,6 +97,7 @@
   R = __alignof(P->x);  // expected-error {{invalid application of 'alignof' to bit-field}}
   R = __alignof(P->y);   // ok.
   R = sizeof(P->x); // expected-error {{invalid application of 'sizeof' to bit-field}}
+  __extension__ ({ R = (__typeof__(P->x)) 2; }); // expected-error {{invalid application of 'typeof' to bit-field}}
   return R;
 }
 
Index: test/Sema/bitfield.c
===
--- test/Sema/bitfield.c
+++ test/Sema/bitfield.c
@@ -63,7 +63,8 @@
 typedef signed Signed;
 
 struct Test5 { unsigned n : 2; } t5;
-typedef __typeof__(t5.n) Unsigned; // Bitfield is unsigned
+// Bitfield is unsigned
+struct Test5 sometest5 = {-1}; // expected-warning {{implicit truncation from 'int' to bitfield changes value from -1 to 3}}
 typedef __typeof__(+t5.n) Signed;  // ... but promotes to signed.
 
 typedef __typeof__(t5.n + 0) Signed; // Arithmetic promotes.
Index: test/Sema/auto-type.c
===
--- /dev/null
+++ test/Sema/auto-type.c
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 %s -fsyntax-only -verify -pedantic -std=c11
+
+__auto_type a = 5; // expected-warning {{'__auto_type' is a GNU extension}}
+__extension__ __auto_type a1 = 5;
+#pragma clang diagnostic ignored "-Wgnu-auto-type"
+__auto_type b = 5.0;
+__auto_type c = &b;
+__auto_type d = (struct {int a;}) {5};
+_Static_assert(__builtin_types_compatible_p(__typeof(a), int), "");
+__auto_type e = e; // expected-error {{variable 'e' declared with '__auto_type' type cannot appear in its own initializer}}
+
+struct s { __auto_type a; }; // expected-error {{'__auto_type' not allowed in struct member}}
+
+__auto_type f = 1, g = 1.0; // expected-error {{'__auto_type' deduced as 'int' in declaration of 'f' and deduced as 'double' in declaration of 'g'}}
+
+__auto_type h() {} // expected-error {{'__auto_type' not allowed in function return type}}
+
+int i() {
+  struct bitfield { int field:2; };
+  __auto_type j = (struct bitfield){1}.field; // expected-error {{cannot pass 

Re: [PATCH] D12686: Add support for GCC's '__auto_type' extension.

2015-11-10 Thread Nicholas Allegra via cfe-commits
comex added a comment.

Addressed comments.  Thanks, rsmith!



Comment at: lib/Sema/SemaType.cpp:3756-3760
@@ -3743,2 +3755,7 @@
   }
+} else if (D.getDeclSpec().getTypeSpecType() == 
DeclSpec::TST_auto_type) {
+  S.Diag(D.getDeclSpec().getTypeSpecTypeLoc(),
+ diag::err_auto_not_allowed)
+<< 2 << 13 << D.getDeclSpec().getSourceRange();
+  D.setInvalidType(true);
 }

rsmith wrote:
> Please deal with this in the "checking for auto" block at the top rather than 
> repeating the diagnostic code here with magic numbers; maybe change
> 
>   (!SemaRef.getLangOpts().CPlusPlus11 || !D.isFunctionDeclarator())) {
> 
> to
> 
>   (!SemaRef.getLangOpts().CPlusPlus11 || !D.isFunctionDeclarator() || 
> D.getDeclSpec().getTypeSpecType() == DeclSpec::TST_auto_type)) {
> 
> up there.
For the sake of clarity, I removed that whole bit from the if condition instead 
and moved the C++11 test down to where it sets `Error`.  Two bits of fallout 
from this:
- `typedef decltype(auto) f();` gets diagnosed there rather than later with a 
different error; I updated the test, since both errors seem reasonable.
- A bug is fixed where definitions like `auto f() { return 5; }` were not being 
caught with `-std=c++14 -Wc++98-compat`.  I updated the c++98-compat test to 
add this case.


http://reviews.llvm.org/D12686



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


r252640 - Add the variant of __sparc_v9__ with five underscores, not just four.

2015-11-10 Thread Joerg Sonnenberger via cfe-commits
Author: joerg
Date: Tue Nov 10 13:28:17 2015
New Revision: 252640

URL: http://llvm.org/viewvc/llvm-project?rev=252640&view=rev
Log:
Add the variant of __sparc_v9__ with five underscores, not just four.

Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/Preprocessor/predefined-arch-macros.c

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=252640&r1=252639&r2=252640&view=diff
==
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Tue Nov 10 13:28:17 2015
@@ -5949,8 +5949,10 @@ public:
   break;
 case CG_V9:
   Builder.defineMacro("__sparcv9");
-  if (getTriple().getOS() != llvm::Triple::Solaris)
+  if (getTriple().getOS() != llvm::Triple::Solaris) {
 Builder.defineMacro("__sparcv9__");
+Builder.defineMacro("__sparc_v9__");
+  }
   break;
 }
   }

Modified: cfe/trunk/test/Preprocessor/predefined-arch-macros.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/predefined-arch-macros.c?rev=252640&r1=252639&r2=252640&view=diff
==
--- cfe/trunk/test/Preprocessor/predefined-arch-macros.c (original)
+++ cfe/trunk/test/Preprocessor/predefined-arch-macros.c Tue Nov 10 13:28:17 
2015
@@ -1749,10 +1749,13 @@
 // CHECK_SPARC: #define __sparc 1
 // CHECK_SPARC: #define __sparc__ 1
 // CHECK_SPARC-NOT: #define __sparcv9 1
+// CHECK_SPARC-NOT: #define __sparcv9__ 1
 // CHECK_SPARC: #define __sparcv8 1
 // CHECK_SPARC-NOT: #define __sparcv9 1
+// CHECK_SPARC-NOT: #define __sparcv9__ 1
 
 // CHECK_SPARC-V9-NOT: #define __sparcv8 1
+// CHECK_SPARC-V9: #define __sparc_v9__ 1
 // CHECK_SPARC-V9: #define __sparcv9 1
 // CHECK_SPARC-V9-NOT: #define __sparcv8 1
 


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


Re: [PATCH] D12906: [RFC] Bug identification("issue_hash") change for CmpRuns.py

2015-11-10 Thread Anna Zaks via cfe-commits
zaks.anna added a comment.

Please, move the conversation on how to configure/use CodeChecker in the 
particular setting elsewhere. I think it could be useful to the clang dev list; 
however, this patch review is not the proper place for it.


http://reviews.llvm.org/D12906



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


Re: [PATCH] D14471: [AArch64] Fix a crash in driver

2015-11-10 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment.

I think I understand some of your concerns, but I'm not sure I fully understand 
what you are suggesting.

I think I can use macro __aarch64__ to have getAArch64TargetCPU return "native" 
when the compiler is not run on an AArch64 platform, but it doesn't sound like 
that was what you had in mind?

if (CPU == "native")
#ifdef __aarch64__

  return llvm::sys::getHostCPUName();

#else

  return "native"; // or "return CPU"

#endif

This requires fewer changes than the patch I proposed and it will print 
"native" in the error message, which is what I am looking for.


http://reviews.llvm.org/D14471



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


Re: [PATCH] D10305: [Clang Static Analyzer] Bug identification

2015-11-10 Thread Anna Zaks via cfe-commits
zaks.anna added a comment.

> This makes forwards compatibility difficult, since there is no way to predict 
> the names of future hashes

>  (As far as I understand).


Can you describe what you are trying to achieve?

We can agree that all issue hashes start with "issue_hash" prefix. If you find 
an entry with "issue_hash" prefix and unknown suffix, you would know that it's 
new. It would be the same as a number you have not seen so far. What do you 
plan to do when a new hash is detected?

The reason I like names more than the numbers is that we may use different 
solutions for issue hash generation and some users might prefer one over the 
other. It is not necessarily clear which one is the best. Numbers would 
obfuscate the heuristic used to produce the hash and the quality of the hash 
and would be mainly based on the time when the hash was introduced.

> A third alternative would be to have both semantic names (containing hash) 
> and a number suffix

>  which indicates the ordering.


If there is a minor enhancement to the existing issue hash method, appending 
the version number to it is fine by me. Though, this might be confusing in it's 
own right..


http://reviews.llvm.org/D10305



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


Re: r252474 - Create install targets for scan-build and scan-view

2015-11-10 Thread Tobias Grosser via cfe-commits

On 11/09/2015 05:12 PM, Jonathan Roelofs via cfe-commits wrote:

Author: jroelofs
Date: Mon Nov  9 10:12:56 2015
New Revision: 252474

URL: http://llvm.org/viewvc/llvm-project?rev=252474&view=rev
Log:
Create install targets for scan-build and scan-view


Hi Jonathan,

this is probably not the commit that introduced this specific issue, but 
since updating today my cmake ninja builds always run:


"[2/2] Running utility command for scan-view"

even without me changing any files. Before ninja would just report that
no work needs to be done. I assume this change is related to some of the
recent scan-view change and was likely unintended.

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


[PATCH] D14548: Make test/Driver/biarch.c use FileCheck instead of grep

2015-11-10 Thread A. Skrobov via cfe-commits
tyomitch created this revision.
tyomitch added reviewers: joerg, rengolin, dougk, yaron.keren.
tyomitch added a subscriber: cfe-commits.

For clarity and ease of maintenance, I suggest porting this test
to use the same tooling as the rest of the tests.

http://reviews.llvm.org/D14548

Files:
  test/Driver/biarch.c

Index: test/Driver/biarch.c
===
--- test/Driver/biarch.c
+++ test/Driver/biarch.c
@@ -1,44 +1,32 @@
-// RUN: %clang -target i386--netbsd -m32 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "i386--netbsd"' %t
+// RUN: %clang -target i386--netbsd -m32 %s -### 2>&1 | FileCheck 
-check-prefix=I386 %s
+// RUN: %clang -target x86_64--netbsd -m32 %s -### 2>&1 | FileCheck 
-check-prefix=I386 %s
+// I386: "-cc1" "-triple" "i386--netbsd"
 
-// RUN: %clang -target i386--netbsd -m64 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "x86_64--netbsd"' %t
+// RUN: %clang -target i386--netbsd -m64 %s -### 2>&1 | FileCheck 
-check-prefix=X86_64 %s
+// RUN: %clang -target x86_64--netbsd -m64 %s -### 2>&1 | FileCheck 
-check-prefix=X86_64 %s
+// X86_64: "-cc1" "-triple" "x86_64--netbsd"
 
-// RUN: %clang -target x86_64--netbsd -m32 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "i386--netbsd"' %t
+// RUN: %clang -target armv6--netbsd-eabihf -m32 %s -### 2>&1 | FileCheck 
-check-prefix=ARMV6 %s
+// ARMV6: "-cc1" "-triple" "armv6k--netbsd-eabihf"
 
-// RUN: %clang -target x86_64--netbsd -m64 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "x86_64--netbsd"' %t
+// RUN: %clang -target sparcv9--netbsd -m32 %s -### 2>&1 | FileCheck 
-check-prefix=SPARC %s
+// RUN: %clang -target sparc--netbsd -m32 %s -### 2>&1 | FileCheck 
-check-prefix=SPARC %s
+// SPARC: "-cc1" "-triple" "sparc--netbsd"
 
-// RUN: %clang -target armv6--netbsd-eabihf -m32 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "armv6k--netbsd-eabihf"' %t
+// RUN: %clang -target sparcv9--netbsd -m64 %s -### 2>&1 | FileCheck 
-check-prefix=SPARCV9 %s
+// RUN: %clang -target sparc--netbsd -m64 %s -### 2>&1 | FileCheck 
-check-prefix=SPARCV9 %s
+// SPARCV9: "-cc1" "-triple" "sparcv9--netbsd"
 
-// RUN: %clang -target sparcv9--netbsd -m32 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "sparc--netbsd"' %t
+// RUN: %clang -target sparc64--netbsd -m64 %s -### 2>&1 | FileCheck 
-check-prefix=SPARC64 %s
+// SPARC64: "-cc1" "-triple" "sparc64--netbsd"
 
-// RUN: %clang -target sparcv9--netbsd -m64 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "sparcv9--netbsd"' %t
+// RUN: %clang -target sparcel -o foo %s -### 2>&1 | FileCheck 
-check-prefix=SPARCEL %s
+// SPARCEL: gcc{{(\.exe)?}}" "-EL" "-o" "foo"
 
-// RUN: %clang -target sparc64--netbsd -m64 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "sparc64--netbsd"' %t
+// RUN: %clang -target mips64--netbsd -m32 %s -### 2>&1 | FileCheck 
-check-prefix=MIPS %s
+// RUN: %clang -target mips--netbsd -m32 %s -### 2>&1 | FileCheck 
-check-prefix=MIPS %s
+// MIPS: "-cc1" "-triple" "mips--netbsd"
 
-// RUN: %clang -target sparc--netbsd -m32 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "sparc--netbsd"' %t
-
-// RUN: %clang -target sparc--netbsd -m64 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "sparcv9--netbsd"' %t
-
-// RUN: %clang -target sparcel -o foo %s -### 2> %t
-// RUN: grep 'gcc\(\.exe\)\?" "-EL" "-o" "foo"' %t
-
-// RUN: %clang -target mips64--netbsd -m32 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "mips--netbsd"' %t
-
-// RUN: %clang -target mips64--netbsd -m64 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "mips64--netbsd"' %t
-
-// RUN: %clang -target mips--netbsd -m32 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "mips--netbsd"' %t
-
-// RUN: %clang -target mips--netbsd -m64 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "mips64--netbsd"' %t
+// RUN: %clang -target mips64--netbsd -m64 %s -### 2>&1 | FileCheck 
-check-prefix=MIPS64 %s
+// RUN: %clang -target mips--netbsd -m64 %s -### 2>&1 | FileCheck 
-check-prefix=MIPS64 %s
+// MIPS64: "-cc1" "-triple" "mips64--netbsd"


Index: test/Driver/biarch.c
===
--- test/Driver/biarch.c
+++ test/Driver/biarch.c
@@ -1,44 +1,32 @@
-// RUN: %clang -target i386--netbsd -m32 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "i386--netbsd"' %t
+// RUN: %clang -target i386--netbsd -m32 %s -### 2>&1 | FileCheck -check-prefix=I386 %s
+// RUN: %clang -target x86_64--netbsd -m32 %s -### 2>&1 | FileCheck -check-prefix=I386 %s
+// I386: "-cc1" "-triple" "i386--netbsd"
 
-// RUN: %clang -target i386--netbsd -m64 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "x86_64--netbsd"' %t
+// RUN: %clang -target i386--netbsd -m64 %s -### 2>&1 | FileCheck -check-prefix=X86_64 %s
+// RUN: %clang -target x86_64--netbsd -m64 %s -### 2>&1 | FileCheck -check-prefix=X86_64 %s
+// X86_64: "-cc1" "-triple" "x86_64--netbsd"
 
-// RUN: %clang -target x86_64--netbsd -m32 %s -### 2> %t
-// RUN: grep '"-cc1" "-triple" "i386--netbsd"' %t
+// RUN: %clang -target armv6--netbsd-eabihf -m32 %s -### 2>&1 | FileChec

[PATCH] D14480

2015-11-10 Thread Yunlian Jiang via cfe-commits
http://reviews.llvm.org/D14480

This tries to improve the compilation time of the test case in
https://llvm.org/bugs/show_bug.cgi?id=25416

The problem is that when trying to get the SrcLocInfo for asm, it
tries to get the SrcLoc for each
line inside the asm string. For each line, it goes through the token
table once. This is not optimal,
we can find the SrcLoc for all the lines of the asm with a single scan
of the token table. To do this,
we need to store the information of the location of current token and
the total size of token been
processed.

Index: include/clang/AST/Expr.h
===
--- include/clang/AST/Expr.h
+++ include/clang/AST/Expr.h
@@ -1611,7 +1611,10 @@
   ///
   SourceLocation getLocationOfByte(unsigned ByteNo, const SourceManager &SM,
const LangOptions &Features,
-   const TargetInfo &Target) const;
+   const TargetInfo &Target,
+   unsigned * StartToken=nullptr,
+   unsigned * ByteOffset=nullptr
+   ) const;

   typedef const SourceLocation *tokloc_iterator;
   tokloc_iterator tokloc_begin() const { return TokLocs; }
Index: lib/AST/Expr.cpp
===
--- lib/AST/Expr.cpp
+++ lib/AST/Expr.cpp
@@ -1009,13 +1009,21 @@
 ///
 SourceLocation StringLiteral::
 getLocationOfByte(unsigned ByteNo, const SourceManager &SM,
-  const LangOptions &Features, const TargetInfo
&Target) const {
+  const LangOptions &Features, const TargetInfo &Target,
+  unsigned * StartToken, unsigned * ByteOffset) const {
   assert((Kind == StringLiteral::Ascii || Kind == StringLiteral::UTF8) &&
  "Only narrow string literals are currently supported");

   // Loop over all of the tokens in this string until we find the one that
   // contains the byte we're looking for.
   unsigned TokNo = 0;
+  unsigned StringOffset = 0;
+  if (StartToken)
+TokNo = *StartToken;
+  if (ByteOffset){
+StringOffset = *ByteOffset;
+ByteNo -= StringOffset;
+  }
   while (1) {
 assert(TokNo < getNumConcatenated() && "Invalid byte number!");
 SourceLocation StrTokLoc = getStrTokenLoc(TokNo);
@@ -1029,8 +1037,13 @@
 std::pair LocInfo
=SM.getDecomposedLoc(StrTokSpellingLoc);
 bool Invalid = false;
 StringRef Buffer = SM.getBufferData(LocInfo.first, &Invalid);
-if (Invalid)
+if (Invalid) {
+  if (ByteOffset != nullptr)
+*ByteOffset = StringOffset;
+  if (StartToken != nullptr)
+*StartToken = TokNo;
   return StrTokSpellingLoc;
+}

 const char *StrData = Buffer.data()+LocInfo.second;

@@ -1051,10 +1064,15 @@

   // Now that we know the offset of the token in the spelling, use the
   // preprocessor to get the offset in the original source.
+  if (ByteOffset != nullptr)
+*ByteOffset = StringOffset;
+  if (StartToken != nullptr)
+*StartToken = TokNo;
   return Lexer::AdvanceToTokenCharacter(StrTokLoc, Offset, SM, Features);
 }

 // Move to the next string token.
+StringOffset += TokNumBytes;
 ++TokNo;
 ByteNo -= TokNumBytes;
   }
Index: lib/CodeGen/CGStmt.cpp
===
--- lib/CodeGen/CGStmt.cpp
+++ lib/CodeGen/CGStmt.cpp
@@ -1707,13 +1707,17 @@
   if (!StrVal.empty()) {
 const SourceManager &SM = CGF.CGM.getContext().getSourceManager();
 const LangOptions &LangOpts = CGF.CGM.getLangOpts();
+unsigned StartToken = 0;
+unsigned ByteOffset = 0;

 // Add the location of the start of each subsequent line of the asm to the
 // MDNode.
 for (unsigned i = 0, e = StrVal.size()-1; i != e; ++i) {
   if (StrVal[i] != '\n') continue;
   SourceLocation LineLoc = Str->getLocationOfByte(i+1, SM, LangOpts,
-  CGF.getTarget());
+  CGF.getTarget(),
+  &StartToken,
+  &ByteOffset);
   Locs.push_back(llvm::ConstantAsMetadata::get(
   llvm::ConstantInt::get(CGF.Int32Ty, LineLoc.getRawEncoding(;
 }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r252641 - Fix missing CMake dependency introduced in r252474

2015-11-10 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Tue Nov 10 14:01:22 2015
New Revision: 252641

URL: http://llvm.org/viewvc/llvm-project?rev=252641&view=rev
Log:
Fix missing CMake dependency introduced in r252474

Modified:
cfe/trunk/tools/scan-build/CMakeLists.txt
cfe/trunk/tools/scan-view/CMakeLists.txt

Modified: cfe/trunk/tools/scan-build/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/CMakeLists.txt?rev=252641&r1=252640&r2=252641&view=diff
==
--- cfe/trunk/tools/scan-build/CMakeLists.txt (original)
+++ cfe/trunk/tools/scan-build/CMakeLists.txt Tue Nov 10 14:01:22 2015
@@ -35,7 +35,8 @@ if(CLANG_INSTALL_SCANBUILD)
  ${CMAKE_BINARY_DIR}/bin
COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile}
- ${CMAKE_BINARY_DIR}/bin/)
+ ${CMAKE_BINARY_DIR}/bin/
+   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile})
 install(PROGRAMS ${BinFile} DESTINATION bin)
   endforeach()
 
@@ -45,7 +46,8 @@ if(CLANG_INSTALL_SCANBUILD)
  ${CMAKE_BINARY_DIR}/libexec
COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_CURRENT_SOURCE_DIR}/${LibexecFile}
- ${CMAKE_BINARY_DIR}/libexec/)
+ ${CMAKE_BINARY_DIR}/libexec/
+   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${LibexecFile})
 install(PROGRAMS ${LibexecFile} DESTINATION libexec)
   endforeach()
 
@@ -55,7 +57,8 @@ if(CLANG_INSTALL_SCANBUILD)
  ${CMAKE_BINARY_DIR}/share/man/man1
COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_CURRENT_SOURCE_DIR}/${ManPage}
- ${CMAKE_BINARY_DIR}/share/man/man1/)
+ ${CMAKE_BINARY_DIR}/share/man/man1/
+   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ManPage})
 install(PROGRAMS ${ManPage} DESTINATION share/man/man1)
   endforeach()
 
@@ -65,7 +68,8 @@ if(CLANG_INSTALL_SCANBUILD)
  ${CMAKE_BINARY_DIR}/bin
COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_CURRENT_SOURCE_DIR}/${ResourceFile}
- ${CMAKE_BINARY_DIR}/bin/)
+ ${CMAKE_BINARY_DIR}/bin/
+   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ResourceFile})
 install(FILES ${ResourceFile} DESTINATION bin)
   endforeach()
 endif()

Modified: cfe/trunk/tools/scan-view/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-view/CMakeLists.txt?rev=252641&r1=252640&r2=252641&view=diff
==
--- cfe/trunk/tools/scan-view/CMakeLists.txt (original)
+++ cfe/trunk/tools/scan-view/CMakeLists.txt Tue Nov 10 14:01:22 2015
@@ -20,7 +20,8 @@ if(CLANG_INSTALL_SCANVIEW)
  ${CMAKE_BINARY_DIR}/bin
COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile}
- ${CMAKE_BINARY_DIR}/bin/)
+ ${CMAKE_BINARY_DIR}/bin/
+   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile})
 install(PROGRAMS ${BinFile} DESTINATION bin)
   endforeach()
 
@@ -30,7 +31,8 @@ if(CLANG_INSTALL_SCANVIEW)
  ${CMAKE_BINARY_DIR}/share/scan-view
COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_CURRENT_SOURCE_DIR}/${ResourceFile}
- ${CMAKE_BINARY_DIR}/share/scan-view/)
+ ${CMAKE_BINARY_DIR}/share/scan-view/
+   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ResourceFile})
 install(FILES ${ResourceFile} DESTINATION share/scan-view)
   endforeach()
 endif()


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


Re: [PATCH] D14134: [OpenMP] Parsing and sema support for map clause

2015-11-10 Thread Alexey Bataev via cfe-commits
ABataev added inline comments.


Comment at: include/clang/AST/OpenMPClause.h:2628
@@ +2627,3 @@
+  friend class OMPClauseWriter;
+  friend class Sema;
+

I don't like the idea of friend Sema. If Sema needs some interfaces, they must 
be public.


Comment at: include/clang/Basic/OpenMPKinds.h:83
@@ +82,3 @@
+enum OpenMPMapClauseKind {
+  OMPC_MAP_unknown = 0,
+#define OPENMP_MAP_KIND(Name) \

This must be the last element in enum.


Comment at: include/clang/Basic/OpenMPKinds.h:87
@@ +86,3 @@
+#include "clang/Basic/OpenMPKinds.def"
+  NUM_OPENMP_MAP_KIND
+};

Remove this one, it is not required


Comment at: include/clang/Sema/Sema.h:8013-8014
@@ -8013,1 +8012,4 @@
+  OpenMPLinearClauseKind LinKind, OpenMPMapClauseKind MapTypeModifier,
+  OpenMPMapClauseKind MapType, SourceLocation DepLinLoc,
+  SourceLocation MapLoc);
   /// \brief Called on well-formed 'private' clause.

I think DepLinLoc and MapLoc can joined into one argument, like DepLinMapLoc


Comment at: lib/AST/StmtPrinter.cpp:853-854
@@ +852,4 @@
+}
+OS << getOpenMPSimpleClauseTypeName(OMPC_map, Node->getMapType());
+OS << ':';
+

I think MapType can be optional, just like MapTypeModifier


Comment at: lib/AST/StmtPrinter.cpp:856-858
@@ +855,5 @@
+
+for (OMPMapClause::varlist_iterator I = Node->varlist_begin(),
+E = Node->varlist_end();
+ I != E; ++I) {
+  OS << (I == Node->varlist_begin() ? ' ' : ',')

Better to use ranged for, if possible


Comment at: lib/Parse/ParseOpenMP.cpp:780-781
@@ -772,2 +779,4 @@
+  bool UnexpectedId = false;
   SourceLocation DepLinLoc;
+  SourceLocation MapLoc;
 

These two can be joined


Comment at: lib/Sema/SemaOpenMP.cpp:7482-7484
@@ +7481,5 @@
+  bool IsCorrect = true;
+  for (DeclContext::decl_iterator I = DC->noload_decls_begin(),
+  E = DC->noload_decls_end();
+   I != E; ++I) {
+if (*I) {

Use ranged loop and do not use noload version.


Comment at: lib/Sema/SemaOpenMP.cpp:7503-7505
@@ +7502,5 @@
+  }
+  for (CXXRecordDecl::base_class_iterator I = RD->bases_begin(),
+  E = RD->bases_end();
+   I != E; ++I) {
+if (!IsCXXRecordForMappable(SemaRef, I->getLocStart(), Stack,

Ranged loop


Comment at: lib/Sema/SemaOpenMP.cpp:7507-7509
@@ +7506,5 @@
+if (!IsCXXRecordForMappable(SemaRef, I->getLocStart(), Stack,
+I->getType()->getAsCXXRecordDecl())) {
+  IsCorrect = false;
+}
+  }

Braces are not needed


Comment at: lib/Sema/SemaOpenMP.cpp:7522-7524
@@ +7521,5 @@
+if (!RD->isInvalidDecl() &&
+!IsCXXRecordForMappable(SemaRef, SL, Stack, RD)) {
+  return false;
+}
+  }

Extra braces


Comment at: lib/Sema/SemaOpenMP.cpp:7636-7638
@@ +7635,5 @@
+if (!CheckTypeMappable(VE->getExprLoc(), VE->getSourceRange(), *this,
+   DSAStack, Type)) {
+  continue;
+}
+

Extra braces


Comment at: test/OpenMP/target_map_messages.cpp:1
@@ +1,2 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+

Tests for templates, serialization/deserialization, AST printing, region nesting


http://reviews.llvm.org/D14134



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


Re: r252474 - Create install targets for scan-build and scan-view

2015-11-10 Thread Jonathan Roelofs via cfe-commits



On 11/10/15 12:48 PM, Tobias Grosser wrote:

On 11/09/2015 05:12 PM, Jonathan Roelofs via cfe-commits wrote:

Author: jroelofs
Date: Mon Nov  9 10:12:56 2015
New Revision: 252474

URL: http://llvm.org/viewvc/llvm-project?rev=252474&view=rev
Log:
Create install targets for scan-build and scan-view


Hi Jonathan,

this is probably not the commit that introduced this specific issue, but
since updating today my cmake ninja builds always run:

"[2/2] Running utility command for scan-view"

even without me changing any files. Before ninja would just report that
no work needs to be done. I assume this change is related to some of the
recent scan-view change and was likely unintended.


Can you please try out r252641? I think that should fix what you're seeing.


Jon



Best,
Tobias


--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r252474 - Create install targets for scan-build and scan-view

2015-11-10 Thread Tobias Grosser via cfe-commits

On 11/10/2015 09:05 PM, Jonathan Roelofs wrote:



On 11/10/15 12:48 PM, Tobias Grosser wrote:

On 11/09/2015 05:12 PM, Jonathan Roelofs via cfe-commits wrote:

Author: jroelofs
Date: Mon Nov  9 10:12:56 2015
New Revision: 252474

URL: http://llvm.org/viewvc/llvm-project?rev=252474&view=rev
Log:
Create install targets for scan-build and scan-view


Hi Jonathan,

this is probably not the commit that introduced this specific issue, but
since updating today my cmake ninja builds always run:

"[2/2] Running utility command for scan-view"

even without me changing any files. Before ninja would just report that
no work needs to be done. I assume this change is related to some of the
recent scan-view change and was likely unintended.


Can you please try out r252641? I think that should fix what you're seeing.


I just updated and see this still. Do you see this with ninja/cmake as well?

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


r252646 - [WebAssembly] Change long double to be quadruple-precision floating point.

2015-11-10 Thread Dan Gohman via cfe-commits
Author: djg
Date: Tue Nov 10 15:01:46 2015
New Revision: 252646

URL: http://llvm.org/viewvc/llvm-project?rev=252646&view=rev
Log:
[WebAssembly] Change long double to be quadruple-precision floating point.

Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/CodeGen/wasm-arguments.c
cfe/trunk/test/Driver/wasm32-unknown-unknown.cpp
cfe/trunk/test/Driver/wasm64-unknown-unknown.cpp
cfe/trunk/test/Preprocessor/init.c

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=252646&r1=252645&r2=252646&view=diff
==
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Tue Nov 10 15:01:46 2015
@@ -7081,6 +7081,8 @@ public:
 LargeArrayAlign = 128;
 SimdDefaultAlign = 128;
 SigAtomicType = SignedLong;
+LongDoubleWidth = LongDoubleAlign = 128;
+LongDoubleFormat = &llvm::APFloat::IEEEquad;
   }
 
 protected:

Modified: cfe/trunk/test/CodeGen/wasm-arguments.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/wasm-arguments.c?rev=252646&r1=252645&r2=252646&view=diff
==
--- cfe/trunk/test/CodeGen/wasm-arguments.c (original)
+++ cfe/trunk/test/CodeGen/wasm-arguments.c Tue Nov 10 15:01:46 2015
@@ -5,8 +5,8 @@
 
 // Basic argument/attribute tests for WebAssembly
 
-// WEBASSEMBLY32: define void @f0(i32 %i, i32 %j, i64 %k, double %l, double %m)
-// WEBASSEMBLY64: define void @f0(i32 %i, i64 %j, i64 %k, double %l, double %m)
+// WEBASSEMBLY32: define void @f0(i32 %i, i32 %j, i64 %k, double %l, fp128 %m)
+// WEBASSEMBLY64: define void @f0(i32 %i, i64 %j, i64 %k, double %l, fp128 %m)
 void f0(int i, long j, long long k, double l, long double m) {}
 
 typedef struct {

Modified: cfe/trunk/test/Driver/wasm32-unknown-unknown.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/wasm32-unknown-unknown.cpp?rev=252646&r1=252645&r2=252646&view=diff
==
--- cfe/trunk/test/Driver/wasm32-unknown-unknown.cpp (original)
+++ cfe/trunk/test/Driver/wasm32-unknown-unknown.cpp Tue Nov 10 15:01:46 2015
@@ -37,7 +37,7 @@ int align_f = __alignof(float);
 // CHECK: @align_d = global i32 8
 int align_d = __alignof(double);
 
-// CHECK: @align_ld = global i32 8
+// CHECK: @align_ld = global i32 16
 int align_ld = __alignof(long double);
 
 // CHECK: @align_vl = global i32 4
@@ -97,7 +97,7 @@ float check_float() { return 0; }
 // CHECK: double @check_double()
 double check_double() { return 0; }
 
-// CHECK: double @check_longdouble()
+// CHECK: fp128 @check_longdouble()
 long double check_longdouble() { return 0; }
 
 }

Modified: cfe/trunk/test/Driver/wasm64-unknown-unknown.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/wasm64-unknown-unknown.cpp?rev=252646&r1=252645&r2=252646&view=diff
==
--- cfe/trunk/test/Driver/wasm64-unknown-unknown.cpp (original)
+++ cfe/trunk/test/Driver/wasm64-unknown-unknown.cpp Tue Nov 10 15:01:46 2015
@@ -37,7 +37,7 @@ int align_f = __alignof(float);
 // CHECK: @align_d = global i32 8
 int align_d = __alignof(double);
 
-// CHECK: @align_ld = global i32 8
+// CHECK: @align_ld = global i32 16
 int align_ld = __alignof(long double);
 
 // CHECK: @align_vl = global i32 8
@@ -97,7 +97,7 @@ float check_float() { return 0; }
 // CHECK: double @check_double()
 double check_double() { return 0; }
 
-// CHECK: double @check_longdouble()
+// CHECK: fp128 @check_longdouble()
 long double check_longdouble() { return 0; }
 
 }

Modified: cfe/trunk/test/Preprocessor/init.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/init.c?rev=252646&r1=252645&r2=252646&view=diff
==
--- cfe/trunk/test/Preprocessor/init.c (original)
+++ cfe/trunk/test/Preprocessor/init.c Tue Nov 10 15:01:46 2015
@@ -8549,20 +8549,20 @@
 // WEBASSEMBLY32-NEXT:#define __INT_LEAST8_MAX__ 127{{$}}
 // WEBASSEMBLY32-NEXT:#define __INT_LEAST8_TYPE__ signed char{{$}}
 // WEBASSEMBLY32-NEXT:#define __INT_MAX__ 2147483647{{$}}
-// WEBASSEMBLY32-NEXT:#define __LDBL_DECIMAL_DIG__ 17{{$}}
-// WEBASSEMBLY32-NEXT:#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L{{$}}
-// WEBASSEMBLY32-NEXT:#define __LDBL_DIG__ 15{{$}}
-// WEBASSEMBLY32-NEXT:#define __LDBL_EPSILON__ 2.2204460492503131e-16L{{$}}
+// WEBASSEMBLY32-NEXT:#define __LDBL_DECIMAL_DIG__ 36{{$}}
+// WEBASSEMBLY32-NEXT:#define __LDBL_DENORM_MIN__ 
6.47517511943802511092443895822764655e-4966L{{$}}
+// WEBASSEMBLY32-NEXT:#define __LDBL_DIG__ 33{{$}}
+// WEBASSEMBLY32-NEXT:#define __LDBL_EPSILON__ 
1.92592994438723585305597794258492732e-34L{{$}}
 // WEBASSEMBLY32-NEXT:#define __LDBL_HAS_DENORM__ 1{{$}}
 // WEBASSEMBLY32-NEXT:#define __LDBL_HAS_IN

Re: [PATCH] D12686: Add support for GCC's '__auto_type' extension.

2015-11-10 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.

This LGTM, do you have SVN access or would you like someone to commit for you?



Comment at: lib/Sema/SemaType.cpp:2616-2618
@@ -2616,5 +2615,5 @@
   // C++11 [dcl.spec.auto]p5: reject 'auto' if it is not in an allowed context.
   // In C++11, a function declarator using 'auto' must have a trailing return
   // type (this is checked later) and we can skip this. In other languages
   // using auto, we need to check regardless.
   // C++14 In generic lambdas allow 'auto' in their parameters.

This comment is out of date. Delete these three lines?


Comment at: lib/Sema/SemaType.cpp:3767-3771
@@ -3743,7 +3766,7 @@
   }
 }
   }
 
   // C99 6.7.5.3p1: The return type may not be a function or array type.
   // For conversion functions, we'll diagnose this particular error later.
   if ((T->isArrayType() || T->isFunctionType()) &&

Does this change also fix PR25449?


Comment at: test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-1y.cpp:52
@@ -51,3 +51,3 @@
 const decltype(auto) f4(); // expected-error {{'decltype(auto)' cannot be 
combined with other type specifiers}}
-typedef decltype(auto) f5(); // expected-error {{'decltype(auto)' can only be 
used as a return type in a function declaration}}
+typedef decltype(auto) f5(); // expected-error {{'decltype(auto)' not allowed 
in typedef}}
 decltype(auto) ((f6())); // ok

Thanks, this new diagnostic is a lot better :)


http://reviews.llvm.org/D12686



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


Re: [PATCH] D13925: Implement __attribute__((internal_linkage))

2015-11-10 Thread Evgeniy Stepanov via cfe-commits
eugenis closed this revision.
eugenis added a comment.

r252648.
Thanks everyone for the very detailed review!


Repository:
  rL LLVM

http://reviews.llvm.org/D13925



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


r252648 - Implement __attribute__((internal_linkage)).

2015-11-10 Thread Evgeniy Stepanov via cfe-commits
Author: eugenis
Date: Tue Nov 10 15:28:44 2015
New Revision: 252648

URL: http://llvm.org/viewvc/llvm-project?rev=252648&view=rev
Log:
Implement __attribute__((internal_linkage)).

The attrubite is applicable to functions and variables and changes
the linkage of the subject to internal.

This is the same functionality as C-style "static", but applicable to
class methods; and the same as anonymouns namespaces, but can apply
to individual methods of a class.

Following the proposal in
http://lists.llvm.org/pipermail/cfe-dev/2015-October/045580.html

Added:
cfe/trunk/test/CodeGenCXX/attribute_internal_linkage.cpp
cfe/trunk/test/Sema/internal_linkage.c
cfe/trunk/test/SemaCXX/internal_linkage.cpp
Modified:
cfe/trunk/include/clang/Basic/Attr.td
cfe/trunk/include/clang/Basic/AttrDocs.td
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/lib/AST/Decl.cpp
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
cfe/trunk/test/Sema/attr-coldhot.c
cfe/trunk/test/Sema/attr-notail.c

Modified: cfe/trunk/include/clang/Basic/Attr.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=252648&r1=252647&r2=252648&view=diff
==
--- cfe/trunk/include/clang/Basic/Attr.td (original)
+++ cfe/trunk/include/clang/Basic/Attr.td Tue Nov 10 15:28:44 2015
@@ -2132,3 +2132,9 @@ def OMPThreadPrivateDecl : InheritableAt
   let SemaHandler = 0;
   let Documentation = [Undocumented];
 }
+
+def InternalLinkage : InheritableAttr {
+  let Spellings = [GNU<"internal_linkage">, CXX11<"clang", 
"internal_linkage">];
+  let Subjects = SubjectList<[Var, Function, CXXRecord]>;
+  let Documentation = [InternalLinkageDocs];
+}

Modified: cfe/trunk/include/clang/Basic/AttrDocs.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=252648&r1=252647&r2=252648&view=diff
==
--- cfe/trunk/include/clang/Basic/AttrDocs.td (original)
+++ cfe/trunk/include/clang/Basic/AttrDocs.td Tue Nov 10 15:28:44 2015
@@ -1666,6 +1666,15 @@ Marking virtual functions as ``not_tail_
   // not_tail_called on a virtual function is an error.
   [[clang::not_tail_called]] int foo2() override;
 };
+  }];
+}
 
+def InternalLinkageDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+The ``internal_linkage`` attribute changes the linkage type of the declaration 
to internal.
+This is similar to C-style ``static``, but can be used on classes and class 
methods. When applied to a class definition,
+this attribute affects all methods and static data members of that class.
+This can be used to contain the ABI of a C++ library by excluding unwanted 
class methods from the export tables.
   }];
 }

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=252648&r1=252647&r2=252648&view=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Nov 10 15:28:44 
2015
@@ -4085,6 +4085,12 @@ def warn_undefined_inline : Warning<"inl
   InGroup>;
 def note_used_here : Note<"used here">;
 
+def err_internal_linkage_redeclaration : Error<
+  "'internal_linkage' attribute does not appear on the first declaration of 
%0">;
+def warn_internal_linkage_local_storage : Warning<
+  "'internal_linkage' attribute on a non-static local variable is ignored">,
+  InGroup;
+
 def ext_internal_in_extern_inline : ExtWarn<
   "static %select{function|variable}0 %1 is used in an inline function with "
   "external linkage">, InGroup;

Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=252648&r1=252647&r2=252648&view=diff
==
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Tue Nov 10 15:28:44 2015
@@ -2115,6 +2115,11 @@ public:
 unsigned AttrSpellingListIndex);
   OptimizeNoneAttr *mergeOptimizeNoneAttr(Decl *D, SourceRange Range,
   unsigned AttrSpellingListIndex);
+  InternalLinkageAttr *mergeInternalLinkageAttr(Decl *D, SourceRange Range,
+IdentifierInfo *Ident,
+unsigned 
AttrSpellingListIndex);
+  CommonAttr *mergeCommonAttr(Decl *D, SourceRange Range, IdentifierInfo 
*Ident,
+  unsigned AttrSpellingListIndex);
 
   void mergeDeclAttributes(NamedDecl *New, Decl *Old,
AvailabilityMergeKind 

Re: r252474 - Create install targets for scan-build and scan-view

2015-11-10 Thread Jonathan Roelofs via cfe-commits



On 11/10/15 1:35 PM, Tobias Grosser wrote:

On 11/10/2015 09:05 PM, Jonathan Roelofs wrote:



On 11/10/15 12:48 PM, Tobias Grosser wrote:

On 11/09/2015 05:12 PM, Jonathan Roelofs via cfe-commits wrote:

Author: jroelofs
Date: Mon Nov  9 10:12:56 2015
New Revision: 252474

URL: http://llvm.org/viewvc/llvm-project?rev=252474&view=rev
Log:
Create install targets for scan-build and scan-view


Hi Jonathan,

this is probably not the commit that introduced this specific issue, but
since updating today my cmake ninja builds always run:

"[2/2] Running utility command for scan-view"

even without me changing any files. Before ninja would just report that
no work needs to be done. I assume this change is related to some of the
recent scan-view change and was likely unintended.


Can you please try out r252641? I think that should fix what you're
seeing.


I just updated and see this still. Do you see this with ninja/cmake as
well?


I don't normally use Ninja... but looks like my fix didn't work. I don't 
know how to fix this. Any ideas, Chris?



Jon



Best,
Tobias


--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r252474 - Create install targets for scan-build and scan-view

2015-11-10 Thread Chris Bieneman via cfe-commits
Your custom commands don’t have outputs, so ninja doesn’t know when they need 
to run or not.

-Chris

> On Nov 10, 2015, at 2:14 PM, Jonathan Roelofs  
> wrote:
> 
> 
> 
> On 11/10/15 1:35 PM, Tobias Grosser wrote:
>> On 11/10/2015 09:05 PM, Jonathan Roelofs wrote:
>>> 
>>> 
>>> On 11/10/15 12:48 PM, Tobias Grosser wrote:
 On 11/09/2015 05:12 PM, Jonathan Roelofs via cfe-commits wrote:
> Author: jroelofs
> Date: Mon Nov  9 10:12:56 2015
> New Revision: 252474
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=252474&view=rev
> Log:
> Create install targets for scan-build and scan-view
 
 Hi Jonathan,
 
 this is probably not the commit that introduced this specific issue, but
 since updating today my cmake ninja builds always run:
 
 "[2/2] Running utility command for scan-view"
 
 even without me changing any files. Before ninja would just report that
 no work needs to be done. I assume this change is related to some of the
 recent scan-view change and was likely unintended.
>>> 
>>> Can you please try out r252641? I think that should fix what you're
>>> seeing.
>> 
>> I just updated and see this still. Do you see this with ninja/cmake as
>> well?
> 
> I don't normally use Ninja... but looks like my fix didn't work. I don't know 
> how to fix this. Any ideas, Chris?
> 
> 
> Jon
> 
>> 
>> Best,
>> Tobias
> 
> -- 
> Jon Roelofs
> jonat...@codesourcery.com
> CodeSourcery / Mentor Embedded

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


Re: [PATCH] D13351: [Power PC] add soft float support for ppc32

2015-11-10 Thread hfin...@anl.gov via cfe-commits
hfinkel added a comment.

Can you please make sure we produce some sensible error should someone try to 
use soft float with ppc64 (since we don't support that), and add an associated 
test.



Comment at: lib/Driver/Tools.h:739
@@ +738,3 @@
+  Soft,
+  SoftFP,
+  Hard,

We don't seem to support (or even accept) SoftFP. Given that, either remove it 
from the enum or add support for it.


Comment at: lib/Driver/Tools.h:742
@@ +741,3 @@
+};
+   ppc::FloatABI getPPCFloatABI(const Driver &D, const llvm::opt::ArgList 
&Args);
+}

Unindent this and ppc::FloatABI -> FloatABI


http://reviews.llvm.org/D13351



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


r252659 - [COFF] Don't try to emit weak aliases on COFF

2015-11-10 Thread Reid Kleckner via cfe-commits
Author: rnk
Date: Tue Nov 10 16:23:58 2015
New Revision: 252659

URL: http://llvm.org/viewvc/llvm-project?rev=252659&view=rev
Log:
[COFF] Don't try to emit weak aliases on COFF

This comes up when a derived class destructor is equivalent to a base
class destructor defined in the same TU, and we try to alias them.

A COFF weak alias cannot satisfy a normal undefined symbol reference
from another TU. The other TU must also mark the referenced symbol as
weak, and we can't rely on that.

Clang already has a special case here for dllexport, but we failed to
realize that the problem also applies to other non-discardable symbols
such as those from explicit template instantiations.

Fixes PR25477.

Modified:
cfe/trunk/lib/CodeGen/CGCXX.cpp
cfe/trunk/test/CodeGenCXX/microsoft-abi-structors-alias.cpp

Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=252659&r1=252658&r2=252659&view=diff
==
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Tue Nov 10 16:23:58 2015
@@ -131,11 +131,6 @@ bool CodeGenModule::TryEmitDefinitionAsA
   if (!llvm::GlobalAlias::isValidLinkage(Linkage))
 return true;
 
-  // Don't create a weak alias for a dllexport'd symbol.
-  if (AliasDecl.getDecl()->hasAttr() &&
-  llvm::GlobalValue::isWeakForLinker(Linkage))
-return true;
-
   llvm::GlobalValue::LinkageTypes TargetLinkage =
   getFunctionLinkage(TargetDecl);
 
@@ -173,6 +168,16 @@ bool CodeGenModule::TryEmitDefinitionAsA
 return false;
   }
 
+  // If we have a weak, non-discardable alias (weak, weak_odr), like an extern
+  // template instantiation or a dllexported class, avoid forming it on COFF.
+  // A COFF weak external alias cannot satisfy a normal undefined symbol
+  // reference from another TU. The other TU must also mark the referenced
+  // symbol as weak, which we cannot rely on.
+  if (llvm::GlobalValue::isWeakForLinker(Linkage) &&
+  getTriple().isOSBinFormatCOFF()) {
+return true;
+  }
+
   if (!InEveryTU) {
 // If we don't have a definition for the destructor yet, don't
 // emit.  We can't emit aliases to declarations; that's just not

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-structors-alias.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-structors-alias.cpp?rev=252659&r1=252658&r2=252659&view=diff
==
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-structors-alias.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-structors-alias.cpp Tue Nov 10 
16:23:58 2015
@@ -24,3 +24,19 @@ void foo() {
 }
 // CHECK-DAG: @"\01??1B@test2@@UAE@XZ" = alias void (%"struct.test2::B"*), 
bitcast (void (%"struct.test2::A"*)* @"\01??1A@test2@@UAE@XZ" to void 
(%"struct.test2::B"*)*)
 }
+
+namespace test3 {
+struct A { virtual ~A(); };
+A::~A() {}
+}
+// CHECK-DAG: define x86_thiscallcc void @"\01??1A@test3@@UAE@XZ"(
+namespace test3 {
+template 
+struct B : A {
+  virtual ~B() { }
+};
+template struct B;
+}
+// This has to be weak, and emitting weak aliases is fragile, so we don't do 
the
+// aliasing.
+// CHECK-DAG: define weak_odr x86_thiscallcc void @"\01??1?$B@H@test3@@UAE@XZ"(


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


r252662 - Implement the fix that r252641 should have been

2015-11-10 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Tue Nov 10 16:38:59 2015
New Revision: 252662

URL: http://llvm.org/viewvc/llvm-project?rev=252662&view=rev
Log:
Implement the fix that r252641 should have been

Modified:
cfe/trunk/tools/scan-build/CMakeLists.txt
cfe/trunk/tools/scan-view/CMakeLists.txt

Modified: cfe/trunk/tools/scan-build/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/CMakeLists.txt?rev=252662&r1=252661&r2=252662&view=diff
==
--- cfe/trunk/tools/scan-build/CMakeLists.txt (original)
+++ cfe/trunk/tools/scan-build/CMakeLists.txt Tue Nov 10 16:38:59 2015
@@ -1,5 +1,3 @@
-add_custom_target(scan-build ALL)
-
 option(CLANG_INSTALL_SCANBUILD "Install the scan-build tool" ON)
 
 if (WIN32 AND NOT CYGWIN)
@@ -29,47 +27,55 @@ set(ResourceFiles
 
 
 if(CLANG_INSTALL_SCANBUILD)
+  set(Depends )
   foreach(BinFile ${BinFiles})
-add_custom_command(TARGET scan-build PRE_BUILD
+add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/bin/${BinFile}
COMMAND ${CMAKE_COMMAND} -E make_directory
  ${CMAKE_BINARY_DIR}/bin
COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile}
  ${CMAKE_BINARY_DIR}/bin/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile})
+set(Depends ${Depends}  ${CMAKE_BINARY_DIR}/bin/${BinFile})
 install(PROGRAMS ${BinFile} DESTINATION bin)
   endforeach()
 
   foreach(LibexecFile ${LibexecFiles})
-add_custom_command(TARGET scan-build PRE_BUILD
+add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/libexec/${LibexecFile}
COMMAND ${CMAKE_COMMAND} -E make_directory
  ${CMAKE_BINARY_DIR}/libexec
COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_CURRENT_SOURCE_DIR}/${LibexecFile}
  ${CMAKE_BINARY_DIR}/libexec/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${LibexecFile})
+set(Depends ${Depends} ${CMAKE_BINARY_DIR}/libexec/${LibexecFile})
 install(PROGRAMS ${LibexecFile} DESTINATION libexec)
   endforeach()
 
   foreach(ManPage ${ManPages})
-add_custom_command(TARGET scan-build PRE_BUILD
+add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/share/man/man1/${ManPage}
COMMAND ${CMAKE_COMMAND} -E make_directory
  ${CMAKE_BINARY_DIR}/share/man/man1
COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_CURRENT_SOURCE_DIR}/${ManPage}
  ${CMAKE_BINARY_DIR}/share/man/man1/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ManPage})
+set(Depends ${Depends} ${CMAKE_BINARY_DIR}/share/man/man1/${ManPage})
 install(PROGRAMS ${ManPage} DESTINATION share/man/man1)
   endforeach()
 
   foreach(ResourceFile ${ResourceFiles})
-add_custom_command(TARGET scan-build PRE_BUILD
+add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/bin/${ResourceFile}
COMMAND ${CMAKE_COMMAND} -E make_directory
  ${CMAKE_BINARY_DIR}/bin
COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_CURRENT_SOURCE_DIR}/${ResourceFile}
  ${CMAKE_BINARY_DIR}/bin/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ResourceFile})
+set(Depends ${Depends} ${CMAKE_BINARY_DIR}/bin/${ResourceFile})
 install(FILES ${ResourceFile} DESTINATION bin)
   endforeach()
+
+  add_custom_target(scan-build ALL DEPENDS ${Depends})
 endif()
+

Modified: cfe/trunk/tools/scan-view/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-view/CMakeLists.txt?rev=252662&r1=252661&r2=252662&view=diff
==
--- cfe/trunk/tools/scan-view/CMakeLists.txt (original)
+++ cfe/trunk/tools/scan-view/CMakeLists.txt Tue Nov 10 16:38:59 2015
@@ -1,5 +1,3 @@
-add_custom_target(scan-view ALL)
-
 option(CLANG_INSTALL_SCANVIEW "Install the scan-view tool" ON)
 
 set(BinFiles
@@ -9,30 +7,35 @@ set(BinFiles
   startfile.py)
 
 set(ResourceFiles
-  Resources/FileRadar.scpt
-  Resources/GetRadarVersion.scpt
-  Resources/bugcatcher.ico)
+  FileRadar.scpt
+  GetRadarVersion.scpt
+  bugcatcher.ico)
 
 if(CLANG_INSTALL_SCANVIEW)
+  set(Depends )
   foreach(BinFile ${BinFiles})
-add_custom_command(TARGET scan-view PRE_BUILD
+add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/bin/${BinFile}
COMMAND ${CMAKE_COMMAND} -E make_directory
  ${CMAKE_BINARY_DIR}/bin
COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile}
  ${CMAKE_BINARY_DIR}/bin/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${Bin

Re: r252474 - Create install targets for scan-build and scan-view

2015-11-10 Thread Jonathan Roelofs via cfe-commits



On 11/10/15 3:18 PM, Chris Bieneman wrote:

Your custom commands don’t have outputs, so ninja doesn’t know when they need 
to run or not.


Thanks!



-Chris


On Nov 10, 2015, at 2:14 PM, Jonathan Roelofs  wrote:



On 11/10/15 1:35 PM, Tobias Grosser wrote:

On 11/10/2015 09:05 PM, Jonathan Roelofs wrote:



On 11/10/15 12:48 PM, Tobias Grosser wrote:

On 11/09/2015 05:12 PM, Jonathan Roelofs via cfe-commits wrote:

Author: jroelofs
Date: Mon Nov  9 10:12:56 2015
New Revision: 252474

URL: http://llvm.org/viewvc/llvm-project?rev=252474&view=rev
Log:
Create install targets for scan-build and scan-view


Hi Jonathan,

this is probably not the commit that introduced this specific issue, but
since updating today my cmake ninja builds always run:

"[2/2] Running utility command for scan-view"

even without me changing any files. Before ninja would just report that
no work needs to be done. I assume this change is related to some of the
recent scan-view change and was likely unintended.


Can you please try out r252641? I think that should fix what you're
seeing.


I just updated and see this still. Do you see this with ninja/cmake as
well?


I don't normally use Ninja... but looks like my fix didn't work. I don't know 
how to fix this. Any ideas, Chris?


Fixed for real in r252662.


Jon




Jon



Best,
Tobias


--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded




--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r252664 - Implement post-commit review feedback on r252662

2015-11-10 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Tue Nov 10 16:48:11 2015
New Revision: 252664

URL: http://llvm.org/viewvc/llvm-project?rev=252664&view=rev
Log:
Implement post-commit review feedback on r252662

Modified:
cfe/trunk/tools/scan-build/CMakeLists.txt
cfe/trunk/tools/scan-view/CMakeLists.txt

Modified: cfe/trunk/tools/scan-build/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/CMakeLists.txt?rev=252664&r1=252663&r2=252664&view=diff
==
--- cfe/trunk/tools/scan-build/CMakeLists.txt (original)
+++ cfe/trunk/tools/scan-build/CMakeLists.txt Tue Nov 10 16:48:11 2015
@@ -13,8 +13,8 @@ else()
 ccc-analyzer
 c++-analyzer)
   if (APPLE)
-set(BinFiles ${BinFiles}
- set-xcode-analyzer)
+list(APPEND BinFiles
+   set-xcode-analyzer)
   endif()
 endif()
 
@@ -27,7 +27,6 @@ set(ResourceFiles
 
 
 if(CLANG_INSTALL_SCANBUILD)
-  set(Depends )
   foreach(BinFile ${BinFiles})
 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/bin/${BinFile}
COMMAND ${CMAKE_COMMAND} -E make_directory
@@ -36,7 +35,7 @@ if(CLANG_INSTALL_SCANBUILD)
  ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile}
  ${CMAKE_BINARY_DIR}/bin/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile})
-set(Depends ${Depends}  ${CMAKE_BINARY_DIR}/bin/${BinFile})
+list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
 install(PROGRAMS ${BinFile} DESTINATION bin)
   endforeach()
 
@@ -48,7 +47,7 @@ if(CLANG_INSTALL_SCANBUILD)
  ${CMAKE_CURRENT_SOURCE_DIR}/${LibexecFile}
  ${CMAKE_BINARY_DIR}/libexec/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${LibexecFile})
-set(Depends ${Depends} ${CMAKE_BINARY_DIR}/libexec/${LibexecFile})
+list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile})
 install(PROGRAMS ${LibexecFile} DESTINATION libexec)
   endforeach()
 
@@ -60,7 +59,7 @@ if(CLANG_INSTALL_SCANBUILD)
  ${CMAKE_CURRENT_SOURCE_DIR}/${ManPage}
  ${CMAKE_BINARY_DIR}/share/man/man1/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ManPage})
-set(Depends ${Depends} ${CMAKE_BINARY_DIR}/share/man/man1/${ManPage})
+list(APPEND Depends ${CMAKE_BINARY_DIR}/share/man/man1/${ManPage})
 install(PROGRAMS ${ManPage} DESTINATION share/man/man1)
   endforeach()
 
@@ -72,7 +71,7 @@ if(CLANG_INSTALL_SCANBUILD)
  ${CMAKE_CURRENT_SOURCE_DIR}/${ResourceFile}
  ${CMAKE_BINARY_DIR}/bin/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ResourceFile})
-set(Depends ${Depends} ${CMAKE_BINARY_DIR}/bin/${ResourceFile})
+list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${ResourceFile})
 install(FILES ${ResourceFile} DESTINATION bin)
   endforeach()
 

Modified: cfe/trunk/tools/scan-view/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-view/CMakeLists.txt?rev=252664&r1=252663&r2=252664&view=diff
==
--- cfe/trunk/tools/scan-view/CMakeLists.txt (original)
+++ cfe/trunk/tools/scan-view/CMakeLists.txt Tue Nov 10 16:48:11 2015
@@ -12,7 +12,6 @@ set(ResourceFiles
   bugcatcher.ico)
 
 if(CLANG_INSTALL_SCANVIEW)
-  set(Depends )
   foreach(BinFile ${BinFiles})
 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/bin/${BinFile}
COMMAND ${CMAKE_COMMAND} -E make_directory
@@ -21,7 +20,7 @@ if(CLANG_INSTALL_SCANVIEW)
  ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile}
  ${CMAKE_BINARY_DIR}/bin/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile})
-set(Depends ${Depends} ${CMAKE_BINARY_DIR}/bin/${BinFile})
+list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
 install(PROGRAMS ${BinFile} DESTINATION bin)
   endforeach()
 
@@ -33,7 +32,7 @@ if(CLANG_INSTALL_SCANVIEW)
  ${CMAKE_CURRENT_SOURCE_DIR}/Resources/${ResourceFile}
  ${CMAKE_BINARY_DIR}/share/scan-view/
DEPENDS 
${CMAKE_CURRENT_SOURCE_DIR}/Resources/${ResourceFile})
-set(Depends ${Depends} ${CMAKE_BINARY_DIR}/share/scan-view/${ResourceFile})
+list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ResourceFile})
 install(FILES ${ResourceFile} DESTINATION share/scan-view)
   endforeach()
 


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


r252667 - Fix build

2015-11-10 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Tue Nov 10 16:59:18 2015
New Revision: 252667

URL: http://llvm.org/viewvc/llvm-project?rev=252667&view=rev
Log:
Fix build

Modified:
cfe/trunk/tools/scan-view/CMakeLists.txt

Modified: cfe/trunk/tools/scan-view/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-view/CMakeLists.txt?rev=252667&r1=252666&r2=252667&view=diff
==
--- cfe/trunk/tools/scan-view/CMakeLists.txt (original)
+++ cfe/trunk/tools/scan-view/CMakeLists.txt Tue Nov 10 16:59:18 2015
@@ -33,7 +33,7 @@ if(CLANG_INSTALL_SCANVIEW)
  ${CMAKE_BINARY_DIR}/share/scan-view/
DEPENDS 
${CMAKE_CURRENT_SOURCE_DIR}/Resources/${ResourceFile})
 list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ResourceFile})
-install(FILES ${ResourceFile} DESTINATION share/scan-view)
+install(FILES Resources/${ResourceFile} DESTINATION share/scan-view)
   endforeach()
 
   add_custom_target(scan-view ALL DEPENDS ${Depends})


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


r252668 - Define __unsafe_unretained and __autoreleasing in ObjC GC mode.

2015-11-10 Thread John McCall via cfe-commits
Author: rjmccall
Date: Tue Nov 10 17:00:25 2015
New Revision: 252668

URL: http://llvm.org/viewvc/llvm-project?rev=252668&view=rev
Log:
Define __unsafe_unretained and __autoreleasing in ObjC GC mode.

This was an accidental regression from the MRC __weak patch.

Modified:
cfe/trunk/lib/Frontend/InitPreprocessor.cpp
cfe/trunk/test/SemaObjC/gc-attributes.m

Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=252668&r1=252667&r2=252668&view=diff
==
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Tue Nov 10 17:00:25 2015
@@ -867,6 +867,8 @@ static void InitializePredefinedMacros(c
   LangOpts.getGC() != LangOptions::NonGC) {
 Builder.defineMacro("__weak", "__attribute__((objc_gc(weak)))");
 Builder.defineMacro("__strong", "__attribute__((objc_gc(strong)))");
+Builder.defineMacro("__autoreleasing", "");
+Builder.defineMacro("__unsafe_unretained", "");
   } else if (LangOpts.ObjC1) {
 Builder.defineMacro("__weak", "__attribute__((objc_ownership(weak)))");
 Builder.defineMacro("__strong", "__attribute__((objc_ownership(strong)))");

Modified: cfe/trunk/test/SemaObjC/gc-attributes.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/gc-attributes.m?rev=252668&r1=252667&r2=252668&view=diff
==
--- cfe/trunk/test/SemaObjC/gc-attributes.m (original)
+++ cfe/trunk/test/SemaObjC/gc-attributes.m Tue Nov 10 17:00:25 2015
@@ -20,3 +20,7 @@ void test_f1() {
   f1(&a);
   f1(&a2); // expected-warning{{passing 'A *__strong *' to parameter of type 
'A *__weak *' discards qualifiers}} 
 }
+
+// These qualifiers should silently expand to nothing in GC mode.
+void test_unsafe_unretained(__unsafe_unretained id *x) {}
+void test_autoreleasing(__autoreleasing id *x) {}


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


Re: [PATCH] D12686: Add support for GCC's '__auto_type' extension.

2015-11-10 Thread Nicholas Allegra via cfe-commits
comex added a comment.

I don't have SVN access.  If you want to commit it, feel free to remove that 
comment, or else I'll update the diff tomorrow.

I just tried the test case in 25449 and it now gives a proper error rather than 
crashing.  (Though when trying to reduce a test failure I was encountering, I 
did find yet another pre-existing crasher, which doesn't seem to be related to 
the code being changed here.  I should definitely check which of the crashers I 
found have existing bug reports and file the rest.)


http://reviews.llvm.org/D12686



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


[PATCH] D14556: [CUDA] Detect and link with CUDA's libdevice bitcode library.

2015-11-10 Thread Artem Belevich via cfe-commits
tra created this revision.
tra added a reviewer: echristo.
tra added a subscriber: cfe-commits.

This is libdevice-related part extracted from D13170

- added detection of libdevice bitcode file and API to find one appropriate 
for the GPU we're compiling for.
- pass additional cc1 options for linking with detected libdevice bitcode
- added -nocudalib to prevent automatic linking with libdevice
- added test cases to verify new functionality


http://reviews.llvm.org/D14556

Files:
  include/clang/Driver/Options.td
  lib/Driver/ToolChains.cpp
  lib/Driver/ToolChains.h
  test/Driver/Inputs/CUDA/usr/local/cuda/nvvm/libdevice/.keep
  
test/Driver/Inputs/CUDA/usr/local/cuda/nvvm/libdevice/libdevice.compute_20.10.bc
  
test/Driver/Inputs/CUDA/usr/local/cuda/nvvm/libdevice/libdevice.compute_35.10.bc
  test/Driver/cuda-detect.cu

Index: test/Driver/cuda-detect.cu
===
--- test/Driver/cuda-detect.cu
+++ test/Driver/cuda-detect.cu
@@ -8,26 +8,51 @@
 // RUN: %clang -v --target=i386-unknown-linux \
 // RUN:   --sysroot=%S/Inputs/CUDA 2>&1 | FileCheck %s
 // RUN: %clang -v --target=i386-unknown-linux \
+// RUN:   --sysroot=%S/Inputs/CUDA 2>&1 | FileCheck %s
+// RUN: %clang -v --target=i386-unknown-linux \
 // RUN:   --cuda-path=%S/Inputs/CUDA/usr/local/cuda 2>&1 | FileCheck %s
 
-// Verify that CUDA include path gets added
+// Make sure we map libdevice bitcode files to proper GPUs.
+// RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_21 \
+// RUN:   --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
+// RUN:   | FileCheck %s -check-prefix COMMON \
+// RUN: -check-prefix LIBDEVICE -check-prefix LIBDEVICE21
 // RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_35 \
 // RUN:   --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
-// RUN:   | FileCheck %s -check-prefix COMMON -check-prefix CUDAINC
-// Verify that -nocudainc disables CUDA include paths.
+// RUN:   | FileCheck %s -check-prefix COMMON -check-prefix CUDAINC \
+// RUN: -check-prefix LIBDEVICE -check-prefix LIBDEVICE35
+// Verify that -nocudainc prevents adding include path to CUDA headers.
 // RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_35 \
 // RUN:   -nocudainc --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
-// RUN:   | FileCheck %s -check-prefix COMMON -check-prefix NOCUDAINC
+// RUN:   | FileCheck %s -check-prefix COMMON -check-prefix NOCUDAINC \
+// RUN: -check-prefix LIBDEVICE -check-prefix LIBDEVICE35
 // We should not add any CUDA include paths if there's no valid CUDA installation
 // RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_35 \
 // RUN:   --cuda-path=%S/no-cuda-there %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix COMMON -check-prefix NOCUDAINC
 
+// Verify that no options related to bitcode linking are passes if
+// there's no bitcode file.
+// RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_30 \
+// RUN:   --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
+// RUN:   | FileCheck %s -check-prefix COMMON -check-prefix NOLIBDEVICE
+// .. or if we explicitly passed -nocudalib
+// RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_35 \
+// RUN:   -nocudalib --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
+// RUN:   | FileCheck %s -check-prefix COMMON -check-prefix NOLIBDEVICE
+
 // CHECK: Found CUDA installation: {{.*}}/Inputs/CUDA/usr/local/cuda
 // NOCUDA-NOT: Found CUDA installation:
 
 // COMMON: "-triple" "nvptx-nvidia-cuda"
 // COMMON-SAME: "-fcuda-is-device"
+// LIBDEVICE-SAME: "-mlink-cuda-bitcode"
+// NOLIBDEVICE-NOT: "-mlink-cuda-bitcode"
+// LIBDEVICE21-SAME: libdevice.compute_20.10.bc
+// LIBDEVICE35-SAME: libdevice.compute_35.10.bc
+// NOLIBDEVICE-NOT: libdevice.compute_{{.*}}.bc
+// LIBDEVICE-SAME: "-target-feature" "+ptx42"
+// NOLIBDEVICE-NOT: "-target-feature" "+ptx42"
 // CUDAINC-SAME: "-internal-isystem" "{{.*}}/Inputs/CUDA/usr/local/cuda/include"
 // NOCUDAINC-NOT: "-internal-isystem" "{{.*}}/cuda/include"
 // COMMON-SAME: "-x" "cuda"
Index: lib/Driver/ToolChains.h
===
--- lib/Driver/ToolChains.h
+++ lib/Driver/ToolChains.h
@@ -166,6 +166,7 @@
 std::string CudaLibPath;
 std::string CudaLibDevicePath;
 std::string CudaIncludePath;
+llvm::StringMap CudaLibDeviceMap;
 
   public:
 CudaInstallationDetector(const Driver &D) : IsValid(false), D(D) {}
@@ -185,6 +186,9 @@
 /// \brief Get the detected Cuda device library path.
 StringRef getLibDevicePath() const { return CudaLibDevicePath; }
 /// \brief Get libdevice file for given architecture
+StringRef getLibDeviceFile(StringRef Gpu) const {
+  return CudaLibDeviceMap.lookup(Gpu);
+}
   };
 
   CudaInstallationDetector CudaInstallation;
Index: lib/Driver/ToolChains.cpp
===
--- lib/Driver/ToolChains.cpp

Re: [PATCH] D13170: [CUDA] Driver changes to pass flags needed to use detected CUDA installation.

2015-11-10 Thread Artem Belevich via cfe-commits
tra updated the summary for this revision.
tra updated this revision to Diff 39860.
tra added a comment.

Moved libdevice detection and linking into a separate patch 
http://reviews.llvm.org/D14556.


http://reviews.llvm.org/D13170

Files:
  include/clang/Driver/Options.td
  include/clang/Driver/ToolChain.h
  lib/Driver/ToolChain.cpp
  lib/Driver/ToolChains.cpp
  lib/Driver/ToolChains.h
  lib/Driver/Tools.cpp
  lib/Driver/Tools.h
  test/Driver/cuda-detect.cu

Index: test/Driver/cuda-detect.cu
===
--- test/Driver/cuda-detect.cu
+++ test/Driver/cuda-detect.cu
@@ -1,10 +1,34 @@
 // REQUIRES: clang-driver
 // REQUIRES: x86-registered-target
+// REQUIRES: nvptx-registered-target
 //
+// # Check that we properly detect CUDA installation.
 // RUN: %clang -v --target=i386-unknown-linux \
-// RUN:   --sysroot=/tmp/no-cuda-there 2>&1 | FileCheck %s -check-prefix NOCUDA
+// RUN:   --sysroot=%S/no-cuda-there 2>&1 | FileCheck %s -check-prefix NOCUDA
+// RUN: %clang -v --target=i386-unknown-linux \
+// RUN:   --sysroot=%S/Inputs/CUDA 2>&1 | FileCheck %s
 // RUN: %clang -v --target=i386-unknown-linux \
 // RUN:   --cuda-path=%S/Inputs/CUDA/usr/local/cuda 2>&1 | FileCheck %s
 
+// Verify that CUDA include path gets added
+// RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_35 \
+// RUN:   --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
+// RUN:   | FileCheck %s -check-prefix COMMON -check-prefix CUDAINC
+// Verify that -nocudainc disables CUDA include paths.
+// RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_35 \
+// RUN:   -nocudainc --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
+// RUN:   | FileCheck %s -check-prefix COMMON -check-prefix NOCUDAINC
+// We should not add any CUDA include paths if there's no valid CUDA installation
+// RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_35 \
+// RUN:   --cuda-path=%S/no-cuda-there %s 2>&1 \
+// RUN:   | FileCheck %s -check-prefix COMMON -check-prefix NOCUDAINC
+
 // CHECK: Found CUDA installation: {{.*}}/Inputs/CUDA/usr/local/cuda
 // NOCUDA-NOT: Found CUDA installation:
+
+// COMMON: "-triple" "nvptx-nvidia-cuda"
+// COMMON-SAME: "-fcuda-is-device"
+// CUDAINC-SAME: "-internal-isystem" "{{.*}}/Inputs/CUDA/usr/local/cuda/include"
+// NOCUDAINC-NOT: "-internal-isystem" "{{.*}}/cuda/include"
+// COMMON-SAME: "-x" "cuda"
+
Index: lib/Driver/Tools.h
===
--- lib/Driver/Tools.h
+++ lib/Driver/Tools.h
@@ -57,7 +57,8 @@
const Driver &D, const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs,
const InputInfo &Output,
-   const InputInfoList &Inputs) const;
+   const InputInfoList &Inputs,
+   const ToolChain *AuxToolChain) const;
 
   void AddAArch64TargetArgs(const llvm::opt::ArgList &Args,
 llvm::opt::ArgStringList &CmdArgs) const;
Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -278,7 +278,8 @@
 const Driver &D, const ArgList &Args,
 ArgStringList &CmdArgs,
 const InputInfo &Output,
-const InputInfoList &Inputs) const {
+const InputInfoList &Inputs,
+const ToolChain *AuxToolChain) const {
   Arg *A;
 
   CheckPreprocessingOptions(D, Args);
@@ -471,11 +472,20 @@
   addDirectoryList(Args, CmdArgs, "-objcxx-isystem", "OBJCPLUS_INCLUDE_PATH");
 
   // Add C++ include arguments, if needed.
-  if (types::isCXX(Inputs[0].getType()))
+  if (types::isCXX(Inputs[0].getType())) {
 getToolChain().AddClangCXXStdlibIncludeArgs(Args, CmdArgs);
+if (AuxToolChain)
+  AuxToolChain->AddClangCXXStdlibIncludeArgs(Args, CmdArgs);
+  }
 
   // Add system include arguments.
   getToolChain().AddClangSystemIncludeArgs(Args, CmdArgs);
+  if (AuxToolChain)
+  AuxToolChain->AddClangCXXStdlibIncludeArgs(Args, CmdArgs);
+
+  // Add CUDA include arguments, if needed.
+  if (types::isCuda(Inputs[0].getType()))
+getToolChain().AddCudaIncludeArgs(Args, CmdArgs);
 }
 
 // FIXME: Move to target hook.
@@ -3254,8 +3264,8 @@
   CmdArgs.push_back("-triple");
   CmdArgs.push_back(Args.MakeArgString(TripleStr));
 
+  const ToolChain *AuxToolChain = nullptr;
   if (IsCuda) {
-const ToolChain *AuxToolChain;
 if (&getToolChain() == C.getCudaDeviceToolChain())
   AuxToolChain = C.getCudaHostToolChain();
 else if (&getToolChain() == C.getCudaHostToolChain())
@@ -3266,6 +3276,7 @@
   CmdArgs.push_back("-aux-triple");
   CmdArgs.push_back(Args.MakeArgString(AuxToolChain-

[Tests] Making Lit Tests C++11 compatibile

2015-11-10 Thread Li, Charles via cfe-commits
Hello Clang developers,


I am back again with another patch to make Clang Lit tests C++11 compatible.
There are 26 tests in total.
These are mainly diagnostics verifications where C++98/03 and C++11 differ.
I tried to preserve as much coverage as possible.
Unless otherwise stated, these tests have their RUN line expanded to run at: 
default C++ dialect, C++98 and C++11.

Here are the description of what I did with each in the order as they appear in 
the patch.

test/CXX/class.access/class.friend/p2-cxx03.cpp
  Only verify the following diagnostic on C++03 and earlier.
  "non-class friend type 'T' is a C++11 extension"

test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p6.cpp
  Only verify the following diagnostic on C++03 and earlier.
  "explicit conversion functions are a C++11 extension"

test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp
  Only verify the following diagnostic on C++03 and earlier.
  "befriending enumeration type 'enum E' is a C++11 extension"

test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp
  Verify for different diagnostic between C++03 and earlier vs C++11 and later
  C++03: conversion from string literal to 'char *' is deprecated
  C++11: ISO C++11 does not allow conversion from string literal to 'char *'

test/CodeGen/ubsan-type-blacklist.cpp
  Relaxed FileCheck string to accommodate changes in LLVM-IR on actual argument 
type for "bar".
  C++03: %class.Bar* @bar
  C++11: { i8** }* @bar

test/FixIt/fixit-vexing-parse.cpp
  Set this test to always run at C++98.
  C++11 coverage is provided by fixit-vexing-parse-cxx0x.cpp.

test/SemaCXX/addr-of-overloaded-function.cpp
  Only verify the following diagnostic on C++03 and earlier.
  "default template arguments for a function template are a C++11 extension"

test/SemaCXX/const-cast.cpp
  Only verify the following diagnostic on C++03 and earlier.
  "rvalue references are a C++11 extension"

test/SemaCXX/convert-to-bool.cpp
  Only verify the following diagnostic on C++03 and earlier.
  "explicit conversion functions are a C++11 extension"

test/SemaCXX/copy-initialization.cpp
  Only verify the following diagnostic on C++03 and earlier.
  "rvalue references are a C++11 extension"

test/SemaCXX/cxx0x-return-init-list.cpp
  Force this test to always run at C++03 (-std=c++98).
  This test verifies for very basic initializer return support in C++98.
  It checks for the following diagnostic at C++03
  "generalized initializer lists are a C++11 extension"

test/SemaCXX/decltype-crash.cpp
  Force this test to always run at C++03 (-std=c++98).
  This test verifies against decltype crash back in 2009.

test/SemaCXX/gnu-flags.cpp
  Only verify the following diagnostic on C++03 and earlier.
  "in-class initializer for static data member is not a constant expression; 
folding it to a constant is a GNU extension"

test/SemaCXX/invalid-member-expr.cpp
  For code:  pair z = minmax({});
  Empty initializer list is valid in C++11, but since minmax is not defined 
anywhere in the program, compiler issues an error.
  Therefore, in C++03 and earlier, we check for diagnostic: "expected 
expression"
  In C++11 and later, we check for diagnostic: "use of undeclared identifier 
'minmax'"

test/SemaCXX/member-expr.cpp
  In C++11, "template" can be used outside of a template.
  Only verify the following diagnostic on C++03 and earlier.
  "'template' keyword outside of a template"

test/SemaCXX/member-pointer.cpp
  Only verify the following diagnostic on C++03 and earlier.
  "use of enumeration in a nested name specifier is a C++11 extension"

test/SemaCXX/new-array-size-conv.cpp
  Only verify the following two diagnostic on C++03 and earlier.
  "implicit conversion from array size expression of type 'ValueInt' to 
integral type 'int' is a C++11 extension"
  "implicit conversion from array size expression of type 'ValueEnum' to 
enumeration type 'E' is a C++11 extension"

test/SemaCXX/offsetof.cpp
  Force this test to be C++98 only. Test offsetof-0x.cpp exists to verify for 
C++11 behavior
  Diagnostic change
  C++98: warning: offset of on non-POD type
  C++11: warning: offset of on non-standard-layout type

test/SemaCXX/printf-block.cpp
  This test verifies the diagnostic when trying to pass a non-POD struct then 
access its string value.
  C++11 allows passing non-POD objects via va_arg (5.2.2/7). But since the 
object does not have a c_str() method. So the compiler will issue a warning on 
that
  Here are the different diagnostics we verify for.
  C++03: cannot pass non-POD object of type 'HasNoCStr' to variadic block; 
expected type from format string was 'char *'
  C++11: format specifies type 'char *' but the argument has type 'HasNoCStr'

test/SemaCXX/undefined-internal.cpp
  Verify for different diagnostics depending on the dialect.
  C++03: "C++98 requires an accessible copy constructor"
  C++03: "copying parameter of type 'PR9323::(anonymous namespace)::Uncopyable' 
when binding a reference to a temporary would invoke an inaccessible 
constructor in C++98"

Re: [Tests] Making Lit Tests C++11 compatibile

2015-11-10 Thread Richard Smith via cfe-commits
You use this pattern in a few places:

+#if (__cplusplus <= 199711L) // C or C++03 or earlier modes

Please remove the "C or" from the tests that are not actually run in C mode
(most or all of these tests make no sense in C, so the comment is
confusing). Also remove the parens.

Otherwise, this looks good to me, thank you!

On Tue, Nov 10, 2015 at 4:28 PM, Li, Charles via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Hello Clang developers,
>
>
>
>
>
> I am back again with another patch to make Clang Lit tests C++11
> compatible.
>
> There are 26 tests in total.
>
> These are mainly diagnostics verifications where C++98/03 and C++11 differ.
>
> I tried to preserve as much coverage as possible.
>
> Unless otherwise stated, these tests have their RUN line expanded to run
> at: default C++ dialect, C++98 and C++11.
>
>
>
> Here are the description of what I did with each in the order as they
> appear in the patch.
>
>
>
> test/CXX/class.access/class.friend/p2-cxx03.cpp
>
>   Only verify the following diagnostic on C++03 and earlier.
>
>   "non-class friend type 'T' is a C++11 extension"
>
>
>
> test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p6.cpp
>
>   Only verify the following diagnostic on C++03 and earlier.
>
>   "explicit conversion functions are a C++11 extension"
>
>
>
> test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp
>
>   Only verify the following diagnostic on C++03 and earlier.
>
>   "befriending enumeration type 'enum E' is a C++11 extension"
>
>
>
> test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp
>
>   Verify for different diagnostic between C++03 and earlier vs C++11 and
> later
>
>   C++03: conversion from string literal to 'char *' is deprecated
>
>   C++11: ISO C++11 does not allow conversion from string literal to 'char
> *'
>
>
>
> test/CodeGen/ubsan-type-blacklist.cpp
>
>   Relaxed FileCheck string to accommodate changes in LLVM-IR on actual
> argument type for “bar”.
>
>   C++03: %class.Bar* @bar
>
>   C++11: { i8** }* @bar
>
>
>
> test/FixIt/fixit-vexing-parse.cpp
>
>   Set this test to always run at C++98.
>
>   C++11 coverage is provided by fixit-vexing-parse-cxx0x.cpp.
>
>
>
> test/SemaCXX/addr-of-overloaded-function.cpp
>
>   Only verify the following diagnostic on C++03 and earlier.
>
>   "default template arguments for a function template are a C++11
> extension"
>
>
>
> test/SemaCXX/const-cast.cpp
>
>   Only verify the following diagnostic on C++03 and earlier.
>
>   "rvalue references are a C++11 extension"
>
>
>
> test/SemaCXX/convert-to-bool.cpp
>
>   Only verify the following diagnostic on C++03 and earlier.
>
>   "explicit conversion functions are a C++11 extension"
>
>
>
> test/SemaCXX/copy-initialization.cpp
>
>   Only verify the following diagnostic on C++03 and earlier.
>
>   "rvalue references are a C++11 extension"
>
>
>
> test/SemaCXX/cxx0x-return-init-list.cpp
>
>   Force this test to always run at C++03 (-std=c++98).
>
>   This test verifies for very basic initializer return support in C++98.
>
>   It checks for the following diagnostic at C++03
>
>   "generalized initializer lists are a C++11 extension"
>
>
>
> test/SemaCXX/decltype-crash.cpp
>
>   Force this test to always run at C++03 (-std=c++98).
>
>   This test verifies against decltype crash back in 2009.
>
>
>
> test/SemaCXX/gnu-flags.cpp
>
>   Only verify the following diagnostic on C++03 and earlier.
>
>   “in-class initializer for static data member is not a constant
> expression; folding it to a constant is a GNU extension”
>
>
>
> test/SemaCXX/invalid-member-expr.cpp
>
>   For code:  pair z = minmax({});
>
>   Empty initializer list is valid in C++11, but since minmax is not
> defined anywhere in the program, compiler issues an error.
>
>   Therefore, in C++03 and earlier, we check for diagnostic: “expected
> expression”
>
>   In C++11 and later, we check for diagnostic: “use of undeclared
> identifier 'minmax'”
>

I would prefer to add a declaration of 'minmax' to the test, but I'm OK
with this approach too.


> test/SemaCXX/member-expr.cpp
>
>   In C++11, “template” can be used outside of a template.
>
>   Only verify the following diagnostic on C++03 and earlier.
>
>   “'template' keyword outside of a template”
>
>
>
> test/SemaCXX/member-pointer.cpp
>
>   Only verify the following diagnostic on C++03 and earlier.
>
>   "use of enumeration in a nested name specifier is a C++11 extension"
>
>
>
> test/SemaCXX/new-array-size-conv.cpp
>
>   Only verify the following two diagnostic on C++03 and earlier.
>
>   “implicit conversion from array size expression of type 'ValueInt' to
> integral type 'int' is a C++11 extension”
>
>   “implicit conversion from array size expression of type 'ValueEnum' to
> enumeration type 'E' is a C++11 extension”
>
>
>
> test/SemaCXX/offsetof.cpp
>
>   Force this test to be C++98 only. Test offsetof-0x.cpp exists to verify
> for C++11 behavior
>
>   Diagnostic change
>
>   C++98: warning: offset of on non-POD type
>
>   C++11: warning: offset of on non-standard-layou

r252679 - [static analyzer] Don't flag nil storage into NSMutableDictionary.

2015-11-10 Thread Anna Zaks via cfe-commits
Author: zaks
Date: Tue Nov 10 18:49:22 2015
New Revision: 252679

URL: http://llvm.org/viewvc/llvm-project?rev=252679&view=rev
Log:
[static analyzer] Don't flag nil storage into NSMutableDictionary.

This is now allowed and has the behavior of removing the mapping.

Modified:
cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
cfe/trunk/test/Analysis/NSContainers.m

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp?rev=252679&r1=252678&r2=252679&view=diff
==
--- cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp 
(original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp Tue Nov 
10 18:49:22 2015
@@ -307,8 +307,7 @@ void NilArgChecker::checkPreObjCMessage(
   warnIfNilArg(C, msg, /* Arg */1, Class);
 } else if (S == SetObjectForKeyedSubscriptSel) {
   CanBeSubscript = true;
-  Arg = 0;
-  warnIfNilArg(C, msg, /* Arg */1, Class, CanBeSubscript);
+  Arg = 1;
 } else if (S == RemoveObjectForKeySel) {
   Arg = 0;
 }

Modified: cfe/trunk/test/Analysis/NSContainers.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/NSContainers.m?rev=252679&r1=252678&r2=252679&view=diff
==
--- cfe/trunk/test/Analysis/NSContainers.m (original)
+++ cfe/trunk/test/Analysis/NSContainers.m Tue Nov 10 18:49:22 2015
@@ -155,13 +155,12 @@ void testNilArgNSMutableDictionary3(NSMu
 }
 
 void testNilArgNSMutableDictionary5(NSMutableDictionary *d, NSString* key) {
-  d[key] = 0; // expected-warning {{Value stored into 'NSMutableDictionary' 
cannot be nil}}
+  d[key] = 0; // no-warning - removing the mapping for the given key
 }
 void testNilArgNSMutableDictionary6(NSMutableDictionary *d, NSString *key) {
   if (key)
 ;
   d[key] = 0; // expected-warning {{'NSMutableDictionary' key cannot be nil}}
-  // expected-warning@-1 {{Value stored into 'NSMutableDictionary' cannot be 
nil}}
 }
 
 NSDictionary *testNilArgNSDictionary1(NSString* key) {


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


r252688 - N3922: direct-list-initialization of an auto-typed variable no longer deduces a

2015-11-10 Thread Richard Smith via cfe-commits
Author: rsmith
Date: Tue Nov 10 19:36:17 2015
New Revision: 252688

URL: http://llvm.org/viewvc/llvm-project?rev=252688&view=rev
Log:
N3922: direct-list-initialization of an auto-typed variable no longer deduces a
std::initializer_list type. Instead, the list must contain a single element
and the type is deduced from that.

In Clang 3.7, we warned by default on all the cases that would change meaning
due to this change. In Clang 3.8, we will support only the new rules -- per
the request in N3922, this change is applied as a Defect Report against earlier
versions of the C++ standard.

This change is not entirely trivial, because for lambda init-captures we
previously did not track the difference between direct-list-initialization and
copy-list-initialization. The difference was not previously observable, because
the two forms of initialization always did the same thing (the elements of the
initializer list were always copy-initialized regardless of the initialization
style used for the init-capture).

Modified:
cfe/trunk/include/clang/AST/Expr.h
cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/include/clang/Sema/DeclSpec.h
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/lib/Parse/ParseExprCXX.cpp
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/lib/Sema/SemaLambda.cpp
cfe/trunk/lib/Sema/TreeTransform.h
cfe/trunk/test/CXX/drs/dr13xx.cpp
cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp
cfe/trunk/test/Parser/cxx0x-lambda-expressions.cpp
cfe/trunk/test/Parser/objcxx0x-lambda-expressions.mm
cfe/trunk/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
cfe/trunk/test/SemaCXX/cxx1y-init-captures.cpp
cfe/trunk/www/cxx_status.html

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=252688&r1=252687&r2=252688&view=diff
==
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Tue Nov 10 19:36:17 2015
@@ -3817,6 +3817,10 @@ public:
   /// \brief Retrieve the set of initializers.
   Expr **getInits() { return reinterpret_cast(InitExprs.data()); }
 
+  ArrayRef inits() {
+return llvm::makeArrayRef(getInits(), getNumInits());
+  }
+
   const Expr *getInit(unsigned Init) const {
 assert(Init < getNumInits() && "Initializer access out of range!");
 return cast_or_null(InitExprs[Init]);
@@ -4427,6 +4431,10 @@ public:
 
   Expr **getExprs() { return reinterpret_cast(Exprs); }
 
+  ArrayRef exprs() {
+return llvm::makeArrayRef(getExprs(), getNumExprs());
+  }
+
   SourceLocation getLParenLoc() const { return LParenLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
 

Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=252688&r1=252687&r2=252688&view=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Tue Nov 10 19:36:17 
2015
@@ -821,10 +821,6 @@ def warn_cxx98_compat_lambda : Warning<
 def err_lambda_missing_parens : Error<
   "lambda requires '()' before %select{'mutable'|return type|"
   "attribute specifier}0">;
-def warn_init_capture_direct_list_init : Warning<
-  "direct list initialization of a lambda init-capture will change meaning in "
-  "a future version of Clang; insert an '=' to avoid a change in behavior">,
-  InGroup;
 
 // Availability attribute
 def err_expected_version : Error<

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=252688&r1=252687&r2=252688&view=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Nov 10 19:36:17 
2015
@@ -1689,12 +1689,8 @@ def err_auto_var_init_no_expression : Er
 def err_auto_var_init_multiple_expressions : Error<
   "initializer for variable %0 with type %1 contains multiple expressions">;
 def err_auto_var_init_paren_braces : Error<
-  "cannot deduce type for variable %0 with type %1 from "
-  "parenthesized initializer list">;
-def warn_auto_var_direct_list_init : Warning<
-  "direct list initialization of a variable with a deduced type will change "
-  "meaning in a future version of Clang; insert an '=' to avoid a change in "
-  "behavior">, InGroup;
+  "cannot deduce type for variable %1 with type %2 from "
+  "%select{parenthesized|nested}0 initializer list">;
 def err_auto_new_ctor_multiple_expressions : Error<
   "new expression for type %0 contains multiple constructor arguments">;

r252690 - Add support for GCC's '__auto_type' extension, per the GCC manual:

2015-11-10 Thread Richard Smith via cfe-commits
Author: rsmith
Date: Tue Nov 10 20:02:15 2015
New Revision: 252690

URL: http://llvm.org/viewvc/llvm-project?rev=252690&view=rev
Log:
Add support for GCC's '__auto_type' extension, per the GCC manual:
https://gcc.gnu.org/onlinedocs/gcc/Typeof.html

Differences from the GCC extension:
 * __auto_type is also permitted in C++ (but only in places where
   it could appear in C), allowing its use in headers that might
   be shared across C and C++, or used from C++98
 * __auto_type can be combined with a declarator, as with C++ auto
   (for instance, "__auto_type *p")
 * multiple variables can be declared in a single __auto_type
   declaration, with the C++ semantics (the deduced type must be
   the same in each case)

This patch also adds a missing restriction on applying typeof to
a bit-field, which GCC has historically rejected in C (due to
lack of clarity as to whether the operand should be promoted).
The same restriction also applies to __auto_type in C (in both
GCC and Clang).

This also fixes PR25449.

Patch by Nicholas Allegra!

Modified:
cfe/trunk/include/clang/AST/ASTContext.h
cfe/trunk/include/clang/AST/Type.h
cfe/trunk/include/clang/Basic/DiagnosticGroups.td
cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/include/clang/Basic/Specifiers.h
cfe/trunk/include/clang/Basic/TokenKinds.def
cfe/trunk/include/clang/Sema/DeclSpec.h
cfe/trunk/lib/AST/ASTContext.cpp
cfe/trunk/lib/AST/ASTImporter.cpp
cfe/trunk/lib/AST/ItaniumMangle.cpp
cfe/trunk/lib/AST/MicrosoftMangle.cpp
cfe/trunk/lib/AST/Type.cpp
cfe/trunk/lib/AST/TypePrinter.cpp
cfe/trunk/lib/Format/TokenAnnotator.cpp
cfe/trunk/lib/Parse/ParseDecl.cpp
cfe/trunk/lib/Parse/ParseObjc.cpp
cfe/trunk/lib/Parse/ParseTentative.cpp
cfe/trunk/lib/Sema/DeclSpec.cpp
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
cfe/trunk/lib/Sema/SemaType.cpp
cfe/trunk/lib/Sema/TreeTransform.h
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/lib/Serialization/ASTWriter.cpp
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3-1y.cpp
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-1y.cpp
cfe/trunk/test/Sema/bitfield.c
cfe/trunk/test/Sema/exprs.c
cfe/trunk/test/SemaCXX/auto-cxx0x.cpp
cfe/trunk/test/SemaCXX/cxx98-compat.cpp

Modified: cfe/trunk/include/clang/AST/ASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=252690&r1=252689&r2=252690&view=diff
==
--- cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/trunk/include/clang/AST/ASTContext.h Tue Nov 10 20:02:15 2015
@@ -1299,7 +1299,7 @@ public:
  UnaryTransformType::UTTKind UKind) const;
 
   /// \brief C++11 deduced auto type.
-  QualType getAutoType(QualType DeducedType, bool IsDecltypeAuto,
+  QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword,
bool IsDependent) const;
 
   /// \brief C++11 deduction pattern for 'auto' type.

Modified: cfe/trunk/include/clang/AST/Type.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=252690&r1=252689&r2=252690&view=diff
==
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Tue Nov 10 20:02:15 2015
@@ -1210,6 +1210,16 @@ enum RefQualifierKind {
   RQ_RValue
 };
 
+/// Which keyword(s) were used to create an AutoType.
+enum class AutoTypeKeyword {
+  /// \brief auto
+  Auto,
+  /// \brief decltype(auto)
+  DecltypeAuto,
+  /// \brief __auto_type (GNU extension)
+  GNUAutoType
+};
+
 /// The base class of the type hierarchy.
 ///
 /// A central concept with types is that each type always has a canonical
@@ -1428,8 +1438,9 @@ protected:
 
 unsigned : NumTypeBits;
 
-/// Was this placeholder type spelled as 'decltype(auto)'?
-unsigned IsDecltypeAuto : 1;
+/// Was this placeholder type spelled as 'auto', 'decltype(auto)',
+/// or '__auto_type'?  AutoTypeKeyword value.
+unsigned Keyword : 2;
   };
 
   union {
@@ -3902,8 +3913,7 @@ public:
 /// is no deduced type and an auto type is canonical. In the latter case, it is
 /// also a dependent type.
 class AutoType : public Type, public llvm::FoldingSetNode {
-  AutoType(QualType DeducedType, bool IsDecltypeAuto,
-   bool IsDependent)
+  AutoType(QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent)
 : Type(Auto, DeducedType.isNull() ? QualType(this, 0) : DeducedType,
/*Dependent=*/IsDependent, /*InstantiationDependent=*/IsDependent,
/*VariablyModified=*/false,
@@ -3911,13 +3921,18 @@ class AutoType : public Type, public 

Re: [PATCH] D12686: Add support for GCC's '__auto_type' extension.

2015-11-10 Thread Richard Smith via cfe-commits
Committed as r252690.

Could I tempt you to put together a documentation patch for this, and a
change for the release notes?

On Tue, Nov 10, 2015 at 3:06 PM, Nicholas Allegra  wrote:

> comex added a comment.
>
> I don't have SVN access.  If you want to commit it, feel free to remove
> that comment, or else I'll update the diff tomorrow.
>
> I just tried the test case in 25449 and it now gives a proper error rather
> than crashing.  (Though when trying to reduce a test failure I was
> encountering, I did find yet another pre-existing crasher, which doesn't
> seem to be related to the code being changed here.  I should definitely
> check which of the crashers I found have existing bug reports and file the
> rest.)
>
>
> http://reviews.llvm.org/D12686
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r252691 - Fix a FIXME about using std::is_sorted.

2015-11-10 Thread Eric Christopher via cfe-commits
Author: echristo
Date: Tue Nov 10 20:04:08 2015
New Revision: 252691

URL: http://llvm.org/viewvc/llvm-project?rev=252691&view=rev
Log:
Fix a FIXME about using std::is_sorted.

Modified:
cfe/trunk/lib/CodeGen/CGBuiltin.cpp

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=252691&r1=252690&r2=252691&view=diff
==
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Tue Nov 10 20:04:08 2015
@@ -2258,6 +2258,9 @@ struct NeonIntrinsicInfo {
   bool operator<(unsigned RHSBuiltinID) const {
 return BuiltinID < RHSBuiltinID;
   }
+  bool operator<(const NeonIntrinsicInfo &TE) const {
+return BuiltinID < TE.BuiltinID;
+  }
 };
 } // end anonymous namespace
 
@@ -2816,9 +2819,7 @@ findNeonIntrinsicInMap(ArrayRefhttp://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14560: [Clang] Fix Clang-tidy modernize-use-auto in some files in lib/AST; other minor cleanups.

2015-11-10 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko created this revision.
Eugene.Zelenko added reviewers: hans, aaron.ballman.
Eugene.Zelenko added a subscriber: cfe-commits.
Eugene.Zelenko set the repository for this revision to rL LLVM.

I checked this patch on my own build on RHEL 6. Regressions were OK.

Repository:
  rL LLVM

http://reviews.llvm.org/D14560

Files:
  lib/AST/ASTContext.cpp
  lib/AST/ASTImporter.cpp
  lib/AST/CommentSema.cpp
  lib/AST/Decl.cpp
  lib/AST/DeclBase.cpp
  lib/AST/DeclTemplate.cpp
  lib/AST/DeclarationName.cpp
  lib/AST/Expr.cpp

Index: lib/AST/Expr.cpp
===
--- lib/AST/Expr.cpp
+++ lib/AST/Expr.cpp
@@ -1,4 +1,4 @@
-//===--- Expr.cpp - Expression AST Node Implementation ===//
+//===--- Expr.cpp - Expression AST Node Implementation --*- C++ -*-===//
 //
 // The LLVM Compiler Infrastructure
 //
@@ -34,6 +34,7 @@
 #include "llvm/Support/raw_ostream.h"
 #include 
 #include 
+
 using namespace clang;
 
 const CXXRecordDecl *Expr::getBestDynamicClassType() const {
@@ -846,7 +847,7 @@
   void *Mem = C.Allocate(sizeof(StringLiteral)+
  sizeof(SourceLocation)*(NumStrs-1),
  llvm::alignOf());
-  StringLiteral *SL = new (Mem) StringLiteral(Ty);
+  auto *SL = new (Mem) StringLiteral(Ty);
 
   // OPTIMIZE: could allocate this appended to the StringLiteral.
   SL->setString(C,Str,Kind,Pascal);
@@ -864,7 +865,7 @@
   void *Mem = C.Allocate(sizeof(StringLiteral)+
  sizeof(SourceLocation)*(NumStrs-1),
  llvm::alignOf());
-  StringLiteral *SL = new (Mem) StringLiteral(QualType());
+  auto *SL = new (Mem) StringLiteral(QualType());
   SL->CharByteWidth = 0;
   SL->Length = 0;
   SL->NumConcatenated = NumStrs;
@@ -978,19 +979,19 @@
 
   switch(CharByteWidth) {
 case 1: {
-  char *AStrData = new (C) char[Length];
+  auto *AStrData = new (C) char[Length];
   std::memcpy(AStrData,Str.data(),Length*sizeof(*AStrData));
   StrData.asChar = AStrData;
   break;
 }
 case 2: {
-  uint16_t *AStrData = new (C) uint16_t[Length];
+  auto *AStrData = new (C) uint16_t[Length];
   std::memcpy(AStrData,Str.data(),Length*sizeof(*AStrData));
   StrData.asUInt16 = AStrData;
   break;
 }
 case 4: {
-  uint32_t *AStrData = new (C) uint32_t[Length];
+  auto *AStrData = new (C) uint32_t[Length];
   std::memcpy(AStrData,Str.data(),Length*sizeof(*AStrData));
   StrData.asUInt32 = AStrData;
   break;
@@ -1060,8 +1061,6 @@
   }
 }
 
-
-
 /// getOpcodeStr - Turn an Opcode enum value into the punctuation char it
 /// corresponds to, e.g. "sizeof" or "[pre]++".
 StringRef UnaryOperator::getOpcodeStr(Opcode Op) {
@@ -1115,7 +1114,6 @@
   }
 }
 
-
 //===--===//
 // Postfix Operators.
 //===--===//
@@ -1208,7 +1206,7 @@
 
   // Otherwise, we are growing the # arguments.  New an bigger argument array.
   unsigned NumPreArgs = getNumPreArgs();
-  Stmt **NewSubExprs = new (C) Stmt*[NumArgs+PREARGS_START+NumPreArgs];
+  auto **NewSubExprs = new (C) Stmt*[NumArgs+PREARGS_START+NumPreArgs];
   // Copy over args.
   for (unsigned i = 0; i != getNumArgs()+PREARGS_START+NumPreArgs; ++i)
 NewSubExprs[i] = SubExprs[i];
@@ -1404,7 +1402,7 @@
 Size += ASTTemplateKWAndArgsInfo::sizeFor(0);
 
   void *Mem = C.Allocate(Size, llvm::alignOf());
-  MemberExpr *E = new (Mem)
+  auto *E = new (Mem)
   MemberExpr(base, isarrow, OperatorLoc, memberdecl, nameinfo, ty, vk, ok);
 
   if (hasQualOrFound) {
@@ -1749,8 +1747,7 @@
   unsigned PathSize = (BasePath ? BasePath->size() : 0);
   void *Buffer =
 C.Allocate(sizeof(ImplicitCastExpr) + PathSize * sizeof(CXXBaseSpecifier*));
-  ImplicitCastExpr *E =
-new (Buffer) ImplicitCastExpr(T, Kind, Operand, PathSize, VK);
+  auto *E = new (Buffer) ImplicitCastExpr(T, Kind, Operand, PathSize, VK);
   if (PathSize) E->setCastPath(*BasePath);
   return E;
 }
@@ -1762,7 +1759,6 @@
   return new (Buffer) ImplicitCastExpr(EmptyShell(), PathSize);
 }
 
-
 CStyleCastExpr *CStyleCastExpr::Create(const ASTContext &C, QualType T,
ExprValueKind VK, CastKind K, Expr *Op,
const CXXCastPath *BasePath,
@@ -1771,7 +1767,7 @@
   unsigned PathSize = (BasePath ? BasePath->size() : 0);
   void *Buffer =
 C.Allocate(sizeof(CStyleCastExpr) + PathSize * sizeof(CXXBaseSpecifier*));
-  CStyleCastExpr *E =
+  auto *E =
 new (Buffer) CStyleCastExpr(T, VK, K, Op, PathSize, WrittenTy, L, R);
   if (PathSize) E->setCastPath(*BasePath);
   return E;
@@ -2008,7 +2004,6 @@
   return TheBlock->getBody();
 }
 
-
 //===--===//
 // Generic Expression Routines
 //===---

r252693 - Reorder the check strings in test case following r252692.

2015-11-10 Thread Akira Hatanaka via cfe-commits
Author: ahatanak
Date: Tue Nov 10 20:13:36 2015
New Revision: 252693

URL: http://llvm.org/viewvc/llvm-project?rev=252693&view=rev
Log:
Reorder the check strings in test case following r252692.

rdar://problem/19836465

Modified:
cfe/trunk/test/CodeGen/ms-declspecs.c

Modified: cfe/trunk/test/CodeGen/ms-declspecs.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-declspecs.c?rev=252693&r1=252692&r2=252693&view=diff
==
--- cfe/trunk/test/CodeGen/ms-declspecs.c (original)
+++ cfe/trunk/test/CodeGen/ms-declspecs.c Tue Nov 10 20:13:36 2015
@@ -41,4 +41,4 @@ void noalias_caller(int *x) { noalias_ca
 // CHECK: attributes [[NUW]] = { nounwind{{.*}} }
 // CHECK: attributes [[NI]] = { noinline nounwind{{.*}} }
 // CHECK: attributes [[NR]] = { noreturn }
-// CHECK: attributes [[NA]] = { nounwind argmemonly{{.*}} }
+// CHECK: attributes [[NA]] = { argmemonly nounwind{{.*}} }


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


r252697 - [X86] Change pointer type in AVX2 gather builtins to be the scalar type instead of the vector type. This matches gcc and removes extras casts.

2015-11-10 Thread Craig Topper via cfe-commits
Author: ctopper
Date: Tue Nov 10 20:51:18 2015
New Revision: 252697

URL: http://llvm.org/viewvc/llvm-project?rev=252697&view=rev
Log:
[X86] Change pointer type in AVX2 gather builtins to be the scalar type instead 
of the vector type. This matches gcc and removes extras casts.

Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/avx2intrin.h

Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=252697&r1=252696&r2=252697&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Tue Nov 10 20:51:18 2015
@@ -618,23 +618,23 @@ TARGET_BUILTIN(__builtin_ia32_psrlv4di,
 TARGET_BUILTIN(__builtin_ia32_psrlv2di, "V2LLiV2LLiV2LLi", "", "avx2")
 
 // GATHER
-TARGET_BUILTIN(__builtin_ia32_gatherd_pd, "V2dV2dV2dC*V4iV2dIc", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_gatherd_pd256, "V4dV4dV4dC*V4iV4dIc", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_gatherq_pd, "V2dV2dV2dC*V2LLiV2dIc", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_gatherq_pd256, "V4dV4dV4dC*V4LLiV4dIc", "", 
"avx2")
-TARGET_BUILTIN(__builtin_ia32_gatherd_ps, "V4fV4fV4fC*V4iV4fIc", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_gatherd_ps256, "V8fV8fV8fC*V8iV8fIc", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_gatherq_ps, "V4fV4fV4fC*V2LLiV4fIc", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_gatherq_ps256, "V4fV4fV4fC*V4LLiV4fIc", "", 
"avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherd_pd, "V2dV2ddC*V4iV2dIc", "", "avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherd_pd256, "V4dV4ddC*V4iV4dIc", "", "avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherq_pd, "V2dV2ddC*V2LLiV2dIc", "", "avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherq_pd256, "V4dV4ddC*V4LLiV4dIc", "", "avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherd_ps, "V4fV4ffC*V4iV4fIc", "", "avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherd_ps256, "V8fV8ffC*V8iV8fIc", "", "avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherq_ps, "V4fV4ffC*V2LLiV4fIc", "", "avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherq_ps256, "V4fV4ffC*V4LLiV4fIc", "", "avx2")
 
-TARGET_BUILTIN(__builtin_ia32_gatherd_q, "V2LLiV2LLiV2LLiC*V4iV2LLiIc", "", 
"avx2")
-TARGET_BUILTIN(__builtin_ia32_gatherd_q256, "V4LLiV4LLiV4LLiC*V4iV4LLiIc", "", 
"avx2")
-TARGET_BUILTIN(__builtin_ia32_gatherq_q, "V2LLiV2LLiV2LLiC*V2LLiV2LLiIc", "", 
"avx2")
-TARGET_BUILTIN(__builtin_ia32_gatherq_q256, "V4LLiV4LLiV4LLiC*V4LLiV4LLiIc", 
"", "avx2")
-TARGET_BUILTIN(__builtin_ia32_gatherd_d, "V4iV4iV4iC*V4iV4iIc", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_gatherd_d256, "V8iV8iV8iC*V8iV8iIc", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_gatherq_d, "V4iV4iV4iC*V2LLiV4iIc", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_gatherq_d256, "V4iV4iV4iC*V4LLiV4iIc", "", 
"avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherd_q, "V2LLiV2LLiLLiC*V4iV2LLiIc", "", 
"avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherd_q256, "V4LLiV4LLiLLiC*V4iV4LLiIc", "", 
"avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherq_q, "V2LLiV2LLiLLiC*V2LLiV2LLiIc", "", 
"avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherq_q256, "V4LLiV4LLiLLiC*V4LLiV4LLiIc", "", 
"avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherd_d, "V4iV4iiC*V4iV4iIc", "", "avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherd_d256, "V8iV8iiC*V8iV8iIc", "", "avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherq_d, "V4iV4iiC*V2LLiV4iIc", "", "avx2")
+TARGET_BUILTIN(__builtin_ia32_gatherq_d256, "V4iV4iiC*V4LLiV4iIc", "", "avx2")
 
 // F16C
 TARGET_BUILTIN(__builtin_ia32_vcvtps2ph, "V8sV4fIi", "", "f16c")

Modified: cfe/trunk/lib/Headers/avx2intrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx2intrin.h?rev=252697&r1=252696&r2=252697&view=diff
==
--- cfe/trunk/lib/Headers/avx2intrin.h (original)
+++ cfe/trunk/lib/Headers/avx2intrin.h Tue Nov 10 20:51:18 2015
@@ -1006,244 +1006,202 @@ _mm_srlv_epi64(__m128i __X, __m128i __Y)
 }
 
 #define _mm_mask_i32gather_pd(a, m, i, mask, s) __extension__ ({ \
-  __m128d __a = (a); \
-  double const *__m = (m); \
-  __m128i __i = (i); \
-  __m128d __mask = (mask); \
-  (__m128d)__builtin_ia32_gatherd_pd((__v2df)__a, (const __v2df *)__m, \
- (__v4si)__i, (__v2df)__mask, (s)); })
+  (__m128d)__builtin_ia32_gatherd_pd((__v2df)(__m128i)(a), \
+ (double const *)(m), \
+ (__v4si)(__m128i)(i), \
+ (__v2df)(__m128d)(mask), (s)); })
 
 #define _mm256_mask_i32gather_pd(a, m, i, mask, s) __extension__ ({ \
-  __m256d __a = (a); \
-  double const *__m = (m); \
-  __m128i __i = (i); \
-  __m256d __mask = (mask); \
-  (__m256d)__builtin_ia32_gatherd_pd256((__v4df)__a, (const __v4df *)__m, \
- (__v4si)__i, (__v4df)__mask, (s)); })
+  (__m256d)__builtin_ia32_gatherd_pd256((__v4df)(__m256d)(a), \
+  

r252700 - [X86] Add missing typecasts in intrinsic macros. This should make them more robust against inputs that aren't already the right type.

2015-11-10 Thread Craig Topper via cfe-commits
Author: ctopper
Date: Tue Nov 10 21:47:10 2015
New Revision: 252700

URL: http://llvm.org/viewvc/llvm-project?rev=252700&view=rev
Log:
[X86] Add missing typecasts in intrinsic macros. This should make them more 
robust against inputs that aren't already the right type.

Modified:
cfe/trunk/lib/Headers/__wmmintrin_aes.h
cfe/trunk/lib/Headers/avx2intrin.h
cfe/trunk/lib/Headers/avxintrin.h
cfe/trunk/lib/Headers/emmintrin.h
cfe/trunk/lib/Headers/shaintrin.h
cfe/trunk/lib/Headers/smmintrin.h
cfe/trunk/lib/Headers/tbmintrin.h

Modified: cfe/trunk/lib/Headers/__wmmintrin_aes.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/__wmmintrin_aes.h?rev=252700&r1=252699&r2=252700&view=diff
==
--- cfe/trunk/lib/Headers/__wmmintrin_aes.h (original)
+++ cfe/trunk/lib/Headers/__wmmintrin_aes.h Tue Nov 10 21:47:10 2015
@@ -59,7 +59,7 @@ _mm_aesimc_si128(__m128i __V)
 }
 
 #define _mm_aeskeygenassist_si128(C, R) \
-  __builtin_ia32_aeskeygenassist128((C), (R))
+  (__m128i)__builtin_ia32_aeskeygenassist128((__v2di)(__m128i)(C), (int)(R))
 
 #undef __DEFAULT_FN_ATTRS
 

Modified: cfe/trunk/lib/Headers/avx2intrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx2intrin.h?rev=252700&r1=252699&r2=252700&view=diff
==
--- cfe/trunk/lib/Headers/avx2intrin.h (original)
+++ cfe/trunk/lib/Headers/avx2intrin.h Tue Nov 10 21:47:10 2015
@@ -882,20 +882,18 @@ _mm256_permutevar8x32_ps(__m256 __a, __m
   (__m256i)__builtin_ia32_permti256((__m256i)(V1), (__m256i)(V2), (M)); })
 
 #define _mm256_extracti128_si256(V, M) __extension__ ({ \
-  (__m128i)__builtin_shufflevector( \
-(__v4di)(V), \
-(__v4di)(_mm256_setzero_si256()), \
-(((M) & 1) ? 2 : 0), \
-(((M) & 1) ? 3 : 1) );})
+  (__m128i)__builtin_shufflevector((__v4di)(__m256i)(V), \
+   (__v4di)_mm256_setzero_si256(), \
+   (((M) & 1) ? 2 : 0), \
+   (((M) & 1) ? 3 : 1) ); })
 
 #define _mm256_inserti128_si256(V1, V2, M) __extension__ ({ \
-  (__m256i)__builtin_shufflevector( \
-(__v4di)(V1), \
-(__v4di)_mm256_castsi128_si256((__m128i)(V2)), \
-(((M) & 1) ? 0 : 4), \
-(((M) & 1) ? 1 : 5), \
-(((M) & 1) ? 4 : 2), \
-(((M) & 1) ? 5 : 3) );})
+  (__m256i)__builtin_shufflevector((__v4di)(__m256i)(V1), \
+   
(__v4di)_mm256_castsi128_si256((__m128i)(V2)), \
+   (((M) & 1) ? 0 : 4), \
+   (((M) & 1) ? 1 : 5), \
+   (((M) & 1) ? 4 : 2), \
+   (((M) & 1) ? 5 : 3) ); })
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS
 _mm256_maskload_epi32(int const *__X, __m256i __M)

Modified: cfe/trunk/lib/Headers/avxintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avxintrin.h?rev=252700&r1=252699&r2=252700&view=diff
==
--- cfe/trunk/lib/Headers/avxintrin.h (original)
+++ cfe/trunk/lib/Headers/avxintrin.h Tue Nov 10 21:47:10 2015
@@ -1157,7 +1157,7 @@ _mm256_castsi128_si256(__m128i __a)
 */
 #define _mm256_insertf128_ps(V1, V2, M) __extension__ ({ \
   (__m256)__builtin_shufflevector( \
-(__v8sf)(V1), \
+(__v8sf)(__m256)(V1), \
 (__v8sf)_mm256_castps128_ps256((__m128)(V2)), \
 (((M) & 1) ?  0 :  8), \
 (((M) & 1) ?  1 :  9), \
@@ -1170,7 +1170,7 @@ _mm256_castsi128_si256(__m128i __a)
 
 #define _mm256_insertf128_pd(V1, V2, M) __extension__ ({ \
   (__m256d)__builtin_shufflevector( \
-(__v4df)(V1), \
+(__v4df)(__m256d)(V1), \
 (__v4df)_mm256_castpd128_pd256((__m128d)(V2)), \
 (((M) & 1) ? 0 : 4), \
 (((M) & 1) ? 1 : 5), \
@@ -1179,7 +1179,7 @@ _mm256_castsi128_si256(__m128i __a)
 
 #define _mm256_insertf128_si256(V1, V2, M) __extension__ ({ \
   (__m256i)__builtin_shufflevector( \
-(__v4di)(V1), \
+(__v4di)(__m256i)(V1), \
 (__v4di)_mm256_castsi128_si256((__m128i)(V2)), \
 (((M) & 1) ? 0 : 4), \
 (((M) & 1) ? 1 : 5), \
@@ -1193,7 +1193,7 @@ _mm256_castsi128_si256(__m128i __a)
 */
 #define _mm256_extractf128_ps(V, M) __extension__ ({ \
   (__m128)__builtin_shufflevector( \
-(__v8sf)(V), \
+(__v8sf)(__m256)(V), \
 (__v8sf)(_mm256_setzero_ps()), \
 (((M) & 1) ? 4 : 0), \
 (((M) & 1) ? 5 : 1), \
@@ -1202,14 +1202,14 @@ _mm256_castsi128_si256(__m128i __a)
 
 #define _mm256_extractf128_pd(V, M) __extension__ ({ \
   (__m128d)__builtin_shufflevector( \
-(__v4df)(V), \
+(__v4df)(__m256d)(V), \
 (__v4df)(_mm256_setzero_pd()), \
 (((M) & 1) ? 2 : 0), \
 (((M) & 1) ? 3 : 1) );})
 
 #define _mm256_extractf128_si256(V, M) __extension__ ({ \
   (__m128i)__builtin_shufflevector( \
-(__v4di)(V), \
+(__v4di)(__m256i)(V), \
   

Re: [PATCH] D14385: Correct atomic libcall support for __atomic_*_fetch builtins.

2015-11-10 Thread Saleem Abdulrasool via cfe-commits
compnerd accepted this revision.
compnerd added a reviewer: compnerd.
This revision is now accepted and ready to land.


Comment at: lib/CodeGen/CGAtomic.cpp:901
@@ -897,1 +900,3 @@
+  PostOp = llvm::Instruction::Add;
+// Fall through.
 case AtomicExpr::AO__c11_atomic_fetch_add:

:-(.  Very well.


http://reviews.llvm.org/D14385



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


Re: r252474 - Create install targets for scan-build and scan-view

2015-11-10 Thread Tobias Grosser via cfe-commits

On 11/10/2015 11:42 PM, Jonathan Roelofs wrote:


Fixed for real in r252662.


Confirmed. Thank you for addressing this so quickly.

Tobias

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