r263638 - Add visualizers for more clang types. Create more C++-like visualizations for existing Clang types

2016-03-20 Thread Mike Spertus via cfe-commits
Author: mps
Date: Wed Mar 16 09:27:50 2016
New Revision: 263638

URL: http://llvm.org/viewvc/llvm-project?rev=263638&view=rev
Log:
Add visualizers for more clang types. Create more C++-like visualizations for 
existing Clang types

Created visualizer for PointerType, LValueReferenceType, RValueReferenceType, 
and TemplateParmType.
In addition, cleaned up the display of existing types to be more C++-like. For 
example, instead of

  SubstTemplateTypeParmType: {Identifier (("T"))} => Record (25), {Identifier 
(("A"))}

it now displays more readably as 

  SubstTemplateTypeParmType: {typename T <= struct A}

The  sections still can be used for all the gory details if necessary.


Modified:
cfe/trunk/utils/clang.natvis

Modified: cfe/trunk/utils/clang.natvis
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/clang.natvis?rev=263638&r1=263637&r2=263638&view=diff
==
--- cfe/trunk/utils/clang.natvis (original)
+++ cfe/trunk/utils/clang.natvis Wed Mar 16 09:27:50 2016
@@ -6,46 +6,112 @@ Put this file into "%USERPROFILE%\Docume
 or create a symbolic link so it updates automatically.
 -->
 http://schemas.microsoft.com/vstudio/debugger/natvis/2010";>
+
   
-{(clang::Type::TypeClass)TypeBits.TC, en}
-Builtin 
Type={*(clang::BuiltinType *)this}
-Modified 
Type={((clang::AttributedType*)this)->ModifiedType} 
Attribute={(clang::AttributedType::Kind)AttributedTypeBits.AttrKind}
-{*(clang::SubstTemplateTypeParmType
 *)this}
-{*(clang::RecordType 
*)this}
-{(clang::Type::TypeClass)TypeBits.TC, en}
-
-  (clang::Type::TypeClass)TypeBits.TC
-  TypeBits
-  CanonicalType
-  *(clang::BuiltinType 
*)this
-  (clang::SubstTemplateTypeParmType
 *)this
-  (clang::RecordType 
*)this
+
+{(clang::Type::TypeClass)TypeBits.TC, 
en}Type
+
+{*(clang::BuiltinType *)this}
+{*(clang::PointerType *)this}
+{*(clang::LValueReferenceType *)this}
+{*(clang::RValueReferenceType *)this}
+{*(clang::AttributedType *)this}
+{*(clang::TemplateTypeParmType *)this}
+{*(clang::SubstTemplateTypeParmType *)this}
+{*(clang::RecordType *)this}
+{*this,view(poly)}
+{*this,view(cmn)}" 
+{*this,view(cmn)}  {{{*this,view(poly)}}}
+
+  (clang::Type::TypeClass)TypeBits.TC
+  TypeBits
+  CanonicalType
+  *(clang::BuiltinType 
*)this
+  *(clang::PointerType 
*)this
+  *(clang::LValueReferenceType
 *)this
+  *(clang::RValueReferenceType
 *)this
+  *(clang::AttributedType
 *)this
+  (clang::TemplateTypeParmType
 *)this
+  (clang::SubstTemplateTypeParmType
 *)this
+  (clang::RecordType 
*)this
+
+  
+  
+{PointeeType, view(poly)} *
+
+  *(clang::Type *)this, view(cmn)
+  PointeeType
+
+  
+  
+  
+{((clang::ReferenceType *)this)->PointeeType,view(cpp)} 
&
+
+  *(clang::Type *)this, view(cmn)
+  PointeeType
+
+  
+  
+{((clang::ReferenceType *)this)->PointeeType,view(cpp)} 
&&
+
+  *(clang::Type *)this, view(cmn)
+  PointeeType
 
   
+  
+{ModifiedType} 
Attribute={(clang::AttributedType::Kind)AttributedTypeBits.AttrKind}
+  
+  
+{Name,view(cpp)}
+{Name}
+  
+  
+struct 
{Name,view(cpp)}
+interface 
{Name,view(cpp)}
+union 
{Name,view(cpp)}
+class 
{Name,view(cpp)}
+enum 
{Name,view(cpp)}
+  
   
 {*decl}
 
+  *(clang::Type *)this, view(cmn)
   decl
 
   
   
-{*(clang::Type *)this, view(BaseOnly)}, {*(clang::TagType 
*)this}
+{*(clang::TagType *)this}
 
   *(clang::TagType *)this
 
   
+
   
-{*(clang::Type *)this, view(BaseOnly)}: {*Replaced} => 
{CanonicalType}
+{*Replaced,view(cpp)} <= 
{CanonicalType,view(cpp)}
 
-  *(clang::Type *)this, view(BaseOnly)
+  *(clang::Type *)this, view(cmn)
   *Replaced
 
   
   
-{*TTPDecl}
+typename {*TTPDecl,view(cpp)}
   
   
 
+{*((clang::ExtQualsTypeCommonBase 
*)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << 4) - 
1)))->BaseType,view(poly)}
+{*((clang::ExtQualsTypeCommonBase 
*)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << 4) - 
1)))->BaseType,view(cpp)}
 {*((clang::ExtQualsTypeCommonBase 
*)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << 4) - 
1)))->BaseType}
 
   *((clang::ExtQualsTypeCommonBase 
*)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << 4) - 
1)))->BaseType
@@ -70,15 +136,13 @@ or create a symbolic link so it updates
   (clang::BuiltinType::Kind)BuiltinTypeBits.Kind
 
   
-  
-{Name}
-  
+
   
 {(clang::TemplateDecl 
*)((Template.Storage.Val.Val.Value >> 2) << 2)}
 {Template.Storage}
   
   
-({((llvm::StringMapEntry*)Entry)+1,s})
+{((llvm::StringMapEntry*)Entry)+1,sb}
 
   ((llvm::StringMapEntry*)Entry)+1,s
   (clang::tok::TokenKind)TokenID
@@ -86,6 +150,7 @@ or create a sym

Re: [PATCH] D18261: Show members of DeclContexts (i.e., class members) in Visual Studio native visualizers

2016-03-20 Thread Mike Spertus via cfe-commits
mspertus added a comment.

I think the code is correct as written, see response in comment



Comment at: clang.natvis:77
@@ +76,3 @@
+  
+  
+  

aaron.ballman wrote:
> The only hard-wiring I see uses 3 bits, so is this comment still accurate?
I think the code is correct. 
```
  llvm::PointerIntPair NextInContextAndBits;

```
so `NextInContextAndBits` uses 2 bits for the `int` part. Just to be sure, I 
also double checked in the debugger (an `IntMask` of 3 represents two bits :) ),

```
clang::DeclContext *)(clang::CXXRecordDecl 
*)D)->FirstDecl)->NextInContextAndBits).IntMask  IntMask (3) 
llvm::PointerIntPair >::

```


http://reviews.llvm.org/D18261



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


Re: [PATCH] D18123: Fix implicit copy ctor and copy assignment operator warnings when -Wdeprecated passed.

2016-03-20 Thread don hinton via cfe-commits
hintonda updated this revision to Diff 50930.
hintonda added a comment.

Fixed comment per Dave's recommendation.


http://reviews.llvm.org/D18123

Files:
  include/clang/AST/UnresolvedSet.h
  include/clang/Sema/Lookup.h

Index: include/clang/Sema/Lookup.h
===
--- include/clang/Sema/Lookup.h
+++ include/clang/Sema/Lookup.h
@@ -185,6 +185,11 @@
   Shadowed(false)
   {}
 
+  // FIXME: Remove these deleted methods once the default build includes
+  // -Wdeprecated.
+  LookupResult(const LookupResult &) = delete;
+  LookupResult &operator=(const LookupResult &) = delete;
+
   ~LookupResult() {
 if (Diagnose) diagnose();
 if (Paths) deletePaths(Paths);
Index: include/clang/AST/UnresolvedSet.h
===
--- include/clang/AST/UnresolvedSet.h
+++ include/clang/AST/UnresolvedSet.h
@@ -59,8 +59,11 @@
   // UnresolvedSet.
 private:
   template  friend class UnresolvedSet;
-  UnresolvedSetImpl() {}
-  UnresolvedSetImpl(const UnresolvedSetImpl &) {}
+  UnresolvedSetImpl() = default;
+  UnresolvedSetImpl(const UnresolvedSetImpl &) = default;
+  UnresolvedSetImpl(UnresolvedSetImpl &&) = default;
+  UnresolvedSetImpl &operator=(const UnresolvedSetImpl &) = default;
+  UnresolvedSetImpl &operator=(UnresolvedSetImpl &&) = default;
 
 public:
   // We don't currently support assignment through this iterator, so we might


Index: include/clang/Sema/Lookup.h
===
--- include/clang/Sema/Lookup.h
+++ include/clang/Sema/Lookup.h
@@ -185,6 +185,11 @@
   Shadowed(false)
   {}
 
+  // FIXME: Remove these deleted methods once the default build includes
+  // -Wdeprecated.
+  LookupResult(const LookupResult &) = delete;
+  LookupResult &operator=(const LookupResult &) = delete;
+
   ~LookupResult() {
 if (Diagnose) diagnose();
 if (Paths) deletePaths(Paths);
Index: include/clang/AST/UnresolvedSet.h
===
--- include/clang/AST/UnresolvedSet.h
+++ include/clang/AST/UnresolvedSet.h
@@ -59,8 +59,11 @@
   // UnresolvedSet.
 private:
   template  friend class UnresolvedSet;
-  UnresolvedSetImpl() {}
-  UnresolvedSetImpl(const UnresolvedSetImpl &) {}
+  UnresolvedSetImpl() = default;
+  UnresolvedSetImpl(const UnresolvedSetImpl &) = default;
+  UnresolvedSetImpl(UnresolvedSetImpl &&) = default;
+  UnresolvedSetImpl &operator=(const UnresolvedSetImpl &) = default;
+  UnresolvedSetImpl &operator=(UnresolvedSetImpl &&) = default;
 
 public:
   // We don't currently support assignment through this iterator, so we might
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r263750 - Revert "Reapply [VFS] Add 'overlay-relative' field to YAML files"

2016-03-20 Thread Bruno Cardoso Lopes via cfe-commits
Author: bruno
Date: Thu Mar 17 16:30:55 2016
New Revision: 263750

URL: http://llvm.org/viewvc/llvm-project?rev=263750&view=rev
Log:
Revert "Reapply [VFS] Add 'overlay-relative' field to YAML files"

Tests failing on
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/46102

This reverts commit a1683cd6c9e07359c09f86e98a4db6b4e1bc51fc.

Removed:
cfe/trunk/test/Modules/crash-vfs-relative-overlay.m
Modified:
cfe/trunk/include/clang/Basic/VirtualFileSystem.h
cfe/trunk/lib/Basic/VirtualFileSystem.cpp
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp
cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m
cfe/trunk/test/Modules/crash-vfs-path-traversal.m
cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp

Modified: cfe/trunk/include/clang/Basic/VirtualFileSystem.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/VirtualFileSystem.h?rev=263750&r1=263749&r2=263750&view=diff
==
--- cfe/trunk/include/clang/Basic/VirtualFileSystem.h (original)
+++ cfe/trunk/include/clang/Basic/VirtualFileSystem.h Thu Mar 17 16:30:55 2016
@@ -310,7 +310,6 @@ llvm::sys::fs::UniqueID getNextVirtualUn
 IntrusiveRefCntPtr
 getVFSFromYAML(std::unique_ptr Buffer,
llvm::SourceMgr::DiagHandlerTy DiagHandler,
-   StringRef YAMLFilePath,
void *DiagContext = nullptr,
IntrusiveRefCntPtr ExternalFS = 
getRealFileSystem());
 
@@ -324,8 +323,6 @@ struct YAMLVFSEntry {
 class YAMLVFSWriter {
   std::vector Mappings;
   Optional IsCaseSensitive;
-  Optional IsOverlayRelative;
-  std::string OverlayDir;
 
 public:
   YAMLVFSWriter() {}
@@ -333,11 +330,6 @@ public:
   void setCaseSensitivity(bool CaseSensitive) {
 IsCaseSensitive = CaseSensitive;
   }
-  void setOverlayDir(StringRef OverlayDirectory) {
-IsOverlayRelative = true;
-OverlayDir.assign(OverlayDirectory.str());
-  }
-
   void write(llvm::raw_ostream &OS);
 };
 

Modified: cfe/trunk/lib/Basic/VirtualFileSystem.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/VirtualFileSystem.cpp?rev=263750&r1=263749&r2=263750&view=diff
==
--- cfe/trunk/lib/Basic/VirtualFileSystem.cpp (original)
+++ cfe/trunk/lib/Basic/VirtualFileSystem.cpp Thu Mar 17 16:30:55 2016
@@ -780,7 +780,6 @@ public:
 /// All configuration options are optional.
 ///   'case-sensitive': 
 ///   'use-external-names': 
-///   'overlay-relative': 
 ///
 /// Virtual directories are represented as
 /// \verbatim
@@ -820,10 +819,6 @@ class RedirectingFileSystem : public vfs
   std::vector> Roots;
   /// \brief The file system to use for external references.
   IntrusiveRefCntPtr ExternalFS;
-  /// If IsRelativeOverlay is set, this represents the directory
-  /// path that should be prefixed to each 'external-contents' entry
-  /// when reading from YAML files.
-  std::string ExternalContentsPrefixDir;
 
   /// @name Configuration
   /// @{
@@ -833,10 +828,6 @@ class RedirectingFileSystem : public vfs
   /// Currently, case-insensitive matching only works correctly with ASCII.
   bool CaseSensitive;
 
-  /// IsRelativeOverlay marks whether a IsExternalContentsPrefixDir path must
-  /// be prefixed in every 'external-contents' when reading from YAML files.
-  bool IsRelativeOverlay = false;
-
   /// \brief Whether to use to use the value of 'external-contents' for the
   /// names of files.  This global value is overridable on a per-file basis.
   bool UseExternalNames;
@@ -874,8 +865,8 @@ public:
   /// returns a virtual file system representing its contents.
   static RedirectingFileSystem *
   create(std::unique_ptr Buffer,
- SourceMgr::DiagHandlerTy DiagHandler, StringRef YAMLFilePath,
- void *DiagContext, IntrusiveRefCntPtr ExternalFS);
+ SourceMgr::DiagHandlerTy DiagHandler, void *DiagContext,
+ IntrusiveRefCntPtr ExternalFS);
 
   ErrorOr status(const Twine &Path) override;
   ErrorOr> openFileForRead(const Twine &Path) override;
@@ -908,15 +899,6 @@ public:
 return directory_iterator(std::make_shared(Dir,
 *this, D->contents_begin(), D->contents_end(), EC));
   }
-
-  void setExternalContentsPrefixDir(StringRef PrefixDir) {
-ExternalContentsPrefixDir = PrefixDir.str();
-  }
-
-  StringRef getExternalContentsPrefixDir() const {
-return ExternalContentsPrefixDir;
-  }
-
 };
 
 /// \brief A helper class to hold the common YAML parsing state.
@@ -1090,24 +1072,16 @@ class RedirectingFileSystemParser {
 HasContents = true;
 if (!parseScalarString(I->getValue(), Value, Buffer))
   return nullptr;
-
-SmallString<256> FullPath;
-if (FS->IsRelativeOverlay) {
-  FullPath = FS->getExternalContentsPrefixDir();
-  assert(!FullPath.empty() &&
- "External contents prefix directory

Re: [PATCH] D16965: Fix for Bug 14644 - clang confuses scope operator for global namespace giving extra qualification on member

2016-03-20 Thread Richard Smith via cfe-commits
rsmith added a comment.

Note that the diagnostic wording has already been fixed compared with the 
diagnostic reported in that bug report. Do we actually need more changes here?


http://reviews.llvm.org/D16965



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


Re: [PATCH] D18262: [clang-tidy] Skip reporting of not applicable fixes.

2016-03-20 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 51046.
etienneb marked 2 inline comments as done.
etienneb added a comment.

Added test.


http://reviews.llvm.org/D18262

Files:
  ClangTidy.cpp
  misc-macro-parentheses-cmdline.cpp

Index: misc-macro-parentheses-cmdline.cpp
===
--- misc-macro-parentheses-cmdline.cpp
+++ misc-macro-parentheses-cmdline.cpp
@@ -0,0 +1,10 @@
+// RUN: %check_clang_tidy %s misc-macro-parentheses %t -- -- -DVAL=0+0
+
+// The previous command-line is producing warnings and fixes with the source
+// locations from a virtual buffer. VAL is replaced by '0+0'.
+// Fixes could not be applied and should not be reported.
+int foo() { return VAL; }
+
+#define V 0+0
+int bar() { return V; }
+// CHECK-FIXES: #define V (0+0)
Index: ClangTidy.cpp
===
--- ClangTidy.cpp
+++ ClangTidy.cpp
@@ -128,13 +128,20 @@
   auto Diag = Diags.Report(Loc, Diags.getCustomDiagID(Level, "%0 [%1]"))
   << Message.Message << Name;
   for (const tooling::Replacement &Fix : Error.Fix) {
-SmallString<128> FixAbsoluteFilePath = Fix.getFilePath();
-Files.makeAbsolutePath(FixAbsoluteFilePath);
-SourceLocation FixLoc =
-getLocation(FixAbsoluteFilePath, Fix.getOffset());
-SourceLocation FixEndLoc = FixLoc.getLocWithOffset(Fix.getLength());
-Diag << FixItHint::CreateReplacement(SourceRange(FixLoc, FixEndLoc),
- Fix.getReplacementText());
+// Retrieve the source range for applicable fixes. Macro definitions
+// on the command line have locations in a virtual buffer and don't
+// have valid file paths and are therefore not applicable.
+SourceRange Range;
+SourceLocation FixLoc;
+if (Fix.isApplicable()) {
+  SmallString<128> FixAbsoluteFilePath = Fix.getFilePath();
+  Files.makeAbsolutePath(FixAbsoluteFilePath);
+  FixLoc = getLocation(FixAbsoluteFilePath, Fix.getOffset());
+  SourceLocation FixEndLoc = FixLoc.getLocWithOffset(Fix.getLength());
+  Range = SourceRange(FixLoc, FixEndLoc);
+  Diag << FixItHint::CreateReplacement(Range, 
Fix.getReplacementText());
+}
+  
 ++TotalFixes;
 if (ApplyFixes) {
   bool Success = Fix.isApplicable() && Fix.apply(Rewrite);


Index: misc-macro-parentheses-cmdline.cpp
===
--- misc-macro-parentheses-cmdline.cpp
+++ misc-macro-parentheses-cmdline.cpp
@@ -0,0 +1,10 @@
+// RUN: %check_clang_tidy %s misc-macro-parentheses %t -- -- -DVAL=0+0
+
+// The previous command-line is producing warnings and fixes with the source
+// locations from a virtual buffer. VAL is replaced by '0+0'.
+// Fixes could not be applied and should not be reported.
+int foo() { return VAL; }
+
+#define V 0+0
+int bar() { return V; }
+// CHECK-FIXES: #define V (0+0)
Index: ClangTidy.cpp
===
--- ClangTidy.cpp
+++ ClangTidy.cpp
@@ -128,13 +128,20 @@
   auto Diag = Diags.Report(Loc, Diags.getCustomDiagID(Level, "%0 [%1]"))
   << Message.Message << Name;
   for (const tooling::Replacement &Fix : Error.Fix) {
-SmallString<128> FixAbsoluteFilePath = Fix.getFilePath();
-Files.makeAbsolutePath(FixAbsoluteFilePath);
-SourceLocation FixLoc =
-getLocation(FixAbsoluteFilePath, Fix.getOffset());
-SourceLocation FixEndLoc = FixLoc.getLocWithOffset(Fix.getLength());
-Diag << FixItHint::CreateReplacement(SourceRange(FixLoc, FixEndLoc),
- Fix.getReplacementText());
+// Retrieve the source range for applicable fixes. Macro definitions
+// on the command line have locations in a virtual buffer and don't
+// have valid file paths and are therefore not applicable.
+SourceRange Range;
+SourceLocation FixLoc;
+if (Fix.isApplicable()) {
+  SmallString<128> FixAbsoluteFilePath = Fix.getFilePath();
+  Files.makeAbsolutePath(FixAbsoluteFilePath);
+  FixLoc = getLocation(FixAbsoluteFilePath, Fix.getOffset());
+  SourceLocation FixEndLoc = FixLoc.getLocWithOffset(Fix.getLength());
+  Range = SourceRange(FixLoc, FixEndLoc);
+  Diag << FixItHint::CreateReplacement(Range, Fix.getReplacementText());
+}
+  
 ++TotalFixes;
 if (ApplyFixes) {
   bool Success = Fix.isApplicable() && Fix.apply(Rewrite);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r263785 - Make LookupResult movable again.

2016-03-20 Thread Benjamin Kramer via cfe-commits
Author: d0k
Date: Fri Mar 18 08:31:00 2016
New Revision: 263785

URL: http://llvm.org/viewvc/llvm-project?rev=263785&view=rev
Log:
Make LookupResult movable again.

We lost copy semantics in r263730, because it only worked for a few very
specific cases. Move semantics don't have this issue. Sadly the
implementation is a bit messy but I don't know how to clean it up
without losing support for msvc 2013 :/

Modified:
cfe/trunk/include/clang/Sema/Lookup.h

Modified: cfe/trunk/include/clang/Sema/Lookup.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Lookup.h?rev=263785&r1=263784&r2=263785&view=diff
==
--- cfe/trunk/include/clang/Sema/Lookup.h (original)
+++ cfe/trunk/include/clang/Sema/Lookup.h Fri Mar 18 08:31:00 2016
@@ -190,6 +190,44 @@ public:
   LookupResult(const LookupResult &) = delete;
   LookupResult &operator=(const LookupResult &) = delete;
 
+  LookupResult(LookupResult &&Other)
+  : ResultKind(std::move(Other.ResultKind)),
+Ambiguity(std::move(Other.Ambiguity)), Decls(std::move(Other.Decls)),
+Paths(std::move(Other.Paths)),
+NamingClass(std::move(Other.NamingClass)),
+BaseObjectType(std::move(Other.BaseObjectType)),
+SemaPtr(std::move(Other.SemaPtr)), NameInfo(std::move(Other.NameInfo)),
+NameContextRange(std::move(Other.NameContextRange)),
+LookupKind(std::move(Other.LookupKind)), IDNS(std::move(Other.IDNS)),
+Redecl(std::move(Other.Redecl)), HideTags(std::move(Other.HideTags)),
+Diagnose(std::move(Other.Diagnose)),
+AllowHidden(std::move(Other.AllowHidden)),
+Shadowed(std::move(Other.Shadowed)) {
+Other.Paths = nullptr;
+Other.Diagnose = false;
+  }
+  LookupResult &operator=(LookupResult &&Other) {
+ResultKind = std::move(Other.ResultKind);
+Ambiguity = std::move(Other.Ambiguity);
+Decls = std::move(Other.Decls);
+Paths = std::move(Other.Paths);
+NamingClass = std::move(Other.NamingClass);
+BaseObjectType = std::move(Other.BaseObjectType);
+SemaPtr = std::move(Other.SemaPtr);
+NameInfo = std::move(Other.NameInfo);
+NameContextRange = std::move(Other.NameContextRange);
+LookupKind = std::move(Other.LookupKind);
+IDNS = std::move(Other.IDNS);
+Redecl = std::move(Other.Redecl);
+HideTags = std::move(Other.HideTags);
+Diagnose = std::move(Other.Diagnose);
+AllowHidden = std::move(Other.AllowHidden);
+Shadowed = std::move(Other.Shadowed);
+Other.Paths = nullptr;
+Other.Diagnose = false;
+return *this;
+  }
+
   ~LookupResult() {
 if (Diagnose) diagnose();
 if (Paths) deletePaths(Paths);


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


Re: [PATCH] D18274: [clang-tidy] Add boost module

2016-03-20 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 51087.

http://reviews.llvm.org/D18274

Files:
  clang-tidy/CMakeLists.txt
  clang-tidy/boost/BoostTidyModule.cpp
  clang-tidy/boost/CMakeLists.txt
  clang-tidy/plugin/CMakeLists.txt
  clang-tidy/tool/CMakeLists.txt
  clang-tidy/tool/ClangTidyMain.cpp
  docs/clang-tidy/index.rst

Index: docs/clang-tidy/index.rst
===
--- docs/clang-tidy/index.rst
+++ docs/clang-tidy/index.rst
@@ -67,6 +67,8 @@
 
 * Clang static analyzer checks are named starting with ``clang-analyzer-``.
 
+* Checks related to Boost library starts with ``boost-``. 
+  
 Clang diagnostics are treated in a similar way as check diagnostics. Clang
 diagnostics are displayed by clang-tidy and can be filtered out using
 ``-checks=`` option. However, the ``-checks=`` option does not affect
Index: clang-tidy/tool/ClangTidyMain.cpp
===
--- clang-tidy/tool/ClangTidyMain.cpp
+++ clang-tidy/tool/ClangTidyMain.cpp
@@ -393,6 +393,11 @@
 static int LLVM_ATTRIBUTE_UNUSED CERTModuleAnchorDestination =
 CERTModuleAnchorSource;
 
+// This anchor is used to force the linker to link the BoostModule.
+extern volatile int BoostModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED BoostModuleAnchorDestination =
+BoostModuleAnchorSource;
+
 // This anchor is used to force the linker to link the LLVMModule.
 extern volatile int LLVMModuleAnchorSource;
 static int LLVM_ATTRIBUTE_UNUSED LLVMModuleAnchorDestination =
Index: clang-tidy/tool/CMakeLists.txt
===
--- clang-tidy/tool/CMakeLists.txt
+++ clang-tidy/tool/CMakeLists.txt
@@ -10,6 +10,7 @@
   clangASTMatchers
   clangBasic
   clangTidy
+  clangTidyBoostModule
   clangTidyCERTModule
   clangTidyCppCoreGuidelinesModule
   clangTidyGoogleModule
Index: clang-tidy/plugin/CMakeLists.txt
===
--- clang-tidy/plugin/CMakeLists.txt
+++ clang-tidy/plugin/CMakeLists.txt
@@ -8,6 +8,7 @@
   clangFrontend
   clangSema
   clangTidy
+  clangTidyBoostModule
   clangTidyCERTModule
   clangTidyCppCoreGuidelinesModule
   clangTidyGoogleModule
Index: clang-tidy/boost/CMakeLists.txt
===
--- /dev/null
+++ clang-tidy/boost/CMakeLists.txt
@@ -0,0 +1,13 @@
+set(LLVM_LINK_COMPONENTS support)
+
+add_clang_library(clangTidyBoostModule
+  BoostTidyModule.cpp
+
+  LINK_LIBS
+  clangAST
+  clangASTMatchers
+  clangBasic
+  clangLex
+  clangTidy
+  clangTidyUtils
+  )
Index: clang-tidy/boost/BoostTidyModule.cpp
===
--- /dev/null
+++ clang-tidy/boost/BoostTidyModule.cpp
@@ -0,0 +1,40 @@
+//===--- BoostTidyModule.cpp - clang-tidy -===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "../ClangTidy.h"
+#include "../ClangTidyModule.h"
+#include "../ClangTidyModuleRegistry.h"
+using namespace clang::ast_matchers;
+
+namespace clang {
+namespace tidy {
+namespace boost {
+
+class BoostModule : public ClangTidyModule {
+public:
+  void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {}
+
+  ClangTidyOptions getModuleOptions() override {
+ClangTidyOptions Options;
+return Options;
+  }
+};
+
+// Register the BoostModule using this statically initialized variable.
+static ClangTidyModuleRegistry::Add X("boost-module",
+   "Add boost checks.");
+
+} // namespace boost
+
+// This anchor is used to force the linker to link in the generated object file
+// and thus register the BoostModule.
+volatile int BoostModuleAnchorSource = 0;
+
+} // namespace tidy
+} // namespace clang
Index: clang-tidy/CMakeLists.txt
===
--- clang-tidy/CMakeLists.txt
+++ clang-tidy/CMakeLists.txt
@@ -27,6 +27,7 @@
 
 add_subdirectory(tool)
 add_subdirectory(plugin)
+add_subdirectory(boost)
 add_subdirectory(cert)
 add_subdirectory(llvm)
 add_subdirectory(cppcoreguidelines)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D18280: [tsan] Allow -fsanitize=thread for iOS-style simulator targets

2016-03-20 Thread Alexey Samsonov via cfe-commits
samsonov added a comment.

Cool, great to see this coming. I'll let Kuba sign this off.



Comment at: test/Driver/fsanitize.c:220
@@ -219,1 +219,3 @@
 
+// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=thread %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-TSAN-X86-64-DARWIN
+// CHECK-TSAN-X86-64-DARWIN-NOT: unsupported option

Care to add a test for ios or tvos?


http://reviews.llvm.org/D18280



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


Re: [PATCH] D17950: Implement is_always_lock_free

2016-03-20 Thread James Y Knight via cfe-commits
jyknight added inline comments.


Comment at: lib/Frontend/InitPreprocessor.cpp:305
@@ +304,3 @@
+if (TypeWidth == TypeAlign && (TypeWidth & (TypeWidth - 1)) == 0 &&
+TypeWidth <= InlineWidth)
+  return Always;

jfb wrote:
> bcraig wrote:
> > On some targets (like Hexagon), 4-byte values are cheap to inline, but 
> > 1-byte values are not.  Clang is spotty about checking this, but 
> > TargetInfo::hasBuiltinAtomic seems like the right function to ask, if you 
> > have access to it.
> You're commenting on:
> ```
> if (TypeWidth == TypeAlign && (TypeWidth & (TypeWidth - 1)) == 0 &&
> TypeWidth <= InlineWidth)
> ```
> ?
> 
> Are you asking for a separate change, or for a change to my patch?
That issue in clang's purview in any case; if hexagon wants to lower a 1-byte 
cmpxchg to a compiler runtime function, it should do so in its backend.


http://reviews.llvm.org/D17950



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


Re: [PATCH] D17596: [OpenCL] Add ocl and spir version for spir target

2016-03-20 Thread Xiuli PAN via cfe-commits
pxli168 added inline comments.


Comment at: test/CodeGenOpenCL/spir_version.cl:15
@@ +14,2 @@
+// CL20: !opencl.ocl.version = !{[[SPIR:![0-9]+]]}
+// CL20: [[SPIR]] = !{i32 2, i32 0}

Anastasia wrote:
> Forgotten to check OpenCL version here?
The metadate will be merged into the same one, so there will be only one 2.0 
here.


http://reviews.llvm.org/D17596



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


Re: [PATCH] D17596: [OpenCL] Add ocl and spir version for spir target

2016-03-20 Thread Xiuli PAN via cfe-commits
pxli168 updated this revision to Diff 51126.

http://reviews.llvm.org/D17596

Files:
  lib/CodeGen/TargetInfo.cpp
  test/CodeGenOpenCL/spir_version.cl

Index: test/CodeGenOpenCL/spir_version.cl
===
--- /dev/null
+++ test/CodeGenOpenCL/spir_version.cl
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 %s -triple "spir-unknown-unknown" -emit-llvm -o - | 
FileCheck %s --check-prefix=CL10
+// RUN: %clang_cc1 %s -triple "spir-unknown-unknown" -emit-llvm -o - 
-cl-std=CL1.2 | FileCheck %s --check-prefix=CL12
+// RUN: %clang_cc1 %s -triple "spir-unknown-unknown" -emit-llvm -o - 
-cl-std=CL2.0 | FileCheck %s --check-prefix=CL20
+kernel void foo() {}
+// CL10: !opencl.spir.version = !{[[SPIR:![0-9]+]]}
+// CL10: !opencl.ocl.version = !{[[OCL:![0-9]+]]}
+// CL10: [[SPIR]] = !{i32 2, i32 0}
+// CL10: [[OCL]] = !{i32 1, i32 0}
+// CL12: !opencl.spir.version = !{[[SPIR:![0-9]+]]}
+// CL12: !opencl.ocl.version = !{[[OCL:![0-9]+]]}
+// CL12: [[SPIR]] = !{i32 2, i32 0}
+// CL12: [[OCL]] = !{i32 1, i32 2}
+// CL20: !opencl.spir.version = !{[[SPIR:![0-9]+]]}
+// CL20: !opencl.ocl.version = !{[[SPIR:![0-9]+]]}
+// CL20: [[SPIR]] = !{i32 2, i32 0}
Index: lib/CodeGen/TargetInfo.cpp
===
--- lib/CodeGen/TargetInfo.cpp
+++ lib/CodeGen/TargetInfo.cpp
@@ -7217,6 +7217,47 @@
   }
 }
 
+//===--===//
+// SPIR ABI Implementation
+//===--===//
+
+namespace {
+class SPIRTargetCodeGenInfo : public TargetCodeGenInfo {
+public:
+  SPIRTargetCodeGenInfo(CodeGen::CodeGenTypes &CGT)
+: TargetCodeGenInfo(new DefaultABIInfo(CGT)) {}
+  void emitTargetMD(const Decl *D, llvm::GlobalValue *GV,
+CodeGen::CodeGenModule &M) const override;
+};
+} // End anonymous namespace.
+
+/// Emit SPIR specific metadata: OpenCL and SPIR version.
+void SPIRTargetCodeGenInfo::emitTargetMD(const Decl *D, llvm::GlobalValue *GV,
+ CodeGen::CodeGenModule &CGM) const {
+  assert(CGM.getLangOpts().OpenCL && "SPIR is only for OpenCL");
+  llvm::LLVMContext &Ctx = CGM.getModule().getContext();
+  llvm::Type *Int32Ty = llvm::Type::getInt32Ty(Ctx);
+  llvm::Module &M = CGM.getModule();
+  // SPIR v2.0 s2.12 - The SPIR version used by the module is stored in the
+  // opencl.spir.version named metadata.
+  llvm::Metadata *SPIRVerElts[] = {
+  llvm::ConstantAsMetadata::get(llvm::ConstantInt::get(Int32Ty, 2)),
+  llvm::ConstantAsMetadata::get(llvm::ConstantInt::get(Int32Ty, 0))};
+  llvm::NamedMDNode *SPIRVerMD =
+  M.getOrInsertNamedMetadata("opencl.spir.version");
+  SPIRVerMD->addOperand(llvm::MDNode::get(Ctx, SPIRVerElts));
+  // SPIR v2.0 s2.13 - The OpenCL version used by the module is stored in the
+  // opencl.ocl.version named metadata node.
+  llvm::Metadata *OCLVerElts[] = {
+  llvm::ConstantAsMetadata::get(llvm::ConstantInt::get(
+  Int32Ty, CGM.getLangOpts().OpenCLVersion / 100)),
+  llvm::ConstantAsMetadata::get(llvm::ConstantInt::get(
+  Int32Ty, (CGM.getLangOpts().OpenCLVersion % 100) / 10))};
+  llvm::NamedMDNode *OCLVerMD =
+  M.getOrInsertNamedMetadata("opencl.ocl.version");
+  OCLVerMD->addOperand(llvm::MDNode::get(Ctx, OCLVerElts));
+}
+
 static bool appendType(SmallStringEnc &Enc, QualType QType,
const CodeGen::CodeGenModule &CGM,
TypeStringCache &TSC);
@@ -7707,5 +7748,8 @@
 return *(TheTargetCodeGenInfo = new SparcV9TargetCodeGenInfo(Types));
   case llvm::Triple::xcore:
 return *(TheTargetCodeGenInfo = new XCoreTargetCodeGenInfo(Types));
+  case llvm::Triple::spir:
+  case llvm::Triple::spir64:
+return *(TheTargetCodeGenInfo = new SPIRTargetCodeGenInfo(Types));
   }
 }


Index: test/CodeGenOpenCL/spir_version.cl
===
--- /dev/null
+++ test/CodeGenOpenCL/spir_version.cl
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 %s -triple "spir-unknown-unknown" -emit-llvm -o - | FileCheck %s --check-prefix=CL10
+// RUN: %clang_cc1 %s -triple "spir-unknown-unknown" -emit-llvm -o - -cl-std=CL1.2 | FileCheck %s --check-prefix=CL12
+// RUN: %clang_cc1 %s -triple "spir-unknown-unknown" -emit-llvm -o - -cl-std=CL2.0 | FileCheck %s --check-prefix=CL20
+kernel void foo() {}
+// CL10: !opencl.spir.version = !{[[SPIR:![0-9]+]]}
+// CL10: !opencl.ocl.version = !{[[OCL:![0-9]+]]}
+// CL10: [[SPIR]] = !{i32 2, i32 0}
+// CL10: [[OCL]] = !{i32 1, i32 0}
+// CL12: !opencl.spir.version = !{[[SPIR:![0-9]+]]}
+// CL12: !opencl.ocl.version = !{[[OCL:![0-9]+]]}
+// CL12: [[SPIR]] = !{i32 2, i32 0}
+// CL12: [[OCL]] = !{i32 1, i32 2}
+// CL20: !opencl.spir.version = !{[[SPIR:![0-9]+]]}
+// CL20: !opencl.ocl.version = !{[[SPIR:![0-9]+]]}
+// CL20: [[SPIR]] = !{i32 2, i32 0}
Index: lib/CodeGen/TargetInfo.cpp
==

Re: [PATCH] D17596: [OpenCL] Add ocl and spir version for spir target

2016-03-20 Thread Xiuli PAN via cfe-commits
pxli168 marked 2 inline comments as done.
pxli168 added a comment.

http://reviews.llvm.org/D17596



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


r263895 - P0184R0: Allow types of 'begin' and 'end' expressions in range-based for loops to differ.

2016-03-20 Thread Richard Smith via cfe-commits
Author: rsmith
Date: Sun Mar 20 05:33:40 2016
New Revision: 263895

URL: http://llvm.org/viewvc/llvm-project?rev=263895&view=rev
Log:
P0184R0: Allow types of 'begin' and 'end' expressions in range-based for loops 
to differ.

Modified:
cfe/trunk/include/clang/AST/StmtCXX.h
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/lib/AST/ASTImporter.cpp
cfe/trunk/lib/AST/ExprConstant.cpp
cfe/trunk/lib/AST/StmtCXX.cpp
cfe/trunk/lib/Analysis/CFG.cpp
cfe/trunk/lib/CodeGen/CGStmt.cpp
cfe/trunk/lib/CodeGen/CodeGenPGO.cpp
cfe/trunk/lib/Sema/SemaStmt.cpp
cfe/trunk/lib/Sema/TreeTransform.h
cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
cfe/trunk/lib/Serialization/ASTWriterStmt.cpp
cfe/trunk/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp
cfe/trunk/www/cxx_status.html

Modified: cfe/trunk/include/clang/AST/StmtCXX.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtCXX.h?rev=263895&r1=263894&r2=263895&view=diff
==
--- cfe/trunk/include/clang/AST/StmtCXX.h (original)
+++ cfe/trunk/include/clang/AST/StmtCXX.h Sun Mar 20 05:33:40 2016
@@ -127,7 +127,7 @@ public:
 /// can be extracted using getLoopVariable and getRangeInit.
 class CXXForRangeStmt : public Stmt {
   SourceLocation ForLoc;
-  enum { RANGE, BEGINEND, COND, INC, LOOPVAR, BODY, END };
+  enum { RANGE, BEGINSTMT, ENDSTMT, COND, INC, LOOPVAR, BODY, END };
   // SubExprs[RANGE] is an expression or declstmt.
   // SubExprs[COND] and SubExprs[INC] are expressions.
   Stmt *SubExprs[END];
@@ -137,7 +137,7 @@ class CXXForRangeStmt : public Stmt {
 
   friend class ASTStmtReader;
 public:
-  CXXForRangeStmt(DeclStmt *Range, DeclStmt *BeginEnd,
+  CXXForRangeStmt(DeclStmt *Range, DeclStmt *Begin, DeclStmt *End,
   Expr *Cond, Expr *Inc, DeclStmt *LoopVar, Stmt *Body,
   SourceLocation FL, SourceLocation CAL, SourceLocation CL,
   SourceLocation RPL);
@@ -152,9 +152,10 @@ public:
 
 
   DeclStmt *getRangeStmt() { return cast(SubExprs[RANGE]); }
-  DeclStmt *getBeginEndStmt() {
-return cast_or_null(SubExprs[BEGINEND]);
+  DeclStmt *getBeginStmt() {
+return cast_or_null(SubExprs[BEGINSTMT]);
   }
+  DeclStmt *getEndStmt() { return cast_or_null(SubExprs[ENDSTMT]); }
   Expr *getCond() { return cast_or_null(SubExprs[COND]); }
   Expr *getInc() { return cast_or_null(SubExprs[INC]); }
   DeclStmt *getLoopVarStmt() { return cast(SubExprs[LOOPVAR]); }
@@ -163,8 +164,11 @@ public:
   const DeclStmt *getRangeStmt() const {
 return cast(SubExprs[RANGE]);
   }
-  const DeclStmt *getBeginEndStmt() const {
-return cast_or_null(SubExprs[BEGINEND]);
+  const DeclStmt *getBeginStmt() const {
+return cast_or_null(SubExprs[BEGINSTMT]);
+  }
+  const DeclStmt *getEndStmt() const {
+return cast_or_null(SubExprs[ENDSTMT]);
   }
   const Expr *getCond() const {
 return cast_or_null(SubExprs[COND]);
@@ -179,7 +183,8 @@ public:
 
   void setRangeInit(Expr *E) { SubExprs[RANGE] = reinterpret_cast(E); }
   void setRangeStmt(Stmt *S) { SubExprs[RANGE] = S; }
-  void setBeginEndStmt(Stmt *S) { SubExprs[BEGINEND] = S; }
+  void setBeginStmt(Stmt *S) { SubExprs[BEGINSTMT] = S; }
+  void setEndStmt(Stmt *S) { SubExprs[ENDSTMT] = S; }
   void setCond(Expr *E) { SubExprs[COND] = reinterpret_cast(E); }
   void setInc(Expr *E) { SubExprs[INC] = reinterpret_cast(E); }
   void setLoopVarStmt(Stmt *S) { SubExprs[LOOPVAR] = S; }

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=263895&r1=263894&r2=263895&view=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Sun Mar 20 05:33:40 
2016
@@ -30,23 +30,6 @@ def warn_redundant_loop_iteration : Warn
   InGroup, DefaultIgnore;
 def note_loop_iteration_here : Note<"%select{decremented|incremented}0 here">;
 
-def warn_for_range_const_reference_copy : Warning<
-  "loop variable %0 "
-  "%diff{has type $ but is initialized with type $"
-  "| is initialized with a value of a different type}1,2 resulting in a copy">,
-  InGroup, DefaultIgnore;
-def note_use_type_or_non_reference : Note<
-  "use non-reference type %0 to keep the copy or type %1 to prevent copying">;
-def warn_for_range_variable_always_copy : Warning<
-  "loop variable %0 is always a copy because the range of type %1 does not "
-  "return a reference">,
-  InGroup, DefaultIgnore;
-def note_use_non_reference_type : Note<"use non-reference type %0">;
-def warn_for_range_copy : Warning<
-  "loop variable %0 of type %1 creates a copy from type %2">,
-  InGroup, DefaultIgnore;
-def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
-
 def warn_dup

r263896 - Mark C++ features implemented in Clang 3.8 as done now that 3.8 has released.

2016-03-20 Thread Richard Smith via cfe-commits
Author: rsmith
Date: Sun Mar 20 05:37:12 2016
New Revision: 263896

URL: http://llvm.org/viewvc/llvm-project?rev=263896&view=rev
Log:
Mark C++ features implemented in Clang 3.8 as done now that 3.8 has released.

Modified:
cfe/trunk/www/cxx_status.html

Modified: cfe/trunk/www/cxx_status.html
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_status.html?rev=263896&r1=263895&r2=263896&view=diff
==
--- cfe/trunk/www/cxx_status.html (original)
+++ cfe/trunk/www/cxx_status.html Sun Mar 20 05:37:12 2016
@@ -567,7 +567,7 @@ as the draft C++1z standard evolves.
 
   New auto rules for direct-list-initialization
   http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3922.html";>N3922
-  Clang 3.8 (8)
+  Clang 3.8 (8)
 
 
 
@@ -603,12 +603,12 @@ as the draft C++1z standard evolves.
 
   Remove deprecated register storage class
   http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0001r1.html";>P0001R1
-  Clang 3.8
+  Clang 3.8
 
 
   Remove deprecated bool increment
   http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0002r1.html";>P0002R1
-  Clang 3.8
+  Clang 3.8
 
 
   Make exception specifications part of the type system


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


Re: [PATCH] D18300: [clang-tidy] ProTypeMemberInitCheck - check that field decls do not have in-class initializer

2016-03-20 Thread JVApen via cfe-commits
JVApen accepted this revision.
JVApen added a comment.
This revision is now accepted and ready to land.

I'm not sure if I'm the right person to do reviews, as I'm mostly a user of the 
tool and have not yet done any developments or bug fixes to it.
However, from what I know from coding, this looks good to me.


Repository:
  rL LLVM

http://reviews.llvm.org/D18300



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


Re: r263709 - clang-format: Slightly weaken AlignAfterOpenBracket=AlwaysBreak.

2016-03-20 Thread Jean-philippe Dufraigne via cfe-commits
Hi Daniel,

I'm not sure I understand the logic behind modifying 'AlwaysBreak' to be
'AlwaysBreakExceptForSingleArgument'.

AlwaysBreak is always going to lead to "wasted space".
Some consider consistently break to not be a waste but actually contribute
to readability, it seems that was what 'AlwaysBreak' was about.

Would you reconsider this change, or make it an option different from
'AlwaysBreak'?



We just completed the roll out clang-format at my company.
We are using: AlignAfterOpenBracket: AlwaysBreak
We tuned the settings to have a style that does not clash too much with our
original style, and that will look like a regression for us.

Kind regards,
Jean-Philippe.


2016-03-17 12:00 GMT+00:00 Daniel Jasper via cfe-commits <
cfe-commits@lists.llvm.org>:

> Author: djasper
> Date: Thu Mar 17 07:00:22 2016
> New Revision: 263709
>
> URL: http://llvm.org/viewvc/llvm-project?rev=263709&view=rev
> Log:
> clang-format: Slightly weaken AlignAfterOpenBracket=AlwaysBreak.
>
> If a call takes a single argument, using AlwaysBreak can lead to lots
> of wasted lines and additional indentation without improving the
> readability in a significant way.
>
> Before:
>   cll(
>   cll(
>   cll(
>   caaall(aa, a;
>
> After:
>   cll(cll(cll(
>   caaall(aa, a;
>
> Modified:
> cfe/trunk/lib/Format/ContinuationIndenter.cpp
> cfe/trunk/unittests/Format/FormatTest.cpp
>
> Modified: cfe/trunk/lib/Format/ContinuationIndenter.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/ContinuationIndenter.cpp?rev=263709&r1=263708&r2=263709&view=diff
>
> ==
> --- cfe/trunk/lib/Format/ContinuationIndenter.cpp (original)
> +++ cfe/trunk/lib/Format/ContinuationIndenter.cpp Thu Mar 17 07:00:22 2016
> @@ -356,7 +356,17 @@ void ContinuationIndenter::addTokenOnCur
>Previous.isOneOf(tok::l_paren, TT_TemplateOpener, tok::l_square) &&
>State.Column > getNewLineColumn(State) &&
>(!Previous.Previous ||
> -   !Previous.Previous->isOneOf(tok::kw_for, tok::kw_while,
> tok::kw_switch)))
> +   !Previous.Previous->isOneOf(tok::kw_for, tok::kw_while,
> +   tok::kw_switch)) &&
> +  // Don't do this for simple (no expressions) one-argument function
> calls
> +  // as that feels like needlessly wasting whitespace, e.g.:
> +  //
> +  //   cll(
> +  //   cll(
> +  //   cll(
> +  //   caaall(aa,
> a;
> +  Current.FakeLParens.size() > 0 &&
> +  Current.FakeLParens.back() > prec::Unknown)
>  State.Stack.back().NoLineBreak = true;
>
>if (Style.AlignAfterOpenBracket != FormatStyle::BAS_DontAlign &&
>
> Modified: cfe/trunk/unittests/Format/FormatTest.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=263709&r1=263708&r2=263709&view=diff
>
> ==
> --- cfe/trunk/unittests/Format/FormatTest.cpp (original)
> +++ cfe/trunk/unittests/Format/FormatTest.cpp Thu Mar 17 07:00:22 2016
> @@ -4461,12 +4461,31 @@ TEST_F(FormatTest, AlignsAfterOpenBracke
> "aaa a,\n"
> "a);",
> Style);
> -  verifyFormat("SomeLongVariableName->someFunction(\n"
> -   "f(\n"
> -   "aaa,\n"
> -   "a,\n"
> -   "a));",
> +  verifyFormat("SomeLongVariableName->someFunction(f(\n"
> +   "aaa,\n"
> +   "a,\n"
> +   "a));",
> Style);
> +  verifyFormat(
> +  "(a(\n"
> +  "(a, )));",
> +  Style);
> +  verifyFormat(
> +  "(aa.aa(\n"
> +  "(a, )));",
> +  Style);
> +  verifyFormat(
> +  "(\n"
> +  "a(\n"
> +  "(a,
> )),\n"
> +  ");",
> +  Style);
> +  verifyFormat(
> +  "(\n"
> +  "a(\n"
> +  "(a, ))
> &&\n"
> +  ");",
> +  Style);
>  }
>
>  TEST_F(FormatTest, ParenthesesAndOperandAlignment) {
>
>
> _

Re: [PATCH] D16360: unordered_map: Avoid unnecessary mallocs when no insert occurs

2016-03-20 Thread Duncan P. N. Exon Smith via cfe-commits
r263746.

> On 2016-Mar-17, at 13:36, Duncan P. N. Exon Smith via cfe-commits 
>  wrote:
> 
>> 
>> On 2016-Mar-16, at 15:41, Eric Fiselier  wrote:
>> 
>> EricWF accepted this revision.
>> EricWF added a comment.
>> This revision is now accepted and ready to land.
>> 
>> LGTM after change in inline comment.
>> 
>> 
>> 
>> Comment at: include/__hash_table:114
>> @@ +113,3 @@
>> +template 
>> +struct __can_extract_key<_Pair, _Key, pair<_First, _Second>>
>> +: conditional::type, _Key>::value,
>> 
>> `>>` needs to be `> >` for C++03.
> 
> Since __can_extract_key is only used when !defined(_LIBCPP_CXX03_LANG),
> I'll just move it behind an #ifdef (and leave the prettier `>>`).
> 
> I'll commit after running the tests with -std=c++03.
> 
>> 
>> http://reviews.llvm.org/D16360
>> 
>> 
>> 
> 
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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


Re: r263718 - Use a simpler set of mock headers for the vfs+modules crash recovery tests.

2016-03-20 Thread Bruno Cardoso Lopes via cfe-commits
Nice! Thanks Benjamin

On Thu, Mar 17, 2016 at 9:19 AM, Benjamin Kramer via cfe-commits
 wrote:
> Author: d0k
> Date: Thu Mar 17 11:19:51 2016
> New Revision: 263718
>
> URL: http://llvm.org/viewvc/llvm-project?rev=263718&view=rev
> Log:
> Use a simpler set of mock headers for the vfs+modules crash recovery tests.
>
> The System/ mock is large and too complex for this test. It can cause
> the tests to fail in mysterious ways as it depends on the resource dir
> being present, which is not really supported for driver tests (using
> %clang instead of %clang_cc1). Copy the tree and trim out all the
> %unnecessary fat.
>
> Added:
> cfe/trunk/test/Modules/Inputs/crash-recovery/
> cfe/trunk/test/Modules/Inputs/crash-recovery/usr/
> cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/
> cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/module.map
> cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/stdio.h
> cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/tcl-private/
> 
> cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/tcl-private/header.h
> Modified:
> cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m
> cfe/trunk/test/Modules/crash-vfs-path-traversal.m
>
> Added: cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/module.map
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/module.map?rev=263718&view=auto
> ==
> --- cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/module.map 
> (added)
> +++ cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/module.map Thu 
> Mar 17 11:19:51 2016
> @@ -0,0 +1,6 @@
> +module cstd [system] {
> +  // Only in system headers directory
> +  module stdio {
> +header "stdio.h"
> +  }
> +}
>
> Added: cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/stdio.h
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/stdio.h?rev=263718&view=auto
> ==
> --- cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/stdio.h (added)
> +++ cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/stdio.h Thu Mar 
> 17 11:19:51 2016
> @@ -0,0 +1,3 @@
> +typedef struct { int id; } FILE;
> +int fprintf(FILE*restrict, const char* restrict format, ...);
> +extern FILE *__stderrp;
>
> Added: 
> cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/tcl-private/header.h
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/tcl-private/header.h?rev=263718&view=auto
> ==
> --- 
> cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/tcl-private/header.h 
> (added)
> +++ 
> cfe/trunk/test/Modules/Inputs/crash-recovery/usr/include/tcl-private/header.h 
> Thu Mar 17 11:19:51 2016
> @@ -0,0 +1,2 @@
> +// tcl-private/header.h
> +#define TCL_PRIVATE 1
>
> Modified: cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m?rev=263718&r1=263717&r2=263718&view=diff
> ==
> --- cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m (original)
> +++ cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m Thu Mar 17 
> 11:19:51 2016
> @@ -8,7 +8,7 @@
>
>  // RUN: rm -rf %t
>  // RUN: mkdir -p %t/i %t/m %t %t/sysroot
> -// RUN: cp -a %S/Inputs/System/usr %t/i/
> +// RUN: cp -a %S/Inputs/crash-recovery/usr %t/i/
>  // RUN: ln -s include/tcl-private %t/i/usr/x
>
>  // RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
>
> Modified: cfe/trunk/test/Modules/crash-vfs-path-traversal.m
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/crash-vfs-path-traversal.m?rev=263718&r1=263717&r2=263718&view=diff
> ==
> --- cfe/trunk/test/Modules/crash-vfs-path-traversal.m (original)
> +++ cfe/trunk/test/Modules/crash-vfs-path-traversal.m Thu Mar 17 11:19:51 2016
> @@ -9,7 +9,7 @@
>  // RUN: mkdir -p %t/i %t/m %t
>
>  // RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
> -// RUN: %clang -fsyntax-only %s -I %S/Inputs/System -isysroot %/t/i/\
> +// RUN: %clang -fsyntax-only %s -I %S/Inputs/crash-recovery -isysroot %/t/i/ 
>\
>  // RUN: -fmodules -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s
>
>  // RUN: FileCheck --check-prefix=CHECKSRC %s -input-file %t/crash-vfs-*.m
> @@ -17,7 +17,7 @@
>  // RUN: FileCheck --check-prefix=CHECKYAML %s -input-file \
>  // RUN: %t/crash-vfs-*.cache/vfs/vfs.yaml
>  // RUN: find %t/crash-vfs-*.cache/vfs | \
> -// RUN:   grep "Inputs/System/usr/include/stdio.h" | count 1
> +// RUN:   grep "Inputs/crash-rec

Re: r263893 - Reapply [2] [VFS] Add 'overlay-relative' field to YAML files

2016-03-20 Thread Benjamin Kramer via cfe-commits
On Sun, Mar 20, 2016 at 3:08 AM, Bruno Cardoso Lopes via cfe-commits
 wrote:
> Author: bruno
> Date: Sat Mar 19 21:08:48 2016
> New Revision: 263893
>
> URL: http://llvm.org/viewvc/llvm-project?rev=263893&view=rev
> Log:
> Reapply [2] [VFS] Add 'overlay-relative' field to YAML files
>
> This reapplies r261552 and r263748. Fixed testcase to reapply.
>
> The VFS overlay mapping between virtual paths and real paths is done through
> the 'external-contents' entries in YAML files, which contains hardcoded paths
> to the real files.
>
> When a module compilation crashes, headers are dumped into .cache/vfs
> directory and are mapped via the .cache/vfs/vfs.yaml. The script
> generated for reproduction uses -ivfsoverlay pointing to file to gather the
> mapping between virtual paths and files inside .cache/vfs. Currently, we
> are only capable of reproducing such crashes in the same machine as they
> happen, because of the hardcoded paths in 'external-contents'.
>
> To be able to reproduce a crash in another machine, this patch introduces a 
> new
> option in the VFS yaml file called 'overlay-relative'. When it's equal to
> 'true' it means that the provided path to the YAML file through the
> -ivfsoverlay option should also be used to prefix the final path for every
> 'external-contents'.
>
> Example, given the invocation snippet "... -ivfsoverlay
> .cache/vfs/vfs.yaml" and the following entry in the yaml file:
>
> "overlay-relative": "true",
> "roots": [
> ...
>   "type": "directory",
>   "name": "/usr/include",
>   "contents": [
> {
>   "type": "file",
>   "name": "stdio.h",
>   "external-contents": "/usr/include/stdio.h"
> },
> ...
>
> Here, a file manager request for virtual "/usr/include/stdio.h", that will map
> into real path "//.cache/vfs/usr/include/stdio.h.
>
> This is a useful feature for debugging module crashes in machines other than
> the one where the error happened.
>
> Differential Revision: http://reviews.llvm.org/D17457
>
> rdar://problem/24499339
>
> Added:
> cfe/trunk/test/Modules/crash-vfs-relative-overlay.m
>   - copied, changed from r263888, 
> cfe/trunk/test/Modules/crash-vfs-path-traversal.m
> Modified:
> cfe/trunk/include/clang/Basic/VirtualFileSystem.h
> cfe/trunk/lib/Basic/VirtualFileSystem.cpp
> cfe/trunk/lib/Frontend/CompilerInvocation.cpp
> cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp
> cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m
> cfe/trunk/test/Modules/crash-vfs-path-traversal.m
> cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp
>
> Modified: cfe/trunk/include/clang/Basic/VirtualFileSystem.h
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/VirtualFileSystem.h?rev=263893&r1=263892&r2=263893&view=diff
> ==
> --- cfe/trunk/include/clang/Basic/VirtualFileSystem.h (original)
> +++ cfe/trunk/include/clang/Basic/VirtualFileSystem.h Sat Mar 19 21:08:48 2016
> @@ -310,6 +310,7 @@ llvm::sys::fs::UniqueID getNextVirtualUn
>  IntrusiveRefCntPtr
>  getVFSFromYAML(std::unique_ptr Buffer,
> llvm::SourceMgr::DiagHandlerTy DiagHandler,
> +   StringRef YAMLFilePath,
> void *DiagContext = nullptr,
> IntrusiveRefCntPtr ExternalFS = 
> getRealFileSystem());
>
> @@ -323,6 +324,8 @@ struct YAMLVFSEntry {
>  class YAMLVFSWriter {
>std::vector Mappings;
>Optional IsCaseSensitive;
> +  Optional IsOverlayRelative;
> +  std::string OverlayDir;
>
>  public:
>YAMLVFSWriter() {}
> @@ -330,6 +333,11 @@ public:
>void setCaseSensitivity(bool CaseSensitive) {
>  IsCaseSensitive = CaseSensitive;
>}
> +  void setOverlayDir(StringRef OverlayDirectory) {
> +IsOverlayRelative = true;
> +OverlayDir.assign(OverlayDirectory.str());
> +  }
> +
>void write(llvm::raw_ostream &OS);
>  };
>
>
> Modified: cfe/trunk/lib/Basic/VirtualFileSystem.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/VirtualFileSystem.cpp?rev=263893&r1=263892&r2=263893&view=diff
> ==
> --- cfe/trunk/lib/Basic/VirtualFileSystem.cpp (original)
> +++ cfe/trunk/lib/Basic/VirtualFileSystem.cpp Sat Mar 19 21:08:48 2016
> @@ -780,6 +780,7 @@ public:
>  /// All configuration options are optional.
>  ///   'case-sensitive': 
>  ///   'use-external-names': 
> +///   'overlay-relative': 
>  ///
>  /// Virtual directories are represented as
>  /// \verbatim
> @@ -819,6 +820,10 @@ class RedirectingFileSystem : public vfs
>std::vector> Roots;
>/// \brief The file system to use for external references.
>IntrusiveRefCntPtr ExternalFS;
> +  /// If IsRelativeOverlay is set, this represents the directory
> +  /// path that should be prefixed to each 'external-contents' entry
> +  /// when reading from YAML files.
> +  std::string ExternalContentsPrefixDir;
>
>/// @name Configuration
>//

Re: [PATCH] D17746: Fix PR26741 -- __builtin_object_size is not consistently conservative with C++ inheritance

2016-03-20 Thread Joerg Sonnenberger via cfe-commits
On Fri, Mar 18, 2016 at 05:11:19PM +, Richard Smith via cfe-commits wrote:
> rsmith added a comment.
> 
> Can you explain a bit more about the problem? It seems to me that if I have:
> 
>   struct Base {
> char k[1];
>   };
>   struct Derived : Base {};
> 
> ... then the 'k' subobject of a `Derived` object is known to be exactly 1 
> byte long -- it doesn't seem obviously appropriate for our flexible-sized 
> trailing array support to cover this case.

I don't think we special case C++ for the "[1] means flexible trailing
array" check?

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


Re: [PATCH] D17950: Implement is_always_lock_free

2016-03-20 Thread Joerg Sonnenberger via cfe-commits
On Fri, Mar 18, 2016 at 12:11:22PM -0500, Craig, Ben via cfe-commits wrote:
> A lot of it is a frontend decision.  What goes in the libcall feels an awful
> lot like the 386 vs 486 example that I hear a lot.  If I want one binary
> that can run on both a 386 (very limited atomic support) and a 486 (a bit
> more atomic support), then I generate the binary such that it has library
> calls to atomic routines.  The library on the 386 uses the global lock
> shard, and the library on the 486 uses native instructions.  The same kind
> of thing would apply for one byte atomics when only four byte atomics have
> hardware support.  The library call would use the lock shard as the default.
> If the platform doesn't have byte granularity memory protection a different,
> lockless implementation could be used that loads the surrounding four bytes
> instead and does all the masking.

The situation here is quite different. If you have a way to do lock-free
CAS for 32bit, you can implement it for 16bit and 8bit as well. On other
hand, if you do not have a lock-free CAS of a given size, it can be
implemented as lock-free libcall only if (a) no such MP configuration
exists and (b) (non-atomic) load/store of that size is supported. I'm
not even sure if such a thing as a SMP i386 ever existed, given that the
APIC specifications are all for i486 and later.

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


Re: [PATCH] D18271: Avoid -Wshadow warnings about constructor parameters named after fields

2016-03-20 Thread Reid Kleckner via cfe-commits
rnk added a comment.

I'm not sure your example is in scope for -Wshadow, though. Any function call 
that takes a non-const reference to the parameter could modify it. I guess I'm 
thinking something like:

  void trim_in_place(std::string &s);
  struct A {
std::string s;
A(std::string s) : s(s) { trim_in_place(s); }
  };

I think if we try to match that we'll have too many false positives.

I think your example would be better caught by something like -Wconsumed that 
looks for uses of objects that have been moved-from. That warning won't be 
confused by shadowing and will give a better diagnostic anyway.


http://reviews.llvm.org/D18271



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


[libcxxabi] r263699 - [libcxxabi] Disable cxa_thread_atexit_test if unavailable

2016-03-20 Thread Jonas Hahnfeld via cfe-commits
Author: hahnfeld
Date: Thu Mar 17 05:00:24 2016
New Revision: 263699

URL: http://llvm.org/viewvc/llvm-project?rev=263699&view=rev
Log:
[libcxxabi] Disable cxa_thread_atexit_test if unavailable

The feature check is already in place when building the library but wasn't
honored for the tests.

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

Modified:
libcxxabi/trunk/test/CMakeLists.txt
libcxxabi/trunk/test/cxa_thread_atexit_test.pass.cpp
libcxxabi/trunk/test/libcxxabi/test/config.py
libcxxabi/trunk/test/lit.site.cfg.in

Modified: libcxxabi/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/CMakeLists.txt?rev=263699&r1=263698&r2=263699&view=diff
==
--- libcxxabi/trunk/test/CMakeLists.txt (original)
+++ libcxxabi/trunk/test/CMakeLists.txt Thu Mar 17 05:00:24 2016
@@ -10,6 +10,7 @@ pythonize_bool(LLVM_BUILD_32_BITS)
 pythonize_bool(LIBCXXABI_ENABLE_SHARED)
 pythonize_bool(LIBCXXABI_ENABLE_THREADS)
 pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
+pythonize_bool(LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL)
 set(LIBCXXABI_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING
 "TargetInfo to use when setting up test environment.")
 set(LIBCXXABI_EXECUTOR "None" CACHE STRING

Modified: libcxxabi/trunk/test/cxa_thread_atexit_test.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/cxa_thread_atexit_test.pass.cpp?rev=263699&r1=263698&r2=263699&view=diff
==
--- libcxxabi/trunk/test/cxa_thread_atexit_test.pass.cpp (original)
+++ libcxxabi/trunk/test/cxa_thread_atexit_test.pass.cpp Thu Mar 17 05:00:24 
2016
@@ -8,6 +8,7 @@
 
//===--===//
 
 // REQUIRES: linux
+// REQUIRES: thread_atexit
 
 #include 
 #include 

Modified: libcxxabi/trunk/test/libcxxabi/test/config.py
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/libcxxabi/test/config.py?rev=263699&r1=263698&r2=263699&view=diff
==
--- libcxxabi/trunk/test/libcxxabi/test/config.py (original)
+++ libcxxabi/trunk/test/libcxxabi/test/config.py Thu Mar 17 05:00:24 2016
@@ -33,6 +33,11 @@ class Configuration(LibcxxConfiguration)
 self.libcxxabi_obj_root = self.get_lit_conf('libcxxabi_obj_root')
 super(Configuration, self).configure_obj_root()
 
+def configure_features(self):
+super(Configuration, self).configure_features()
+if self.get_lit_bool('thread_atexit', True):
+self.config.available_features.add('thread_atexit')
+
 def configure_compile_flags(self):
 self.cxx.compile_flags += ['-DLIBCXXABI_NO_TIMER']
 self.cxx.compile_flags += ['-funwind-tables']

Modified: libcxxabi/trunk/test/lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/lit.site.cfg.in?rev=263699&r1=263698&r2=263699&view=diff
==
--- libcxxabi/trunk/test/lit.site.cfg.in (original)
+++ libcxxabi/trunk/test/lit.site.cfg.in Thu Mar 17 05:00:24 2016
@@ -13,6 +13,7 @@ config.use_sanitizer= "@LLVM
 config.enable_32bit = "@LLVM_BUILD_32_BITS@"
 config.target_info  = "@LIBCXXABI_TARGET_INFO@"
 config.executor = "@LIBCXXABI_EXECUTOR@"
+config.thread_atexit= "@LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL@"
 
 # Let the main config do the real work.
 lit_config.load_config(config, "@LIBCXXABI_SOURCE_DIR@/test/lit.cfg")


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


Re: [PATCH] D17950: Implement is_always_lock_free

2016-03-20 Thread Craig, Ben via cfe-commits


On 3/18/2016 11:54 AM, JF Bastien wrote:


Some architectures support byte granularity memory protection.
Accessing unsolicited bytes can cause a trap on those architectures.

I think it makes sense for atomic and Atomic to get
turned into the 4 byte __atomic intrinsics.  Those 4 byte __atomic
intrinsics can then get lowered to efficient inlined code. If
someone has a regular char, and they use the __atomic or __sync
intrinsics directly, I'm fine with that going to a lib call.  The
lib call can then either use the global lock shard, or access
extra data, depending on what is reasonable for that platform.


That all sounds like something the frontend has to decide on based on 
what the target is.


A lot of it is a frontend decision.  What goes in the libcall feels an 
awful lot like the 386 vs 486 example that I hear a lot.  If I want one 
binary that can run on both a 386 (very limited atomic support) and a 
486 (a bit more atomic support), then I generate the binary such that it 
has library calls to atomic routines.  The library on the 386 uses the 
global lock shard, and the library on the 486 uses native instructions.  
The same kind of thing would apply for one byte atomics when only four 
byte atomics have hardware support.  The library call would use the lock 
shard as the default. If the platform doesn't have byte granularity 
memory protection a different, lockless implementation could be used 
that loads the surrounding four bytes instead and does all the masking.


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

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


Re: r263895 - P0184R0: Allow types of 'begin' and 'end' expressions in range-based for loops to differ.

2016-03-20 Thread Renato Golin via cfe-commits
On 20 March 2016 at 11:33, Richard Smith via cfe-commits
 wrote:
> Author: rsmith
> Date: Sun Mar 20 05:33:40 2016
> New Revision: 263895
>
> URL: http://llvm.org/viewvc/llvm-project?rev=263895&view=rev
> Log:
> P0184R0: Allow types of 'begin' and 'end' expressions in range-based for 
> loops to differ.


Hi Richard,

This has broken *all* ARM and AArch64 buildbots, and your subsequent
patch didn't fix it:

http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/10816

http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15/builds/10867

http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/5591

http://lab.llvm.org:8011/builders/clang-cmake-aarch64-42vma/builds/6842

The bots don't even build, so it'd be good if you could fix this
quickly or revert for further investigations.

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


[clang-tools-extra] r263900 - [clang-tidy] Update check for API change in r263895.

2016-03-20 Thread Benjamin Kramer via cfe-commits
Author: d0k
Date: Sun Mar 20 09:24:49 2016
New Revision: 263900

URL: http://llvm.org/viewvc/llvm-project?rev=263900&view=rev
Log:
[clang-tidy] Update check for API change in r263895.

for range stmts now have split begin and ends, just apply OR to the
condition. Should unbreak the build.

Modified:

clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp

Modified: 
clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp?rev=263900&r1=263899&r2=263900&view=diff
==
--- 
clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp
 (original)
+++ 
clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp
 Sun Mar 20 09:24:49 2016
@@ -18,8 +18,10 @@ namespace tidy {
 
 AST_MATCHER_P(CXXForRangeStmt, hasRangeBeginEndStmt,
   ast_matchers::internal::Matcher, InnerMatcher) {
-  const DeclStmt *const Stmt = Node.getBeginEndStmt();
-  return (Stmt != nullptr && InnerMatcher.matches(*Stmt, Finder, Builder));
+  for (const DeclStmt *Stmt : {Node.getBeginStmt(), Node.getEndStmt()})
+if (Stmt != nullptr && InnerMatcher.matches(*Stmt, Finder, Builder))
+  return true;
+  return false;
 }
 
 AST_MATCHER(Stmt, isInsideOfRangeBeginEndStmt) {


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


Re: [PATCH] D18163: Add visualizers for more clang types. Create more C++-like visualizations for existing Clang types

2016-03-20 Thread Mike Spertus via cfe-commits
mspertus added a comment.

Committed as revision 263638. At Chandler's suggestion, I am going to send an 
announcement to cfe-dev letting people know of all of the recent improvements 
to native visualizers


http://reviews.llvm.org/D18163



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


Re: [PATCH] D18149: Add check for unneeded copies of locals

2016-03-20 Thread Matt Kulukundis via cfe-commits
fowles marked 4 inline comments as done.
fowles added a comment.

http://reviews.llvm.org/D18149



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


Re: [PATCH] D18238: [clang-tidy] Fix clang-tidy crashes when using -fdelayed-template-parsing.

2016-03-20 Thread Aaron Ballman via cfe-commits
aaron.ballman added a subscriber: aaron.ballman.


Comment at: cppcoreguidelines/ProTypeMemberInitCheck.cpp:183
@@ +182,3 @@
+  // Skip delayed template instantiation declarations.
+  const auto *Body = Ctor->getBody();
+  if (!Body)

Please do not use auto here since the type isn't spelled out in the 
initializer. (The line directly above it also should not be using auto either.)


Comment at: modernize/RedundantVoidArgCheck.cpp:108
@@ -107,3 +107,3 @@
 SourceLocation End;
-if (Function->hasBody())
-  End = Function->getBody()->getLocStart().getLocWithOffset(-1);
+const auto *Body = Function->getBody();
+if (Body)

Don't use auto here either.


Comment at: modernize/RedundantVoidArgCheck.cpp:109
@@ +108,3 @@
+const auto *Body = Function->getBody();
+if (Body)
+  End = Body->getLocStart().getLocWithOffset(-1);

You could get rid of the if and else and just use it directly in 
removeVoidArgumentTokens().
```
removeVoidArgumentTokens(Result, SourceRange(Start, Body ? 
Body->getLocStart().getLocWithOffset(-1) : Function-getLocEnd()), "function 
definition");
```


http://reviews.llvm.org/D18238



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


r263730 - Fix implicit copy ctor and copy assignment operator warnings when -Wdeprecated passed.

2016-03-20 Thread David Blaikie via cfe-commits
Author: dblaikie
Date: Thu Mar 17 13:05:07 2016
New Revision: 263730

URL: http://llvm.org/viewvc/llvm-project?rev=263730&view=rev
Log:
Fix implicit copy ctor and copy assignment operator warnings when -Wdeprecated 
passed.

Fix implicit copy ctor and copy assignment operator warnings
when -Wdeprecated passed.

Patch by Don Hinton!

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

Modified:
cfe/trunk/include/clang/AST/UnresolvedSet.h
cfe/trunk/include/clang/Sema/Lookup.h

Modified: cfe/trunk/include/clang/AST/UnresolvedSet.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/UnresolvedSet.h?rev=263730&r1=263729&r2=263730&view=diff
==
--- cfe/trunk/include/clang/AST/UnresolvedSet.h (original)
+++ cfe/trunk/include/clang/AST/UnresolvedSet.h Thu Mar 17 13:05:07 2016
@@ -59,8 +59,11 @@ class UnresolvedSetImpl {
   // UnresolvedSet.
 private:
   template  friend class UnresolvedSet;
-  UnresolvedSetImpl() {}
-  UnresolvedSetImpl(const UnresolvedSetImpl &) {}
+  UnresolvedSetImpl() = default;
+  UnresolvedSetImpl(const UnresolvedSetImpl &) = default;
+  UnresolvedSetImpl(UnresolvedSetImpl &&) = default;
+  UnresolvedSetImpl &operator=(const UnresolvedSetImpl &) = default;
+  UnresolvedSetImpl &operator=(UnresolvedSetImpl &&) = default;
 
 public:
   // We don't currently support assignment through this iterator, so we might

Modified: cfe/trunk/include/clang/Sema/Lookup.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Lookup.h?rev=263730&r1=263729&r2=263730&view=diff
==
--- cfe/trunk/include/clang/Sema/Lookup.h (original)
+++ cfe/trunk/include/clang/Sema/Lookup.h Thu Mar 17 13:05:07 2016
@@ -185,6 +185,11 @@ public:
   Shadowed(false)
   {}
 
+  // FIXME: Remove these deleted methods once the default build includes
+  // -Wdeprecated.
+  LookupResult(const LookupResult &) = delete;
+  LookupResult &operator=(const LookupResult &) = delete;
+
   ~LookupResult() {
 if (Diagnose) diagnose();
 if (Paths) deletePaths(Paths);


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


Re: [PATCH] D18300: [clang-tidy] ProTypeMemberInitCheck - check that field decls do not have in-class initializer

2016-03-20 Thread Aaron Ballman via cfe-commits
aaron.ballman added a subscriber: aaron.ballman.
aaron.ballman added a reviewer: aaron.ballman.


Comment at: test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp:94
@@ +93,3 @@
+  bool Bool{false};
+  // CHECK-FIXES: bool Bool{false};
+};

Why is this checking a fix? I thought that point was that this should not 
generate any diagnostic (and hence, no fix is required)?


Repository:
  rL LLVM

http://reviews.llvm.org/D18300



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


Re: [PATCH] D18297: Visualizer for clang::FunctionProtoType

2016-03-20 Thread Aaron Ballman via cfe-commits
On Sat, Mar 19, 2016 at 8:29 PM, Mike Spertus  wrote:
> mspertus added a comment.
>
> Based on Aaron's agreement to conducting post-commit reviews, I've committed 
> this as revision 263890. Please let me know if I should not have done so. 
> (This change is a lot smaller and simpler than I feared when I commented on 
> my roadmap in diff http://reviews.llvm.org/D18270, so I think this is a good 
> inaugural post-commit review for me).

Changes in r263890 look good to me. Finding a way to generalize
instead of specifying parameter counts manually would be nice but the
way your commit does it is a reasonable first pass.

Thanks!

~Aaron

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


[PATCH] D18303: Visual Studio Visualizers for clang::FunctionDecl

2016-03-20 Thread Mike Spertus via cfe-commits
mspertus created this revision.
mspertus added reviewers: aaron.ballman, zturner.
mspertus added a subscriber: cfe-commits.

Displays a FunctionDecl in the Visual Studio Locals Window something like:

  void g(int, double d, struct A && arr)

http://reviews.llvm.org/D18303

Files:
  clang.natvis

Index: clang.natvis
===
--- clang.natvis
+++ clang.natvis
@@ -137,6 +137,7 @@
   
   
+{ResultType,view(cpp)}
 
 {*(clang::QualType 
*)(this+1),view(cpp)}{*this,view(parm1)}
 
@@ -149,7 +150,7 @@
 , {*((clang::QualType 
*)(this+1)+4),view(cpp)}{*this,view(parm5)}
 
 , /* expand for more params 
*/
-{ResultType,view(cpp)}({*this,view(parm0)})
+{*this,view(retType)}({*this,view(parm0)})
 
   ResultType
   
@@ -234,6 +235,7 @@
 
   
   
+
 Empty
 {*(clang::IdentifierInfo *)(Ptr & 
~PtrMask)}
 {{Identifier ({*(clang::IdentifierInfo *)(Ptr & 
~PtrMask)})}}
@@ -270,12 +272,50 @@
   (clang::VarDecl::InitializationStyle)InitStyle
 
   
+  
+{DeclType,view(cpp)} {Name,view(cpp)}
+  
   
-{Name}
+{*(DeclaratorDecl*)this,nd}
 
   *(DeclaratorDecl*)this,nd
   VarDeclBits
+
+  
+  
+{*(VarDecl*)this,nd}
+
   ParmVarDeclBits
+  *(VarDecl*)this,nd
+
+  
+  
+{*(clang::FunctionProtoType 
*)((clang::ExtQualsTypeCommonBase *)(((uintptr_t)DeclType.Value.Value) & 
~15))->BaseType,view(retType)}
+
+{*ParamInfo[0]}{*this,view(parm1)}
+
+, 
{*ParamInfo[1]}{*this,view(parm2)}
+
+, 
{*ParamInfo[2]}{*this,view(parm3)}
+
+, 
{*ParamInfo[3]}{*this,view(parm4)}
+
+, 
{*ParamInfo[4]}{*this,view(parm5)}
+
+, /* expand for more params 
*/
+{*this,view(retType)} 
{Name,view(cpp)}({*this,view(parm0)})
+
+  *this,view(retType)
+  
+{*this,view(parm0)}
+
+  
+((clang::FunctionProtoType *)((clang::ExtQualsTypeCommonBase 
*)(((uintptr_t)DeclType.Value.Value) & 
~15))->BaseType)->NumParams
+ParamInfo
+  
+
+  
+  *(clang::Type *)this, view(cmn)
 
   
   


Index: clang.natvis
===
--- clang.natvis
+++ clang.natvis
@@ -137,6 +137,7 @@
   
   
+{ResultType,view(cpp)}
 
 {*(clang::QualType *)(this+1),view(cpp)}{*this,view(parm1)}
 
@@ -149,7 +150,7 @@
 , {*((clang::QualType *)(this+1)+4),view(cpp)}{*this,view(parm5)}
 
 , /* expand for more params */
-{ResultType,view(cpp)}({*this,view(parm0)})
+{*this,view(retType)}({*this,view(parm0)})
 
   ResultType
   
@@ -234,6 +235,7 @@
 
   
   
+
 Empty
 {*(clang::IdentifierInfo *)(Ptr & ~PtrMask)}
 {{Identifier ({*(clang::IdentifierInfo *)(Ptr & ~PtrMask)})}}
@@ -270,12 +272,50 @@
   (clang::VarDecl::InitializationStyle)InitStyle
 
   
+  
+{DeclType,view(cpp)} {Name,view(cpp)}
+  
   
-{Name}
+{*(DeclaratorDecl*)this,nd}
 
   *(DeclaratorDecl*)this,nd
   VarDeclBits
+
+  
+  
+{*(VarDecl*)this,nd}
+
   ParmVarDeclBits
+  *(VarDecl*)this,nd
+
+  
+  
+{*(clang::FunctionProtoType *)((clang::ExtQualsTypeCommonBase *)(((uintptr_t)DeclType.Value.Value) & ~15))->BaseType,view(retType)}
+
+{*ParamInfo[0]}{*this,view(parm1)}
+
+, {*ParamInfo[1]}{*this,view(parm2)}
+
+, {*ParamInfo[2]}{*this,view(parm3)}
+
+, {*ParamInfo[3]}{*this,view(parm4)}
+
+, {*ParamInfo[4]}{*this,view(parm5)}
+
+, /* expand for more params */
+{*this,view(retType)} {Name,view(cpp)}({*this,view(parm0)})
+
+  *this,view(retType)
+  
+{*this,view(parm0)}
+
+  
+((clang::FunctionProtoType *)((clang::ExtQualsTypeCommonBase *)(((uintptr_t)DeclType.Value.Value) & ~15))->BaseType)->NumParams
+ParamInfo
+  
+
+  
+  *(clang::Type *)this, view(cmn)
 
   
   
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17986: [ASTMatchers] New matcher hasReturnValue added

2016-03-20 Thread Balogh , Ádám via cfe-commits
baloghadamsoftware updated this revision to Diff 50932.
baloghadamsoftware added a comment.

Previous patch generation failed.


http://reviews.llvm.org/D17986

Files:
  include/clang/ASTMatchers/ASTMatchers.h
  lib/ASTMatchers/Dynamic/Registry.cpp
  unittests/ASTMatchers/ASTMatchersTest.cpp

Index: unittests/ASTMatchers/ASTMatchersTest.cpp
===
--- unittests/ASTMatchers/ASTMatchersTest.cpp
+++ unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -5385,5 +5385,11 @@
   EXPECT_TRUE(notMatches("int i = 0;", expr(nullPointerConstant(;
 }
 
+TEST(StatementMatcher, HasReturnValue) {
+  StatementMatcher RetVal = returnStmt(hasReturnValue(binaryOperator()));
+  EXPECT_TRUE(matches("int F() { return a+b; }", RetVal));
+  EXPECT_FALSE(matches("int F() { return a; }", RetVal));
+}
+
 } // end namespace ast_matchers
 } // end namespace clang
Index: lib/ASTMatchers/Dynamic/Registry.cpp
===
--- lib/ASTMatchers/Dynamic/Registry.cpp
+++ lib/ASTMatchers/Dynamic/Registry.cpp
@@ -238,6 +238,7 @@
   REGISTER_MATCHER(hasQualifier);
   REGISTER_MATCHER(hasRangeInit);
   REGISTER_MATCHER(hasReceiverType);
+  REGISTER_MATCHER(hasReturnValue);
   REGISTER_MATCHER(hasRHS);
   REGISTER_MATCHER(hasSelector);
   REGISTER_MATCHER(hasSingleDecl);
Index: include/clang/ASTMatchers/ASTMatchers.h
===
--- include/clang/ASTMatchers/ASTMatchers.h
+++ include/clang/ASTMatchers/ASTMatchers.h
@@ -4841,6 +4841,26 @@
   return false;
 }
 
+/// \brief Matches the return value expression of a return statement
+///
+/// Given
+/// \code
+///   return a+b;
+/// \endcode
+/// hasReturnValue(binaryOperator())
+///   matches 'return a+b'
+/// with binaryOperator()
+///   matching 'a+b'
+AST_MATCHER_P(ReturnStmt, hasReturnValue, internal::Matcher, 
InnerMatcher) {
+  BoundNodesTreeBuilder Result(*Builder);
+  if(InnerMatcher.matches(*Node.getRetValue(), Finder, &Result)) {
+*Builder = std::move(Result);
+return true;
+  }
+  return false;
+}
+
+
 /// \brief Matches CUDA kernel call expression.
 ///
 /// Example matches,


Index: unittests/ASTMatchers/ASTMatchersTest.cpp
===
--- unittests/ASTMatchers/ASTMatchersTest.cpp
+++ unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -5385,5 +5385,11 @@
   EXPECT_TRUE(notMatches("int i = 0;", expr(nullPointerConstant(;
 }
 
+TEST(StatementMatcher, HasReturnValue) {
+  StatementMatcher RetVal = returnStmt(hasReturnValue(binaryOperator()));
+  EXPECT_TRUE(matches("int F() { return a+b; }", RetVal));
+  EXPECT_FALSE(matches("int F() { return a; }", RetVal));
+}
+
 } // end namespace ast_matchers
 } // end namespace clang
Index: lib/ASTMatchers/Dynamic/Registry.cpp
===
--- lib/ASTMatchers/Dynamic/Registry.cpp
+++ lib/ASTMatchers/Dynamic/Registry.cpp
@@ -238,6 +238,7 @@
   REGISTER_MATCHER(hasQualifier);
   REGISTER_MATCHER(hasRangeInit);
   REGISTER_MATCHER(hasReceiverType);
+  REGISTER_MATCHER(hasReturnValue);
   REGISTER_MATCHER(hasRHS);
   REGISTER_MATCHER(hasSelector);
   REGISTER_MATCHER(hasSingleDecl);
Index: include/clang/ASTMatchers/ASTMatchers.h
===
--- include/clang/ASTMatchers/ASTMatchers.h
+++ include/clang/ASTMatchers/ASTMatchers.h
@@ -4841,6 +4841,26 @@
   return false;
 }
 
+/// \brief Matches the return value expression of a return statement
+///
+/// Given
+/// \code
+///   return a+b;
+/// \endcode
+/// hasReturnValue(binaryOperator())
+///   matches 'return a+b'
+/// with binaryOperator()
+///   matching 'a+b'
+AST_MATCHER_P(ReturnStmt, hasReturnValue, internal::Matcher, InnerMatcher) {
+  BoundNodesTreeBuilder Result(*Builder);
+  if(InnerMatcher.matches(*Node.getRetValue(), Finder, &Result)) {
+*Builder = std::move(Result);
+return true;
+  }
+  return false;
+}
+
+
 /// \brief Matches CUDA kernel call expression.
 ///
 /// Example matches,
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17951: Implement is_always_lock_free

2016-03-20 Thread Ben Craig via cfe-commits
bcraig added a comment.

Visual Studio has a flag, /Zc:wchar_t-, that turns wchar_t into a short.  This 
flag is for people that need to maintain ABI compatibility with ancient Visual 
Studios (MSVC6? MSVC5?).  It is definitely non-conformant, and many things 
support it poorly.

I still have nightmares of supporting boost::filesystem users where 
boost::filesystem was built with real wchar_t, but clients tried to use it with 
wchar_t as short.  The linker generally disapproved of those shenanigans.

I'm totally fine if libcxx doesn't try to support this situation... but if it 
did want to support it, it would need to selectively not define wchar_t.


http://reviews.llvm.org/D17951



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


Re: [PATCH] D16965: Fix for Bug 14644 - clang confuses scope operator for global namespace giving extra qualification on member

2016-03-20 Thread Ryan Yee via cfe-commits
ryee88 added a comment.

In http://reviews.llvm.org/D16965#377864, @dblaikie wrote:

> Not sure I fully understand the issue with the existing diagnostic/change in 
> wording.
>
> '::' is a nested name specifier, even if it's a degenerate case, I think - so 
> the old wording doesn't seem wrong, as such (& the new text seems correct in 
> the other cases too - should we just switch to that in general rather than 
> having two cases?)


Yes that's the basically the issue raised in the bug report. The error wording 
for the degenerate nested name specifier is unclear. I'll tinker around with a 
generic wording.


http://reviews.llvm.org/D16965



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


Re: [PATCH] D9888: [OPENMP] Driver support for OpenMP offloading

2016-03-20 Thread Samuel Antao via cfe-commits
sfantao added a comment.

Hi Richard,

Thanks for your review. I partitioned some of the stuff I am proposing here in 
smaller patches:

http://reviews.llvm.org/D18170
http://reviews.llvm.org/D18171
http://reviews.llvm.org/D18172

These patches already try to incorporate the feedback I got in 
http://lists.llvm.org/pipermail/cfe-dev/2016-February/047547.html related with 
the generation of actions.

Thanks again,
Samuel



Comment at: include/clang/Driver/Options.td:1617-1618
@@ -1616,2 +1616,4 @@
   HelpText<"Write output to ">, MetaVarName<"">;
+def omptargets_EQ : CommaJoined<["-"], "omptargets=">, Flags<[DriverOption, 
CC1Option]>,
+  HelpText<"Specify comma-separated list of triples OpenMP offloading targets 
to be supported">;
 def pagezero__size : JoinedOrSeparate<["-"], "pagezero_size">;

rsmith wrote:
> This is an unfortunate flag name; `-oblah` already means something. Is this 
> name chosen for compatibility with some other system, or could we change it 
> to, say, `-fopenmp-targets=`?
You are right, we are now using -fomptargets in codegen exactly because of 
that. I can change it to `-fopenmp-targets=` we don't have any compatibility 
issues at this point.


Comment at: lib/Driver/Tools.cpp:316
@@ +315,3 @@
+  // Add commands to embed target binaries. We ensure that each section and
+  // image s 16-byte aligned. This is not mandatory, but increases the
+  // likelihood of data to be aligned with a cache block in several main host

rsmith wrote:
> s -> is
I'll fix it.


http://reviews.llvm.org/D9888



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


Re: [PATCH] D18303: Visual Studio Visualizers for clang::FunctionDecl

2016-03-20 Thread Aaron Ballman via cfe-commits
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

If we can find a way to do DisplayString loops, then such a cleanup would be 
welcome here as well. However, that can always be a follow-up patch if someone 
discovers a good way to do that.

LGTM!


http://reviews.llvm.org/D18303



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


r263908 - Fixed -Wdocumentation warning

2016-03-20 Thread Simon Pilgrim via cfe-commits
Author: rksimon
Date: Sun Mar 20 11:25:23 2016
New Revision: 263908

URL: http://llvm.org/viewvc/llvm-project?rev=263908&view=rev
Log:
Fixed -Wdocumentation warning

Modified:
cfe/trunk/include/clang/Frontend/FrontendAction.h

Modified: cfe/trunk/include/clang/Frontend/FrontendAction.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/FrontendAction.h?rev=263908&r1=263907&r2=263908&view=diff
==
--- cfe/trunk/include/clang/Frontend/FrontendAction.h (original)
+++ cfe/trunk/include/clang/Frontend/FrontendAction.h Sun Mar 20 11:25:23 2016
@@ -130,7 +130,7 @@ public:
   const FrontendInputFile &getCurrentInput() const {
 return CurrentInput;
   }
-  
+
   const StringRef getCurrentFile() const {
 assert(!CurrentInput.isEmpty() && "No current file!");
 return CurrentInput.getFile();
@@ -157,7 +157,7 @@ public:
   /// @name Supported Modes
   /// @{
 
-  /// \brief Is this action invoked on a model file? 
+  /// \brief Is this action invoked on a model file?
   ///
   /// Model files are incomplete translation units that relies on type
   /// information from another translation unit. Check ParseModelFileAction for
@@ -251,10 +251,10 @@ public:
  const std::vector &arg) = 0;
 
   enum ActionType {
-Cmdline, //< Action is determined by the cc1 command-line
-ReplaceAction,   //< Replace the main action
-AddBeforeMainAction, //< Execute the action before the main action
-AddAfterMainAction   //< Execute the action after the main action
+Cmdline, ///< Action is determined by the cc1 command-line
+ReplaceAction,   ///< Replace the main action
+AddBeforeMainAction, ///< Execute the action before the main action
+AddAfterMainAction   ///< Execute the action after the main action
   };
   /// \brief Get the action type for this plugin
   ///


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


Re: [PATCH] D18300: [clang-tidy] ProTypeMemberInitCheck - check that field decls do not have in-class initializer

2016-03-20 Thread Felix Berger via cfe-commits
flx added inline comments.


Comment at: test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp:94
@@ +93,3 @@
+  bool Bool{false};
+  // CHECK-FIXES: bool Bool{false};
+};

aaron.ballman wrote:
> Why is this checking a fix? I thought that point was that this should not 
> generate any diagnostic (and hence, no fix is required)?
If I understood Alex correctly, CHECK-FIXES is needed to check for the absence 
of a change made by ClangTidy. But I agree it seems unlikely to have a change 
without a warning message which will trigger a test failure at any rate.


Repository:
  rL LLVM

http://reviews.llvm.org/D18300



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


r263909 - AST: Fix some bogus indentation. NFC

2016-03-20 Thread Justin Bogner via cfe-commits
Author: bogner
Date: Sun Mar 20 11:58:03 2016
New Revision: 263909

URL: http://llvm.org/viewvc/llvm-project?rev=263909&view=rev
Log:
AST: Fix some bogus indentation. NFC

Noticed by Liu Xin. Thanks!

Modified:
cfe/trunk/lib/AST/ASTImporter.cpp

Modified: cfe/trunk/lib/AST/ASTImporter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=263909&r1=263908&r2=263909&view=diff
==
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)
+++ cfe/trunk/lib/AST/ASTImporter.cpp Sun Mar 20 11:58:03 2016
@@ -619,8 +619,8 @@ static bool IsStructurallyEquivalent(Str
 if (!IsStructurallyEquivalent(Context, Function1->getReturnType(),
   Function2->getReturnType()))
   return false;
-  if (Function1->getExtInfo() != Function2->getExtInfo())
-return false;
+if (Function1->getExtInfo() != Function2->getExtInfo())
+  return false;
 break;
   }



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


r263912 - [VFS] Fix test to use more restrict set of headers

2016-03-20 Thread Bruno Cardoso Lopes via cfe-commits
Author: bruno
Date: Sun Mar 20 13:08:32 2016
New Revision: 263912

URL: http://llvm.org/viewvc/llvm-project?rev=263912&view=rev
Log:
[VFS] Fix test to use more restrict set of headers

Modified:
cfe/trunk/test/Modules/crash-vfs-relative-overlay.m

Modified: cfe/trunk/test/Modules/crash-vfs-relative-overlay.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/crash-vfs-relative-overlay.m?rev=263912&r1=263911&r2=263912&view=diff
==
--- cfe/trunk/test/Modules/crash-vfs-relative-overlay.m (original)
+++ cfe/trunk/test/Modules/crash-vfs-relative-overlay.m Sun Mar 20 13:08:32 2016
@@ -7,7 +7,7 @@
 // RUN: mkdir -p %t/i %t/m %t
 
 // RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
-// RUN: %clang -fsyntax-only %s -I %S/Inputs/System -isysroot %/t/i/\
+// RUN: %clang -fsyntax-only %s -I %S/Inputs/crash-recovery -isysroot %/t/i/   
 \
 // RUN: -fmodules -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s
 
 // RUN: FileCheck --check-prefix=CHECKSRC %s -input-file %t/crash-vfs-*.m
@@ -15,7 +15,7 @@
 // RUN: FileCheck --check-prefix=CHECKYAML %s -input-file \
 // RUN: %t/crash-vfs-*.cache/vfs/vfs.yaml
 // RUN: find %t/crash-vfs-*.cache/vfs | \
-// RUN:   grep "Inputs/System/usr/include/stdio.h" | count 1
+// RUN:   grep "Inputs/crash-recovery/usr/include/stdio.h" | count 1
 
 #include "usr/include/stdio.h"
 
@@ -35,20 +35,20 @@
 // CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
 
 // CHECKYAML: 'type': 'directory'
-// CHECKYAML: 'name': "/[[PATH:.*]]/Inputs/System/usr/include",
+// CHECKYAML: 'name': "/[[PATH:.*]]/Inputs/crash-recovery/usr/include",
 // CHECKYAML-NEXT: 'contents': [
 // CHECKYAML-NEXT:   {
 // CHECKYAML-NEXT: 'type': 'file',
 // CHECKYAML-NEXT: 'name': "module.map",
 // CHECKYAML-NOT:  'external-contents': "{{[^ ]*}}.cache
-// CHECKYAML-NEXT: 'external-contents': 
"/[[PATH]]/Inputs/System/usr/include/module.map"
+// CHECKYAML-NEXT: 'external-contents': 
"/[[PATH]]/Inputs/crash-recovery/usr/include/module.map"
 // CHECKYAML-NEXT:   },
 
 // Test that reading the YAML file will yield the correct path after
 // the overlay dir is prefixed to access headers in .cache/vfs directory.
 
 // RUN: unset FORCE_CLANG_DIAGNOSTICS_CRASH
-// RUN: %clang -E %s -I %S/Inputs/System -isysroot %/t/i/ \
+// RUN: %clang -E %s -I %S/Inputs/crash-recovery -isysroot %/t/i/ \
 // RUN: -ivfsoverlay %t/crash-vfs-*.cache/vfs/vfs.yaml -fmodules \
 // RUN: -fmodules-cache-path=%t/m/ 2>&1 \
 // RUN: | FileCheck %s --check-prefix=CHECKOVERLAY


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


Re: r263893 - Reapply [2] [VFS] Add 'overlay-relative' field to YAML files

2016-03-20 Thread Bruno Cardoso Lopes via cfe-commits
>>  // RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
>> -// RUN: %clang -fsyntax-only %s -I %S/Inputs/crash-recovery -isysroot 
>> %/t/i/\
>> +// RUN: %clang -fsyntax-only %s -I %S/Inputs/System -isysroot %/t/i/\
>
> Is this an intentional revert? Test fails for me again because it
> fails to find float.h, which is not generally available to %clang in
> tests.

Nope, fixed back in r263912. Thanks

-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D18304: [DarwinDriver] Increase the number of valid digits for ld version string

2016-03-20 Thread Bruno Cardoso Lopes via cfe-commits
bruno created this revision.
bruno added reviewers: bob.wilson, dexonsmith.
bruno added a subscriber: cfe-commits.

Previously only 3 digits were valid. Increase it to 5.

http://reviews.llvm.org/D18304

Files:
  include/clang/Driver/Driver.h
  lib/Driver/Driver.cpp
  lib/Driver/Tools.cpp
  test/Driver/darwin-ld.c

Index: test/Driver/darwin-ld.c
===
--- test/Driver/darwin-ld.c
+++ test/Driver/darwin-ld.c
@@ -303,3 +303,27 @@
 // RUN:   FileCheck --check-prefix=LINK-IFRAMEWORK %s
 // LINK-IFRAMEWORK: {{ld(.exe)?"}}
 // LINK-IFRAMEWORK: "-FBar"
+
+// Check ld64 accepts up to 5 digits with no extra characters
+// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \
+// RUN:   -mlinker-version=133.3 2> %t.log
+// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \
+// RUN:   -mlinker-version=133.3.0 2>> %t.log
+// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \
+// RUN:   -mlinker-version=133.3.0.1 2>> %t.log
+// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \
+// RUN:   -mlinker-version=133.3.0.1.2 2>> %t.log
+// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \
+// RUN:   -mlinker-version=133.3.0.1.2.6 2>> %t.log
+// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \
+// RUN:   -mlinker-version=133.3.0.1.a 2>> %t.log
+// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \
+// RUN:   -mlinker-version=133.3.0.1a 2>> %t.log
+// RUN: FileCheck -check-prefix=LINK_VERSION_DIGITS %s < %t.log
+// LINK_VERSION_DIGITS-NOT: invalid version number in '-mlinker-version=133.3'
+// LINK_VERSION_DIGITS-NOT: invalid version number in '-mlinker-version=133.3.0'
+// LINK_VERSION_DIGITS-NOT: invalid version number in '-mlinker-version=133.3.0.1'
+// LINK_VERSION_DIGITS-NOT: invalid version number in '-mlinker-version=133.3.0.1.2'
+// LINK_VERSION_DIGITS: invalid version number in '-mlinker-version=133.3.0.1.2.6'
+// LINK_VERSION_DIGITS: invalid version number in '-mlinker-version=133.3.0.1.a'
+// LINK_VERSION_DIGITS: invalid version number in '-mlinker-version=133.3.0.1a'
Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -7221,12 +7221,11 @@
   const Driver &D = getToolChain().getDriver();
   const toolchains::MachO &MachOTC = getMachOToolChain();
 
-  unsigned Version[3] = {0, 0, 0};
+  unsigned Version[5] = {0, 0, 0, 0, 0};
   if (Arg *A = Args.getLastArg(options::OPT_mlinker_version_EQ)) {
-bool HadExtra;
-if (!Driver::GetReleaseVersion(A->getValue(), Version[0], Version[1],
-   Version[2], HadExtra) ||
-HadExtra)
+if (!Driver::GetReleaseVersion(
+A->getValue(), sizeof(Version) / sizeof(Version[0]) /*MaxDigits*/,
+Version))
   D.Diag(diag::err_drv_invalid_version_number) << A->getAsString(Args);
   }
 
Index: lib/Driver/Driver.cpp
===
--- lib/Driver/Driver.cpp
+++ lib/Driver/Driver.cpp
@@ -2533,6 +2533,33 @@
   return true;
 }
 
+/// Parse \p MaxDigits digits from a string \p Str containing a
+/// release version.
+///
+/// \return True if the entire string was parsed and there are
+/// no extra characters remaining at the end.
+bool Driver::GetReleaseVersion(const char *Str, unsigned MaxDigits,
+   MutableArrayRef Digits) {
+  if (*Str == '\0')
+return false;
+
+  char *End;
+  unsigned CurDigit = 0;
+  while (CurDigit < MaxDigits) {
+unsigned Digit = (unsigned)strtol(Str, &End, 10);
+Digits[CurDigit] = Digit;
+if (*Str != '\0' && *End == '\0')
+  return true;
+if (*End != '.' || Str == End)
+  return false;
+Str = End + 1;
+CurDigit++;
+  }
+
+  // More digits than requested, bail out...
+  return false;
+}
+
 std::pair Driver::getIncludeExcludeOptionFlagMasks() const {
   unsigned IncludedFlagsBitmask = 0;
   unsigned ExcludedFlagsBitmask = options::NoDriverOption;
Index: include/clang/Driver/Driver.h
===
--- include/clang/Driver/Driver.h
+++ include/clang/Driver/Driver.h
@@ -475,6 +475,14 @@
   static bool GetReleaseVersion(const char *Str, unsigned &Major,
 unsigned &Minor, unsigned &Micro,
 bool &HadExtra);
+
+  /// Parse \p MaxDigits digits from a string \p Str containing a
+  /// release version.
+  ///
+  /// \return True if the entire string was parsed and there are
+  /// no extra characters remaining at the end.
+  static bool GetReleaseVersion(const char *Str, unsigned MaxDigits,
+MutableArrayRef Digits);
 };
 
 /// \return True if the last defined optimization level is -Ofast.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r263913 - [tsan] Allow -fsanitize=thread for iOS-style simulator targets

2016-03-20 Thread Devin Coughlin via cfe-commits
Author: dcoughlin
Date: Sun Mar 20 13:24:33 2016
New Revision: 263913

URL: http://llvm.org/viewvc/llvm-project?rev=263913&view=rev
Log:
[tsan] Allow -fsanitize=thread for iOS-style simulator targets

Update the clang driver to allow -fsanitize=thread when targeting x86_64 iOS 
and tvOS
simulators. Also restrict TSan targeting OS X to only be supported on x86_64 
and not i386.

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

Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/test/Driver/fsanitize.c

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=263913&r1=263912&r2=263913&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Sun Mar 20 13:24:33 2016
@@ -1225,13 +1225,18 @@ void Darwin::CheckObjCARC() const {
 }
 
 SanitizerMask Darwin::getSupportedSanitizers() const {
+  const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64;
   SanitizerMask Res = ToolChain::getSupportedSanitizers();
   Res |= SanitizerKind::Address;
   if (isTargetMacOS()) {
 if (!isMacosxVersionLT(10, 9))
   Res |= SanitizerKind::Vptr;
 Res |= SanitizerKind::SafeStack;
-Res |= SanitizerKind::Thread;
+if (IsX86_64)
+  Res |= SanitizerKind::Thread;
+  } else if (isTargetIOSSimulator() || isTargetTvOSSimulator()) {
+if (IsX86_64)
+  Res |= SanitizerKind::Thread;
   }
   return Res;
 }

Modified: cfe/trunk/test/Driver/fsanitize.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fsanitize.c?rev=263913&r1=263912&r2=263913&view=diff
==
--- cfe/trunk/test/Driver/fsanitize.c (original)
+++ cfe/trunk/test/Driver/fsanitize.c Sun Mar 20 13:24:33 2016
@@ -217,6 +217,27 @@
 // CHECK-TSAN-MSAN-MSAN-DARWIN: unsupported option '-fsanitize=memory' for 
target 'x86_64-apple-darwin10'
 // CHECK-TSAN-MSAN-MSAN-DARWIN-NOT: unsupported option
 
+// RUN: %clang -target x86_64-apple-darwin -fsanitize=thread %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-TSAN-X86-64-DARWIN
+// CHECK-TSAN-X86-64-DARWIN-NOT: unsupported option
+
+// RUN: %clang -target x86_64-apple-iossimulator -fsanitize=thread %s -### 
2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-IOSSIMULATOR
+// CHECK-TSAN-X86-64-IOSSIMULATOR-NOT: unsupported option
+
+// RUN: %clang -target x86_64-apple-tvossimulator -fsanitize=thread %s -### 
2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-TVOSSIMULATOR
+// CHECK-TSAN-X86-64-TVOSSIMULATOR-NOT: unsupported option
+
+// RUN: %clang -target i386-apple-darwin -fsanitize=thread %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-TSAN-I386-DARWIN
+// CHECK-TSAN-I386-DARWIN: unsupported option '-fsanitize=thread' for target 
'i386-apple-darwin'
+
+// RUN: %clang -target arm-apple-ios -fsanitize=thread %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-TSAN-ARM-IOS
+// CHECK-TSAN-ARM-IOS: unsupported option '-fsanitize=thread' for target 
'arm-apple-ios'
+
+// RUN: %clang -target i386-apple-iossimulator -fsanitize=thread %s -### 2>&1 
| FileCheck %s --check-prefix=CHECK-TSAN-I386-IOSSIMULATOR
+// CHECK-TSAN-I386-IOSSIMULATOR: unsupported option '-fsanitize=thread' for 
target 'i386-apple-iossimulator'
+
+// RUN: %clang -target i386-apple-tvossimulator -fsanitize=thread %s -### 2>&1 
| FileCheck %s --check-prefix=CHECK-TSAN-I386-TVOSSIMULATOR
+// CHECK-TSAN-I386-TVOSSIMULATOR: unsupported option '-fsanitize=thread' for 
target 'i386-apple-tvossimulator'
+
 // RUN: %clang -target x86_64-apple-darwin10 -fsanitize=function %s -### 2>&1 
| FileCheck %s --check-prefix=CHECK-FSAN-DARWIN
 // CHECK-FSAN-DARWIN: unsupported option '-fsanitize=function' for target 
'x86_64-apple-darwin10'
 


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


Re: [PATCH] D18280: [tsan] Allow -fsanitize=thread for iOS-style simulator targets

2016-03-20 Thread Devin Coughlin via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL263913: [tsan] Allow -fsanitize=thread for iOS-style 
simulator targets (authored by dcoughlin).

Changed prior to commit:
  http://reviews.llvm.org/D18280?vs=51076&id=51132#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D18280

Files:
  cfe/trunk/lib/Driver/ToolChains.cpp
  cfe/trunk/test/Driver/fsanitize.c

Index: cfe/trunk/test/Driver/fsanitize.c
===
--- cfe/trunk/test/Driver/fsanitize.c
+++ cfe/trunk/test/Driver/fsanitize.c
@@ -217,6 +217,27 @@
 // CHECK-TSAN-MSAN-MSAN-DARWIN: unsupported option '-fsanitize=memory' for 
target 'x86_64-apple-darwin10'
 // CHECK-TSAN-MSAN-MSAN-DARWIN-NOT: unsupported option
 
+// RUN: %clang -target x86_64-apple-darwin -fsanitize=thread %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-TSAN-X86-64-DARWIN
+// CHECK-TSAN-X86-64-DARWIN-NOT: unsupported option
+
+// RUN: %clang -target x86_64-apple-iossimulator -fsanitize=thread %s -### 
2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-IOSSIMULATOR
+// CHECK-TSAN-X86-64-IOSSIMULATOR-NOT: unsupported option
+
+// RUN: %clang -target x86_64-apple-tvossimulator -fsanitize=thread %s -### 
2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-TVOSSIMULATOR
+// CHECK-TSAN-X86-64-TVOSSIMULATOR-NOT: unsupported option
+
+// RUN: %clang -target i386-apple-darwin -fsanitize=thread %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-TSAN-I386-DARWIN
+// CHECK-TSAN-I386-DARWIN: unsupported option '-fsanitize=thread' for target 
'i386-apple-darwin'
+
+// RUN: %clang -target arm-apple-ios -fsanitize=thread %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-TSAN-ARM-IOS
+// CHECK-TSAN-ARM-IOS: unsupported option '-fsanitize=thread' for target 
'arm-apple-ios'
+
+// RUN: %clang -target i386-apple-iossimulator -fsanitize=thread %s -### 2>&1 
| FileCheck %s --check-prefix=CHECK-TSAN-I386-IOSSIMULATOR
+// CHECK-TSAN-I386-IOSSIMULATOR: unsupported option '-fsanitize=thread' for 
target 'i386-apple-iossimulator'
+
+// RUN: %clang -target i386-apple-tvossimulator -fsanitize=thread %s -### 2>&1 
| FileCheck %s --check-prefix=CHECK-TSAN-I386-TVOSSIMULATOR
+// CHECK-TSAN-I386-TVOSSIMULATOR: unsupported option '-fsanitize=thread' for 
target 'i386-apple-tvossimulator'
+
 // RUN: %clang -target x86_64-apple-darwin10 -fsanitize=function %s -### 2>&1 
| FileCheck %s --check-prefix=CHECK-FSAN-DARWIN
 // CHECK-FSAN-DARWIN: unsupported option '-fsanitize=function' for target 
'x86_64-apple-darwin10'
 
Index: cfe/trunk/lib/Driver/ToolChains.cpp
===
--- cfe/trunk/lib/Driver/ToolChains.cpp
+++ cfe/trunk/lib/Driver/ToolChains.cpp
@@ -1225,13 +1225,18 @@
 }
 
 SanitizerMask Darwin::getSupportedSanitizers() const {
+  const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64;
   SanitizerMask Res = ToolChain::getSupportedSanitizers();
   Res |= SanitizerKind::Address;
   if (isTargetMacOS()) {
 if (!isMacosxVersionLT(10, 9))
   Res |= SanitizerKind::Vptr;
 Res |= SanitizerKind::SafeStack;
-Res |= SanitizerKind::Thread;
+if (IsX86_64)
+  Res |= SanitizerKind::Thread;
+  } else if (isTargetIOSSimulator() || isTargetTvOSSimulator()) {
+if (IsX86_64)
+  Res |= SanitizerKind::Thread;
   }
   return Res;
 }


Index: cfe/trunk/test/Driver/fsanitize.c
===
--- cfe/trunk/test/Driver/fsanitize.c
+++ cfe/trunk/test/Driver/fsanitize.c
@@ -217,6 +217,27 @@
 // CHECK-TSAN-MSAN-MSAN-DARWIN: unsupported option '-fsanitize=memory' for target 'x86_64-apple-darwin10'
 // CHECK-TSAN-MSAN-MSAN-DARWIN-NOT: unsupported option
 
+// RUN: %clang -target x86_64-apple-darwin -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-DARWIN
+// CHECK-TSAN-X86-64-DARWIN-NOT: unsupported option
+
+// RUN: %clang -target x86_64-apple-iossimulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-IOSSIMULATOR
+// CHECK-TSAN-X86-64-IOSSIMULATOR-NOT: unsupported option
+
+// RUN: %clang -target x86_64-apple-tvossimulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-TVOSSIMULATOR
+// CHECK-TSAN-X86-64-TVOSSIMULATOR-NOT: unsupported option
+
+// RUN: %clang -target i386-apple-darwin -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-I386-DARWIN
+// CHECK-TSAN-I386-DARWIN: unsupported option '-fsanitize=thread' for target 'i386-apple-darwin'
+
+// RUN: %clang -target arm-apple-ios -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-ARM-IOS
+// CHECK-TSAN-ARM-IOS: unsupported option '-fsanitize=thread' for target 'arm-apple-ios'
+
+// RUN: %clang -target i386-apple-iossimulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-I386-IOSSIMULATOR
+// CHECK-TSAN-I386-IOSSIMULATOR: unsupported option '-fsanitize=thread' for target 'i38

Re: [PATCH] D18297: Visualizer for clang::FunctionProtoType

2016-03-20 Thread Mike Spertus via cfe-commits
mspertus accepted this revision.
mspertus added a reviewer: mspertus.
mspertus added a comment.
This revision is now accepted and ready to land.

Accepting revision based on Aaron's LGTM email to reviews.llvm.org.


http://reviews.llvm.org/D18297



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


Re: [PATCH] D18297: Visualizer for clang::FunctionProtoType

2016-03-20 Thread Mike Spertus via cfe-commits
mspertus closed this revision.
mspertus added a comment.

Closing committed revision. Further discussion as needed on mailing list


http://reviews.llvm.org/D18297



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


Re: [PATCH] D18299: Better visualization of clang::BuiltinType in VisualStudio

2016-03-20 Thread Mike Spertus via cfe-commits
mspertus accepted this revision.
mspertus added a reviewer: mspertus.
mspertus added a comment.
This revision is now accepted and ready to land.

Per Aaron, I want to close the committed diff, but I seem to need to accept it 
first. Further discussion as needed on mailing list


http://reviews.llvm.org/D18299



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


Re: [PATCH] D18299: Better visualization of clang::BuiltinType in VisualStudio

2016-03-20 Thread Mike Spertus via cfe-commits
mspertus closed this revision.
mspertus added a comment.

Closing committed revision


http://reviews.llvm.org/D18299



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


r263915 - Visual Studio Visualizers for clang::FunctionDecl

2016-03-20 Thread Mike Spertus via cfe-commits
Author: mps
Date: Sun Mar 20 15:15:23 2016
New Revision: 263915

URL: http://llvm.org/viewvc/llvm-project?rev=263915&view=rev
Log:
Visual Studio Visualizers for clang::FunctionDecl

Readably displays a FunctionDecl in the Visual Studio Locals Window something 
like:
  void g(int, double d, struct A && arr)



Modified:
cfe/trunk/utils/clang.natvis

Modified: cfe/trunk/utils/clang.natvis
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/clang.natvis?rev=263915&r1=263914&r2=263915&view=diff
==
--- cfe/trunk/utils/clang.natvis (original)
+++ cfe/trunk/utils/clang.natvis Sun Mar 20 15:15:23 2016
@@ -137,6 +137,7 @@ or create a symbolic link so it updates
   
   
+{ResultType,view(cpp)}
 
 {*(clang::QualType 
*)(this+1),view(cpp)}{*this,view(parm1)}
 
@@ -149,7 +150,7 @@ or create a symbolic link so it updates
 , {*((clang::QualType 
*)(this+1)+4),view(cpp)}{*this,view(parm5)}
 
 , /* expand for more params 
*/
-{ResultType,view(cpp)}({*this,view(parm0)})
+{*this,view(retType)}({*this,view(parm0)})
 
   ResultType
   
@@ -234,6 +235,7 @@ or create a symbolic link so it updates
 
   
   
+
 Empty
 {*(clang::IdentifierInfo *)(Ptr & 
~PtrMask)}
 {{Identifier ({*(clang::IdentifierInfo *)(Ptr & 
~PtrMask)})}}
@@ -270,12 +272,50 @@ or create a symbolic link so it updates
   (clang::VarDecl::InitializationStyle)InitStyle
 
   
+  
+{DeclType,view(cpp)} {Name,view(cpp)}
+  
   
-{Name}
+{*(DeclaratorDecl*)this,nd}
 
   *(DeclaratorDecl*)this,nd
   VarDeclBits
+
+  
+  
+{*(VarDecl*)this,nd}
+
   ParmVarDeclBits
+  *(VarDecl*)this,nd
+
+  
+  
+{*(clang::FunctionProtoType 
*)((clang::ExtQualsTypeCommonBase *)(((uintptr_t)DeclType.Value.Value) & 
~15))->BaseType,view(retType)}
+
+{*ParamInfo[0]}{*this,view(parm1)}
+
+, 
{*ParamInfo[1]}{*this,view(parm2)}
+
+, 
{*ParamInfo[2]}{*this,view(parm3)}
+
+, 
{*ParamInfo[3]}{*this,view(parm4)}
+
+, 
{*ParamInfo[4]}{*this,view(parm5)}
+
+, /* expand for more params 
*/
+{*this,view(retType)} 
{Name,view(cpp)}({*this,view(parm0)})
+
+  *this,view(retType)
+  
+{*this,view(parm0)}
+
+  
+((clang::FunctionProtoType *)((clang::ExtQualsTypeCommonBase 
*)(((uintptr_t)DeclType.Value.Value) & 
~15))->BaseType)->NumParams
+ParamInfo
+  
+
+  
+  *(clang::Type *)this, view(cmn)
 
   
   


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


Re: [PATCH] D18303: Visual Studio Visualizers for clang::FunctionDecl

2016-03-20 Thread Mike Spertus via cfe-commits
mspertus added a comment.

Committed as revision 263915.


http://reviews.llvm.org/D18303



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


Re: [PATCH] D18303: Visual Studio Visualizers for clang::FunctionDecl

2016-03-20 Thread Mike Spertus via cfe-commits
mspertus closed this revision.
mspertus added a comment.

Closing accepted revision


http://reviews.llvm.org/D18303



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


Re: r263895 - P0184R0: Allow types of 'begin' and 'end' expressions in range-based for loops to differ.

2016-03-20 Thread Richard Smith via cfe-commits
On Sun, Mar 20, 2016 at 7:05 AM, Renato Golin  wrote:
> On 20 March 2016 at 11:33, Richard Smith via cfe-commits
>  wrote:
>> Author: rsmith
>> Date: Sun Mar 20 05:33:40 2016
>> New Revision: 263895
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=263895&view=rev
>> Log:
>> P0184R0: Allow types of 'begin' and 'end' expressions in range-based for 
>> loops to differ.
>
>
> Hi Richard,
>
> This has broken *all* ARM and AArch64 buildbots,

Looks like Ben fixed this in r263900. Sorry for the delay, plane
started boarding before the bots complained and I've been in transit
ever since...

> and your subsequent
> patch didn't fix it:
>
> http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/10816
>
> http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15/builds/10867
>
> http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/5591
>
> http://lab.llvm.org:8011/builders/clang-cmake-aarch64-42vma/builds/6842
>
> The bots don't even build, so it'd be good if you could fix this
> quickly or revert for further investigations.
>
> cheers,
> --renato
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17746: Fix PR26741 -- __builtin_object_size is not consistently conservative with C++ inheritance

2016-03-20 Thread Richard Smith via cfe-commits
On Sun, Mar 20, 2016 at 6:25 AM, Joerg Sonnenberger via cfe-commits
 wrote:
> On Fri, Mar 18, 2016 at 05:11:19PM +, Richard Smith via cfe-commits wrote:
>> rsmith added a comment.
>>
>> Can you explain a bit more about the problem? It seems to me that if I have:
>>
>>   struct Base {
>> char k[1];
>>   };
>>   struct Derived : Base {};
>>
>> ... then the 'k' subobject of a `Derived` object is known to be exactly 1 
>> byte long -- it doesn't seem obviously appropriate for our flexible-sized 
>> trailing array support to cover this case.
>
> I don't think we special case C++ for the "[1] means flexible trailing
> array" check?

No. But while we do look through the last field's type when checking
for a flexible array member, we don't look through any base classes
(which is obviously a C++-specific situation). Our behavior here seems
consistent with that (and with GCC's).
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r263920 - clang-cl: Add a comment about /Oy- (see r245913).

2016-03-20 Thread Nico Weber via cfe-commits
Author: nico
Date: Sun Mar 20 21:48:05 2016
New Revision: 263920

URL: http://llvm.org/viewvc/llvm-project?rev=263920&view=rev
Log:
clang-cl: Add a comment about /Oy- (see r245913).

Modified:
cfe/trunk/include/clang/Driver/CLCompatOptions.td

Modified: cfe/trunk/include/clang/Driver/CLCompatOptions.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CLCompatOptions.td?rev=263920&r1=263919&r2=263920&view=diff
==
--- cfe/trunk/include/clang/Driver/CLCompatOptions.td (original)
+++ cfe/trunk/include/clang/Driver/CLCompatOptions.td Sun Mar 20 21:48:05 2016
@@ -98,6 +98,7 @@ def _SLASH_I : CLJoinedOrSeparate<"I">,
 def _SLASH_J : CLFlag<"J">, HelpText<"Make char type unsigned">,
   Alias;
 def _SLASH_O0 : CLFlag<"O0">, Alias;
+// /Oy- is handled by the /O option because /Oy- only has an effect on 32-bit.
 def _SLASH_O : CLJoined<"O">, HelpText<"Optimization level">;
 def _SLASH_Ob0 : CLFlag<"Ob0">, HelpText<"Disable inlining">,
   Alias;


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


Re: [PATCH] D16749: [OpenMP] Map clause codegeneration.

2016-03-20 Thread Alexey Bataev via cfe-commits
Samuel, this is true for device part of codegen. But what about host? If 
this code must be executed on host, will it be handled correctly?

Best regards,
Alexey Bataev
=
Software Engineer
Intel Compiler Team

18.03.2016 23:03, Samuel Antao пишет:
> sfantao added a comment.
>
> Hi Alexey,
>
> I am sorry but I don't think I am following. So in your example:
>
>#pragma omp target map(to: this->A)
>[]()->void {++A}();
>
> the map clause is going to make sure the runtime library allocates the 
> section of `this` that contains A and that is what is used in the device. 
> There are no new instances of A created inside the kernel. If you do:
>
>#pragma omp target
>[]()->void {++A}();
>
> what the lambda is going to get would be the same (except that runtime had 
> eventually to copy more data to the device), so the map clause has no effect 
> in how captures are dealt with inside. All the map clause does is to inform 
> the runtime about sizes and addresses and change the captures to byCopy when 
> necessary, it does not create new instances of data inside the kernel. Maybe 
> what you are proposing is meant for (first)private?
>
> Thanks,
> Samuel
>
>
> http://reviews.llvm.org/D16749
>
>
>

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


Re: [PATCH] D18276: [OpenMP] Allow reduction on pointer dereference

2016-03-20 Thread Alexey Bataev via cfe-commits
ABataev added inline comments.


Comment at: lib/CodeGen/CGStmtOpenMP.cpp:913-929
@@ -912,9 +912,19 @@
 });
-  } else if (auto *ASE = dyn_cast(IRef)) {
-auto *Base = ASE->getBase()->IgnoreParenImpCasts();
-while (auto *TempASE = dyn_cast(Base))
-  Base = TempASE->getBase()->IgnoreParenImpCasts();
+  } else if (isa(IRef) || isa(IRef)) {
+const Expr *Array;
+const Expr *Base;
+if (auto* ASE = dyn_cast(IRef)) {
+  Array = ASE;
+  Base = ASE->getBase()->IgnoreParenImpCasts();
+  while (auto *TempASE = dyn_cast(Base))
+Base = TempASE->getBase()->IgnoreParenImpCasts();
+} else {
+  auto* UO = cast(IRef);
+  assert(UO->getOpcode() == UO_Deref && "should be a dereference");
+  Array = UO;
+  Base = UO->getSubExpr()->IgnoreParenImpCasts();
+}
 auto *DE = cast(Base);
 auto *OrigVD = cast(DE->getDecl());
-auto ASELValue = EmitLValue(ASE);
+auto ASELValue = EmitLValue(Array);
 auto OriginalBaseLValue = EmitLValue(DE);

This is not allowed by OpenMP standard. I added support for array subscripts 
because they are very similar to array sections, but unary operations are 
definitely not allowed


http://reviews.llvm.org/D18276



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


Re: [PATCH] D18286: [OPENMP] private and firstprivate clauses of teams code generation for nvptx

2016-03-20 Thread Alexey Bataev via cfe-commits
ABataev added inline comments.


Comment at: lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp:53-57
@@ -52,2 +52,7 @@
   auto &&CodeGen = [&D](CodeGenFunction &CGF) {
+CodeGenFunction::OMPPrivateScope PrivateScope(CGF);
+(void)CGF.EmitOMPFirstprivateClause(D, PrivateScope);
+CGF.EmitOMPPrivateClause(D, PrivateScope);
+(void)PrivateScope.Privatize();
+
 CGF.EmitStmt(cast(D.getAssociatedStmt())->getCapturedStmt());

After some investigation I found out that this the same code, that a;ready 
exists in CodeGenFunction::EmitOMPTeamsDirective(). 
I think you must remove emitTeamsCall() from CGOpenMPRuntimeNVPTX class and 
modify CodeGenFunction::EmitOMPTeamsDirective() like this:
```
void CodeGenFunction::EmitOMPTeamsDirective(const OMPTeamsDirective &S) {
  OMPLexicalScope(*this, S);
  // Emit parallel region as a standalone region.
  auto &&CodeGen = [&S](CodeGenFunction &CGF) {
OMPPrivateScope PrivateScope(CGF);
(void)CGF.EmitOMPFirstprivateClause(S, PrivateScope);
CGF.EmitOMPPrivateClause(S, PrivateScope);
(void)PrivateScope.Privatize();
CGF.EmitStmt(cast(S.getAssociatedStmt())->getCapturedStmt());
  };
  if (getLangOpts().OpenMPIsDevice)
emitInlinedDirective(CGF, OMPD_teams, CodeGen);
  else
emitCommonOMPTeamsDirective(*this, S, OMPD_teams, CodeGen);
}
```


Repository:
  rL LLVM

http://reviews.llvm.org/D18286



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


Re: [PATCH] D17955: [OpenCL] Fix pipe builtin bugs

2016-03-20 Thread Xiuli PAN via cfe-commits
pxli168 updated this revision to Diff 51140.
pxli168 added a comment.

Refine other check using the changed diag.
Change test as well.


http://reviews.llvm.org/D17955

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/Sema/SemaChecking.cpp
  test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl

Index: test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
===
--- test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
+++ test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
@@ -7,20 +7,20 @@
   // read/write_pipe
   read_pipe(tmp, p);// expected-error {{first argument to 'read_pipe' must be a pipe type}}
   read_pipe(p);   // expected-error {{invalid number of arguments to function: 'read_pipe'}}
-  read_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'reserve_id_t')}}
-  read_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'unsigned int')}}
-  read_pipe(p, tmp);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'int *')}}
+  read_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'reserve_id_t' having 'int')}}
+  read_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'unsigned int' having 'reserve_id_t')}}
+  read_pipe(p, tmp);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'int *' having 'int')}}
   write_pipe(p, ptr);// expected-error {{invalid pipe access modifier (expecting write_only)}}
   write_pipe(p, rid, tmp, ptr);// expected-error {{invalid pipe access modifier (expecting write_only)}}
 
   // reserve_read/write_pipe
-  reserve_read_pipe(p, ptr);// expected-error{{invalid argument type to function 'reserve_read_pipe' (expecting 'unsigned int')}}
+  reserve_read_pipe(p, ptr);// expected-error{{invalid argument type to function 'reserve_read_pipe' (expecting 'unsigned int' having '__global int *')}}
   work_group_reserve_read_pipe(tmp, tmp);// expected-error{{first argument to 'work_group_reserve_read_pipe' must be a pipe type}}
   sub_group_reserve_write_pipe(p, tmp);// expected-error{{invalid pipe access modifier (expecting write_only)}}
 
   // commit_read/write_pipe
   commit_read_pipe(tmp, rid);// expected-error{{first argument to 'commit_read_pipe' must be a pipe type}}
-  work_group_commit_read_pipe(p, tmp);// expected-error{{invalid argument type to function 'work_group_commit_read_pipe' (expecting 'reserve_id_t')}}
+  work_group_commit_read_pipe(p, tmp);// expected-error{{invalid argument type to function 'work_group_commit_read_pipe' (expecting 'reserve_id_t' having 'int')}}
   sub_group_commit_write_pipe(p, tmp);// expected-error{{invalid pipe access modifier (expecting write_only)}}
 }
 
@@ -31,20 +31,20 @@
   // read/write_pipe
   write_pipe(tmp, p);// expected-error {{first argument to 'write_pipe' must be a pipe type}}
   write_pipe(p);   // expected-error {{invalid number of arguments to function: 'write_pipe'}}
-  write_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'reserve_id_t')}}
-  write_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'unsigned int')}}
-  write_pipe(p, tmp);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'int *')}}
+  write_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'reserve_id_t' having 'int')}}
+  write_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'unsigned int' having 'reserve_id_t')}}
+  write_pipe(p, tmp);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'int *' having 'int')}}
   read_pipe(p, ptr);// expected-error {{invalid pipe access modifier (expecting read_only)}}
   read_pipe(p, rid, tmp, ptr);// expected-error {{invalid pipe access modifier (expecting read_only)}}
 
   // reserve_read/write_pipe
-  reserve_write_pipe(p, ptr);// expected-error{{invalid argument type to function 'reserve_write_pipe' (expecting 'unsigned int')}}
+  reserve_write_pipe(p, ptr);// expected-error{{invalid argument type to function 'reserve_write_pipe' (expecting 'unsigned int' having '__global int *')}}
   work_group_reserve_write_pipe(tmp, tmp);// expected-error{{first argument to 'work_group_reserve_write_pipe' must be a pipe type}}
   sub_group_reserve_read_pipe(p, tmp);// expected-error{{invalid pipe access modifier (expecting read_only)}}
 
   // commit_read/write_pipe
   commit_write_pipe(tmp, rid);// expected-error{{first argument to 'commit_write_pipe' must be a pipe type}}
-  work_group_commit_write_pipe(p, tmp);// expected-error{{invalid argument type to function 'work_group_commi