r264533 - Remove unused support for replacing declarations from chained AST files.

2016-03-26 Thread Richard Smith via cfe-commits
Author: rsmith
Date: Sun Mar 27 00:52:25 2016
New Revision: 264533

URL: http://llvm.org/viewvc/llvm-project?rev=264533=rev
Log:
Remove unused support for replacing declarations from chained AST files.

Modified:
cfe/trunk/include/clang/Serialization/ASTBitCodes.h
cfe/trunk/include/clang/Serialization/ASTReader.h
cfe/trunk/include/clang/Serialization/ASTWriter.h
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
cfe/trunk/lib/Serialization/ASTWriter.cpp
cfe/trunk/lib/Serialization/ASTWriterDecl.cpp

Modified: cfe/trunk/include/clang/Serialization/ASTBitCodes.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTBitCodes.h?rev=264533=264532=264533=diff
==
--- cfe/trunk/include/clang/Serialization/ASTBitCodes.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTBitCodes.h Sun Mar 27 00:52:25 2016
@@ -468,12 +468,7 @@ namespace clang {
   /// \brief Record code for pending implicit instantiations.
   PENDING_IMPLICIT_INSTANTIATIONS = 26,
 
-  /// \brief Record code for a decl replacement block.
-  ///
-  /// If a declaration is modified after having been deserialized, and then
-  /// written to a dependent AST file, its ID and offset must be added to
-  /// the replacement block.
-  DECL_REPLACEMENTS = 27,
+  // ID 27 used to be for a list of replacement decls.
 
   /// \brief Record code for an update to a decl context's lookup table.
   ///

Modified: cfe/trunk/include/clang/Serialization/ASTReader.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTReader.h?rev=264533=264532=264533=diff
==
--- cfe/trunk/include/clang/Serialization/ASTReader.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTReader.h Sun Mar 27 00:52:25 2016
@@ -469,21 +469,6 @@ private:
   /// declaration that has an exception specification.
   llvm::SmallMapVector PendingExceptionSpecUpdates;
 
-  struct ReplacedDeclInfo {
-ModuleFile *Mod;
-uint64_t Offset;
-unsigned RawLoc;
-
-ReplacedDeclInfo() : Mod(nullptr), Offset(0), RawLoc(0) {}
-ReplacedDeclInfo(ModuleFile *Mod, uint64_t Offset, unsigned RawLoc)
-  : Mod(Mod), Offset(Offset), RawLoc(RawLoc) {}
-  };
-
-  typedef llvm::DenseMap
-  DeclReplacementMap;
-  /// \brief Declarations that have been replaced in a later file in the chain.
-  DeclReplacementMap ReplacedDecls;
-
   /// \brief Declarations that have been imported and have typedef names for
   /// linkage purposes.
   llvm::DenseMap, NamedDecl*>

Modified: cfe/trunk/include/clang/Serialization/ASTWriter.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTWriter.h?rev=264533=264532=264533=diff
==
--- cfe/trunk/include/clang/Serialization/ASTWriter.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTWriter.h Sun Mar 27 00:52:25 2016
@@ -382,25 +382,6 @@ private:
   /// should serialize.
   llvm::SetVector ObjCClassesWithCategories;
 
-  struct ReplacedDeclInfo {
-serialization::DeclID ID;
-uint64_t Offset;
-unsigned Loc;
-
-ReplacedDeclInfo() : ID(0), Offset(0), Loc(0) {}
-ReplacedDeclInfo(serialization::DeclID ID, uint64_t Offset,
- SourceLocation Loc)
-  : ID(ID), Offset(Offset), Loc(Loc.getRawEncoding()) {}
-  };
-
-  /// \brief Decls that have been replaced in the current dependent AST file.
-  ///
-  /// When a decl changes fundamentally after being deserialized (this 
shouldn't
-  /// happen, but the ObjC AST nodes are designed this way), it will be
-  /// serialized again. In this case, it is registered here, so that the reader
-  /// knows to read the updated version.
-  SmallVector ReplacedDecls;
- 
   /// \brief The set of declarations that may have redeclaration chains that
   /// need to be serialized.
   llvm::SmallVector Redeclarations;
@@ -544,7 +525,6 @@ private:
 bool IsModule);
   void WriteAttributes(ArrayRef Attrs, RecordDataImpl );
   void WriteDeclUpdatesBlocks(RecordDataImpl );
-  void WriteDeclReplacementsBlock();
   void WriteDeclContextVisibleUpdate(const DeclContext *DC);
   void WriteFPPragmaOptions(const FPOptions );
   void WriteOpenCLExtensions(Sema );

Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=264533=264532=264533=diff
==
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Sun Mar 27 00:52:25 2016

Re: [PATCH] D16529: [clang-tidy] Add modernize-raw-string-literal check

2016-03-26 Thread Richard via cfe-commits
LegalizeAdulthood updated this revision to Diff 51727.
LegalizeAdulthood added a comment.

Update release notes


http://reviews.llvm.org/D16529

Files:
  clang-tidy/modernize/CMakeLists.txt
  clang-tidy/modernize/ModernizeTidyModule.cpp
  clang-tidy/modernize/RawStringLiteralCheck.cpp
  clang-tidy/modernize/RawStringLiteralCheck.h
  docs/ReleaseNotes.rst
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/checks/modernize-raw-string-literal.rst
  test/clang-tidy/modernize-raw-string-literal-delimiter.cpp
  test/clang-tidy/modernize-raw-string-literal.cpp

Index: test/clang-tidy/modernize-raw-string-literal.cpp
===
--- /dev/null
+++ test/clang-tidy/modernize-raw-string-literal.cpp
@@ -0,0 +1,123 @@
+// RUN: %check_clang_tidy %s modernize-raw-string-literal %t
+
+char const *const BackSlash{"goink\\frob"};
+// CHECK-MESSAGES: :[[@LINE-1]]:29: warning: escaped string literal can be written as a raw string literal [modernize-raw-string-literal]
+// CHECK-FIXES: {{^}}char const *const BackSlash{R"(goink\frob)"};{{$}}
+
+char const *const PlainLiteral("plain literal");
+
+// Non-printable ASCII characters.
+char const *const Nul{"goink\\\000"};
+char const *const Soh{"goink\\\001"};
+char const *const Stx{"goink\\\002"};
+char const *const Etx{"goink\\\003"};
+char const *const Enq{"goink\\\004"};
+char const *const Ack{"goink\\\005"};
+char const *const Bell{"goink\\\afrob"};
+char const *const BackSpace{"goink\\\bfrob"};
+char const *const HorizontalTab{"goink\\\tfrob"};
+char const *const NewLine{"goink\nfrob"};
+char const *const VerticalTab{"goink\\\vfrob"};
+char const *const FormFeed{"goink\\\ffrob"};
+char const *const CarraigeReturn{"goink\\\rfrob"};
+char const *const So{"goink\\\016"};
+char const *const Si{"goink\\\017"};
+char const *const Dle{"goink\\\020"};
+char const *const Dc1{"goink\\\021"};
+char const *const Dc2{"goink\\\022"};
+char const *const Dc3{"goink\\\023"};
+char const *const Dc4{"goink\\\024"};
+char const *const Nak{"goink\\\025"};
+char const *const Syn{"goink\\\026"};
+char const *const Etb{"goink\\\027"};
+char const *const Can{"goink\\\030"};
+char const *const Em{"goink\\\031"};
+char const *const Sub{"goink\\\032"};
+char const *const Esc{"goink\\\033"};
+char const *const Fs{"goink\\\034"};
+char const *const Gs{"goink\\\035"};
+char const *const Rs{"goink\\\036"};
+char const *const Us{"goink\\\037"};
+char const *const HexNonPrintable{"\\\x03"};
+char const *const Delete{"\\\177"};
+
+char const *const TrailingSpace{"A line \\with space. \n"};
+char const *const TrailingNewLine{"A single \\line.\n"};
+char const *const AlreadyRaw{R"(foobie\\bletch)"};
+char const *const UTF8Literal{u8"foobie\\bletch"};
+char const *const UTF8RawLiteral{u8R"(foobie\\bletch)"};
+char16_t const *const UTF16Literal{u"foobie\\bletch"};
+char16_t const *const UTF16RawLiteral{uR"(foobie\\bletch)"};
+char32_t const *const UTF32Literal{U"foobie\\bletch"};
+char32_t const *const UTF32RawLiteral{UR"(foobie\\bletch)"};
+wchar_t const *const WideLiteral{L"foobie\\bletch"};
+wchar_t const *const WideRawLiteral{LR"(foobie\\bletch)"};
+
+char const *const SingleQuote{"goink\'frob"};
+// CHECK-MESSAGES: :[[@LINE-1]]:31: warning: {{.*}} can be written as a raw string literal
+// CHECK-XFIXES: {{^}}char const *const SingleQuote{R"(goink'frob)"};{{$}}
+
+char const *const DoubleQuote{"goink\"frob"};
+// CHECK-MESSAGES: :[[@LINE-1]]:31: warning: {{.*}} can be written as a raw string literal
+// CHECK-FIXES: {{^}}char const *const DoubleQuote{R"(goink"frob)"};{{$}}
+
+char const *const QuestionMark{"goink\?frob"};
+// CHECK-MESSAGES: :[[@LINE-1]]:32: warning: {{.*}} can be written as a raw string literal
+// CHECK-FIXES: {{^}}char const *const QuestionMark{R"(goink?frob)"};{{$}}
+
+char const *const RegEx{"goink\\(one|two\\)\\?.*\\nfrob"};
+// CHECK-MESSAGES: :[[@LINE-1]]:25: warning: {{.*}} can be written as a raw string literal
+// CHECK-FIXES: {{^}}char const *const RegEx{R"(goink\(one|two\)\\\?.*\nfrob)"};{{$}}
+
+char const *const Path{"C:\\Program Files\\Vendor\\Application\\Application.exe"};
+// CHECK-MESSAGES: :[[@LINE-1]]:24: warning: {{.*}} can be written as a raw string literal
+// CHECK-FIXES: {{^}}char const *const Path{R"(C:\Program Files\Vendor\Application\Application.exe)"};{{$}}
+
+char const *const ContainsSentinel{"who\\ops)\""};
+// CHECK-MESSAGES: :[[@LINE-1]]:36: warning: {{.*}} can be written as a raw string literal
+// CHECK-FIXES: {{^}}char const *const ContainsSentinel{R"lit(who\ops)")lit"};{{$}}
+
+char const *const ContainsDelim{"whoops)\")lit\""};
+// CHECK-MESSAGES: :[[@LINE-1]]:33: warning: {{.*}} can be written as a raw string literal
+// CHECK-FIXES: {{^}}char const *const ContainsDelim{R"lit1(whoops)")lit")lit1"};{{$}}
+
+char const *const OctalPrintable{"\100\\"};
+// CHECK-MESSAGES: :[[@LINE-1]]:34: warning: {{.*}} can be written as a raw string literal
+// CHECK-FIXES: {{^}}char const *const 

[clang-tools-extra] r264531 - Add clang-tools-extra release notes

2016-03-26 Thread Richard Thomson via cfe-commits
Author: legalize
Date: Sun Mar 27 00:06:57 2016
New Revision: 264531

URL: http://llvm.org/viewvc/llvm-project?rev=264531=rev
Log:
Add clang-tools-extra release notes

Added:
clang-tools-extra/trunk/docs/ReleaseNotes.rst
Modified:
clang-tools-extra/trunk/docs/clang-tidy/checks/list.rst
clang-tools-extra/trunk/docs/index.rst

Added: clang-tools-extra/trunk/docs/ReleaseNotes.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/ReleaseNotes.rst?rev=264531=auto
==
--- clang-tools-extra/trunk/docs/ReleaseNotes.rst (added)
+++ clang-tools-extra/trunk/docs/ReleaseNotes.rst Sun Mar 27 00:06:57 2016
@@ -0,0 +1,71 @@
+=
+Extra Clang Tools 3.9 (In-Progress) Release Notes
+=
+
+.. contents::
+   :local:
+   :depth: 2
+
+Written by the `LLVM Team `_
+
+.. warning::
+
+   These are in-progress notes for the upcoming Clang 3.9 release. You may
+   prefer the `Clang 3.8 Release Notes
+   `_.
+
+Introduction
+
+
+This document contains the release notes for the Extra Clang Tools, part of the
+Clang release 3.9.  Here we describe the status of the Extra Clang Tools in 
some
+detail, including major improvements from the previous release and new feature
+work. For the general Clang release notes, see `the Clang documentation
+`_.  All 
LLVM
+releases may be downloaded from the `LLVM releases web
+site `_.
+
+For more information about Clang or LLVM, including information about
+the latest release, please see the `Clang Web Site `_ or
+the `LLVM Web Site `_.
+
+Note that if you are reading this file from a Subversion checkout or the
+main Clang web page, this document applies to the *next* release, not
+the current one. To see the release notes for a specific release, please
+see the `releases page `_.
+
+What's New in Extra Clang Tools 3.9?
+
+
+Some of the major new features and improvements to Extra Clang Tools are listed
+here. Generic improvements to Extra Clang Tools as a whole or to its underlying
+infrastructure are described first, followed by tool-specific sections.
+
+Major New Features
+--
+
+- Feature1...
+
+Improvements to ``clang-query``
+^^^
+
+The improvements are...
+
+Improvements to ``clang-rename``
+
+
+The improvements are...
+
+Improvements to ``clang-tidy``
+^^
+
+``clang-tidy``'s checks are constantly being improved to catch more issues,
+explain them more clearly, and provide more accurate fix-its for the issues
+identified.  The improvements since the 3.8 release include:
+
+-  ...
+
+Improvements to ``modularize``
+^^
+
+The improvements are...

Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/list.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/list.rst?rev=264531=264530=264531=diff
==
--- clang-tools-extra/trunk/docs/clang-tidy/checks/list.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/list.rst Sun Mar 27 00:06:57 
2016
@@ -88,6 +88,7 @@ Clang-Tidy Checks
performance-faster-string-find
performance-for-range-copy
performance-implicit-cast-in-loop
+   performance-unnecessary-copy-initialization
readability-braces-around-statements
readability-container-size-empty
readability-else-after-return

Modified: clang-tools-extra/trunk/docs/index.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/index.rst?rev=264531=264530=264531=diff
==
--- clang-tools-extra/trunk/docs/index.rst (original)
+++ clang-tools-extra/trunk/docs/index.rst Sun Mar 27 00:06:57 2016
@@ -10,6 +10,10 @@ Introduction
 Welcome to the clang-tools-extra project which contains extra tools built using
 Clang's tooling API's.
 
+.. toctree::
+   :maxdepth: 1
+
+   ReleaseNotes
 
 Contents
 


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


r264530 - Use the correct alignment for uuid descriptors

2016-03-26 Thread David Majnemer via cfe-commits
Author: majnemer
Date: Sat Mar 26 23:46:14 2016
New Revision: 264530

URL: http://llvm.org/viewvc/llvm-project?rev=264530=rev
Log:
Use the correct alignment for uuid descriptors

The _GUID_ descriptors emitted by MSVC have alignment 8 for 64-bit
builds: we should do the same if the linker picks the "wrong" COMDAT.

Modified:
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/test/CodeGenCXX/microsoft-uuidof.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=264530=264529=264530=diff
==
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Sat Mar 26 23:46:14 2016
@@ -1458,8 +1458,8 @@ ConstantAddress CodeGenModule::GetAddrOf
   std::string Name = "_GUID_" + Uuid.lower();
   std::replace(Name.begin(), Name.end(), '-', '_');
 
-  // Contains a 32-bit field.
-  CharUnits Alignment = CharUnits::fromQuantity(4);
+  // The UUID descriptor should be pointer aligned.
+  CharUnits Alignment = CharUnits::fromQuantity(PointerAlignInBytes);
 
   // Look for an existing global.
   if (llvm::GlobalVariable *GV = getModule().getNamedGlobal(Name))

Modified: cfe/trunk/test/CodeGenCXX/microsoft-uuidof.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-uuidof.cpp?rev=264530=264529=264530=diff
==
--- cfe/trunk/test/CodeGenCXX/microsoft-uuidof.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-uuidof.cpp Sat Mar 26 23:46:14 2016
@@ -1,5 +1,6 @@
 // RUN: %clang_cc1 -emit-llvm %s -o - -DDEFINE_GUID -triple=i386-pc-linux 
-fms-extensions | FileCheck %s --check-prefix=CHECK-DEFINE-GUID
 // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-linux -fms-extensions | 
FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-linux -fms-extensions 
| FileCheck %s --check-prefix=CHECK-64
 // RUN: %clang_cc1 -emit-llvm %s -o - -DDEFINE_GUID -DWRONG_GUID 
-triple=i386-pc-linux -fms-extensions | FileCheck %s 
--check-prefix=CHECK-DEFINE-WRONG-GUID
 
 #ifdef DEFINE_GUID
@@ -36,6 +37,7 @@ GUID g = __uuidof(S1);
 // First global use of __uuidof(S1) forces the creation of the global.
 // CHECK: @_GUID_12345678_1234_1234_1234_1234567890ab = linkonce_odr constant 
{ i32, i16, i16, [8 x i8] } { i32 305419896, i16 4660, i16 4660, [8 x i8] 
c"\124\124Vx\90\AB" }, comdat
 // CHECK: @gr = constant %struct._GUID* bitcast ({ i32, i16, i16, [8 x i8] }* 
@_GUID_12345678_1234_1234_1234_1234567890ab to %struct._GUID*), align 4
+// CHECK-64: @gr = constant %struct._GUID* bitcast ({ i32, i16, i16, [8 x i8] 
}* @_GUID_12345678_1234_1234_1234_1234567890ab to %struct._GUID*), align 8
 const GUID& gr = __uuidof(S1);
 
 // CHECK: @gp = global %struct._GUID* bitcast ({ i32, i16, i16, [8 x i8] }* 
@_GUID_12345678_1234_1234_1234_1234567890ab to %struct._GUID*), align 4


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


r264529 - Improve the representation of CXXUuidofExpr

2016-03-26 Thread David Majnemer via cfe-commits
Author: majnemer
Date: Sat Mar 26 23:46:07 2016
New Revision: 264529

URL: http://llvm.org/viewvc/llvm-project?rev=264529=rev
Log:
Improve the representation of CXXUuidofExpr

Keep a pointer to the UuidAttr that the CXXUuidofExpr corresponds to.
This makes translating from __uuidof to the underlying constant a lot
more straightforward.

Modified:
cfe/trunk/include/clang/AST/ExprCXX.h
cfe/trunk/lib/AST/ExprCXX.cpp
cfe/trunk/lib/AST/MicrosoftMangle.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/lib/Sema/SemaExprCXX.cpp

Modified: cfe/trunk/include/clang/AST/ExprCXX.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=264529=264528=264529=diff
==
--- cfe/trunk/include/clang/AST/ExprCXX.h (original)
+++ cfe/trunk/include/clang/AST/ExprCXX.h Sat Mar 26 23:46:07 2016
@@ -778,22 +778,23 @@ public:
 class CXXUuidofExpr : public Expr {
 private:
   llvm::PointerUnion Operand;
+  const UuidAttr *UA;
   SourceRange Range;
 
 public:
-  CXXUuidofExpr(QualType Ty, TypeSourceInfo *Operand, SourceRange R)
-: Expr(CXXUuidofExprClass, Ty, VK_LValue, OK_Ordinary,
-   false, Operand->getType()->isDependentType(),
-   Operand->getType()->isInstantiationDependentType(),
-   Operand->getType()->containsUnexpandedParameterPack()),
-  Operand(Operand), Range(R) { }
-
-  CXXUuidofExpr(QualType Ty, Expr *Operand, SourceRange R)
-: Expr(CXXUuidofExprClass, Ty, VK_LValue, OK_Ordinary,
-   false, Operand->isTypeDependent(),
-   Operand->isInstantiationDependent(),
-   Operand->containsUnexpandedParameterPack()),
-  Operand(Operand), Range(R) { }
+  CXXUuidofExpr(QualType Ty, TypeSourceInfo *Operand, const UuidAttr *UA,
+SourceRange R)
+  : Expr(CXXUuidofExprClass, Ty, VK_LValue, OK_Ordinary, false,
+ Operand->getType()->isDependentType(),
+ Operand->getType()->isInstantiationDependentType(),
+ Operand->getType()->containsUnexpandedParameterPack()),
+Operand(Operand), UA(UA), Range(R) {}
+
+  CXXUuidofExpr(QualType Ty, Expr *Operand, const UuidAttr *UA, SourceRange R)
+  : Expr(CXXUuidofExprClass, Ty, VK_LValue, OK_Ordinary, false,
+ Operand->isTypeDependent(), Operand->isInstantiationDependent(),
+ Operand->containsUnexpandedParameterPack()),
+Operand(Operand), UA(UA), Range(R) {}
 
   CXXUuidofExpr(EmptyShell Empty, bool isExpr)
 : Expr(CXXUuidofExprClass, Empty) {
@@ -830,7 +831,7 @@ public:
 Operand = E;
   }
 
-  StringRef getUuidAsStringRef(ASTContext ) const;
+  StringRef getUuidAsStringRef() const;
 
   SourceLocation getLocStart() const LLVM_READONLY { return Range.getBegin(); }
   SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }
@@ -841,11 +842,6 @@ public:
 return T->getStmtClass() == CXXUuidofExprClass;
   }
 
-  /// Grabs __declspec(uuid()) off a type, or returns 0 if we cannot resolve to
-  /// a single GUID.
-  static const UuidAttr *GetUuidAttrOfType(QualType QT,
-   bool *HasMultipleGUIDsPtr = 
nullptr);
-
   // Iterators
   child_range children() {
 if (isTypeOperand())

Modified: cfe/trunk/lib/AST/ExprCXX.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprCXX.cpp?rev=264529=264528=264529=diff
==
--- cfe/trunk/lib/AST/ExprCXX.cpp (original)
+++ cfe/trunk/lib/AST/ExprCXX.cpp Sat Mar 26 23:46:07 2016
@@ -54,77 +54,8 @@ QualType CXXUuidofExpr::getTypeOperand(A
   Operand.get()->getType().getNonReferenceType(), Quals);
 }
 
-// static
-const UuidAttr *CXXUuidofExpr::GetUuidAttrOfType(QualType QT,
- bool *RDHasMultipleGUIDsPtr) {
-  // Optionally remove one level of pointer, reference or array indirection.
-  const Type *Ty = QT.getTypePtr();
-  if (QT->isPointerType() || QT->isReferenceType())
-Ty = QT->getPointeeType().getTypePtr();
-  else if (QT->isArrayType())
-Ty = Ty->getBaseElementTypeUnsafe();
-
-  const CXXRecordDecl *RD = Ty->getAsCXXRecordDecl();
-  if (!RD)
-return nullptr;
-
-  if (const UuidAttr *Uuid = RD->getMostRecentDecl()->getAttr())
-return Uuid;
-
-  // __uuidof can grab UUIDs from template arguments.
-  if (const ClassTemplateSpecializationDecl *CTSD =
-  dyn_cast(RD)) {
-const TemplateArgumentList  = CTSD->getTemplateArgs();
-const UuidAttr *UuidForRD = nullptr;
-
-for (const TemplateArgument  : TAL.asArray()) {
-  bool SeenMultipleGUIDs = false;
-
-  const UuidAttr *UuidForTA = nullptr;
-  if (TA.getKind() == TemplateArgument::Type)
-UuidForTA = GetUuidAttrOfType(TA.getAsType(), );
-  else if (TA.getKind() == TemplateArgument::Declaration)
-UuidForTA =
-GetUuidAttrOfType(TA.getAsDecl()->getType(), );
-

Re: [PATCH] Proper detection and handling of RHEL and variants

2016-03-26 Thread Michael Lampe via cfe-commits
New patch attached. I've also removed RHEL4 which is now four years past 
EOL and certainly incapable of building or running any recent version of 
llvm/clang.


-Michael

Rafael EspĂ­ndola wrote:

-  if (IsRedhat(Distro))
+  if (Distro == Fedora || Distro == RHEL7)

RHEL8 will probably use --no-add-needed.

Can you change this to "if (IsRedhat(Distro) && !old_rhel_distro) "?

Cheers,
Rafael


On 22 March 2016 at 22:07, Michael Lampe via cfe-commits
 wrote:

- Don't consider "/etc/lsb-release" to be Ubuntu only.
- Detect SL, too.
- Only add "--no-add-needed" for RHEL7 (or Fedora), not for RHEL6 (that's
what the compilers shipped with RHEL do).


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





--- a/clang/lib/Driver/ToolChains.cpp   2016-03-27 01:02:56.161462540 +0100
+++ b/clang/lib/Driver/ToolChains.cpp   2016-03-27 01:04:56.299721653 +0100
@@ -3369,7 +3369,6 @@
   DebianJessie,
   DebianStretch,
   Exherbo,
-  RHEL4,
   RHEL5,
   RHEL6,
   RHEL7,
@@ -3396,7 +3395,7 @@
 };
 
 static bool IsRedhat(enum Distro Distro) {
-  return Distro == Fedora || (Distro >= RHEL4 && Distro <= RHEL7);
+  return Distro == Fedora || (Distro >= RHEL5 && Distro <= RHEL7);
 }
 
 static bool IsOpenSUSE(enum Distro Distro) { return Distro == OpenSUSE; }
@@ -3438,7 +3437,8 @@
   .Case("wily", UbuntuWily)
   .Case("xenial", UbuntuXenial)
   .Default(UnknownDistro);
-return Version;
+if (Version != UnknownDistro)
+  return Version;
   }
 
   File = llvm::MemoryBuffer::getFile("/etc/redhat-release");
@@ -3447,15 +3447,14 @@
 if (Data.startswith("Fedora release"))
   return Fedora;
 if (Data.startswith("Red Hat Enterprise Linux") ||
-Data.startswith("CentOS")) {
+Data.startswith("CentOS") ||
+Data.startswith("Scientific Linux")) {
   if (Data.find("release 7") != StringRef::npos)
 return RHEL7;
   else if (Data.find("release 6") != StringRef::npos)
 return RHEL6;
   else if (Data.find("release 5") != StringRef::npos)
 return RHEL5;
-  else if (Data.find("release 4") != StringRef::npos)
-return RHEL4;
 }
 return UnknownDistro;
   }
@@ -3680,11 +3679,11 @@
   ExtraOpts.push_back("--hash-style=both");
   }
 
-  if (IsRedhat(Distro))
+  if (IsRedhat(Distro) && Distro != RHEL5 && Distro != RHEL6)
 ExtraOpts.push_back("--no-add-needed");
 
   if ((IsDebian(Distro) && Distro >= DebianSqueeze) || IsOpenSUSE(Distro) ||
-  (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) ||
+  (IsRedhat(Distro) && Distro != RHEL5) ||
   (IsUbuntu(Distro) && Distro >= UbuntuKarmic))
 ExtraOpts.push_back("--build-id");
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D18495: Check default arguments of template template parameters for compatibility.

2016-03-26 Thread Faisal Vali via cfe-commits
faisalv created this revision.
faisalv added a reviewer: rsmith.
faisalv added a subscriber: cfe-commits.

I'm not sure why this check wasn't being done at template definition time.  
I can't devise a test case to trigger the concerns in the deleted comments 
below.

Anything I might be missing by simply adding the CheckTemplateArgument check 
here?

Thanks!


http://reviews.llvm.org/D18495

Files:
  lib/Sema/SemaTemplate.cpp
  test/CXX/temp/temp.arg/temp.arg.template/p3-0x.cpp
  test/CXX/temp/temp.param/p10-0x.cpp
  test/CXX/temp/temp.param/p12.cpp

Index: test/CXX/temp/temp.param/p12.cpp
===
--- test/CXX/temp/temp.param/p12.cpp
+++ test/CXX/temp/temp.param/p12.cpp
@@ -34,6 +34,6 @@
 // Check validity of default arguments
 template class // expected-note{{previous template template parameter is here}}
= Y1> // expected-error{{template template argument has different template parameters than its corresponding template template parameter}}
-  class C1 {};
+  class C1 {};  //expected-note{{template is declared here}}
 
-C1<> c1; // expected-note{{while checking a default template argument}}
+C1<> c1; // expected-error{{too few template arguments}}
Index: test/CXX/temp/temp.param/p10-0x.cpp
===
--- test/CXX/temp/temp.param/p10-0x.cpp
+++ test/CXX/temp/temp.param/p10-0x.cpp
@@ -8,7 +8,7 @@
 template using B2 = T1;
 
 template