Date: Thu, 3 May 2012 16:54:00 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r234973 - in vendor/clang/dist: . bindings/python/clang bindings/python/tests/cindex examples/clang-interpreter include/clang/AST include/clang/Analysis include/clang/Basic include/clan... Message-ID: <201205031654.q43Gs1Ek052968@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Thu May 3 16:53:59 2012 New Revision: 234973 URL: http://svn.freebsd.org/changeset/base/234973 Log: Vendor import of clang release_31 branch r155985: http://llvm.org/svn/llvm-project/cfe/branches/release_31@155985 Added: vendor/clang/dist/lib/Sema/SemaStmtAttr.cpp vendor/clang/dist/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp vendor/clang/dist/test/CodeCompletion/preamble.c vendor/clang/dist/test/CodeCompletion/some_struct.h vendor/clang/dist/test/CodeGen/arm-homogenous.c vendor/clang/dist/test/CodeGenCXX/cxx11-exception-spec.cpp vendor/clang/dist/test/CodeGenCXX/mangle-this-cxx11.cpp vendor/clang/dist/test/CodeGenOpenCL/fpmath.cl vendor/clang/dist/test/Misc/unprintable.c vendor/clang/dist/test/Misc/wnull-character.cpp (contents, props changed) vendor/clang/dist/test/Misc/wrong-encoding.c vendor/clang/dist/test/PCH/typo2.cpp vendor/clang/dist/test/Parser/cxx11-stmt-attributes.cpp vendor/clang/dist/test/Rewriter/rewrite-modern-extern-c-func-decl.mm vendor/clang/dist/test/Rewriter/rewrite-modern-protocol-1.mm vendor/clang/dist/test/Rewriter/rewrite-modern-super.mm vendor/clang/dist/test/Rewriter/rewrite-modern-typeof.mm vendor/clang/dist/test/Sema/const-eval-64.c vendor/clang/dist/test/SemaObjC/error-implicit-property.m vendor/clang/dist/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp vendor/clang/dist/test/Tooling/clang-check-args.cpp vendor/clang/dist/www/libstdc++4.7-clang11.patch Deleted: vendor/clang/dist/include/clang/Basic/DelayedCleanupPool.h vendor/clang/dist/include/clang/Index/ vendor/clang/dist/lib/Index/ vendor/clang/dist/test/CodeGenOpenCL/fpaccuracy.cl vendor/clang/dist/test/Misc/pubnames.c Modified: vendor/clang/dist/CMakeLists.txt vendor/clang/dist/bindings/python/clang/cindex.py vendor/clang/dist/bindings/python/tests/cindex/test_type.py vendor/clang/dist/examples/clang-interpreter/CMakeLists.txt vendor/clang/dist/include/clang/AST/Decl.h vendor/clang/dist/include/clang/AST/DeclBase.h vendor/clang/dist/include/clang/AST/DeclLookups.h vendor/clang/dist/include/clang/AST/Expr.h vendor/clang/dist/include/clang/AST/ExternalASTSource.h vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h vendor/clang/dist/include/clang/AST/Stmt.h vendor/clang/dist/include/clang/AST/Type.h vendor/clang/dist/include/clang/AST/VTableBuilder.h vendor/clang/dist/include/clang/Analysis/ProgramPoint.h vendor/clang/dist/include/clang/Basic/BuiltinsX86.def vendor/clang/dist/include/clang/Basic/ConvertUTF.h vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Basic/ExceptionSpecificationType.h vendor/clang/dist/include/clang/Basic/OnDiskHashTable.h vendor/clang/dist/include/clang/Basic/StmtNodes.td vendor/clang/dist/include/clang/Basic/TargetInfo.h vendor/clang/dist/include/clang/Basic/TokenKinds.def vendor/clang/dist/include/clang/Config/config.h.cmake vendor/clang/dist/include/clang/Config/config.h.in vendor/clang/dist/include/clang/Driver/CC1Options.td vendor/clang/dist/include/clang/Driver/Compilation.h vendor/clang/dist/include/clang/Frontend/ASTUnit.h vendor/clang/dist/include/clang/Frontend/FrontendActions.h vendor/clang/dist/include/clang/Frontend/FrontendOptions.h vendor/clang/dist/include/clang/Frontend/TextDiagnostic.h vendor/clang/dist/include/clang/Parse/Parser.h vendor/clang/dist/include/clang/Sema/DeclSpec.h vendor/clang/dist/include/clang/Sema/ParsedTemplate.h vendor/clang/dist/include/clang/Sema/Scope.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/include/clang/Serialization/ASTBitCodes.h vendor/clang/dist/include/clang/Serialization/ASTReader.h vendor/clang/dist/include/clang/Serialization/ASTWriter.h vendor/clang/dist/include/clang/Serialization/Module.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h vendor/clang/dist/include/clang/Tooling/CompilationDatabase.h vendor/clang/dist/lib/AST/ASTContext.cpp vendor/clang/dist/lib/AST/Decl.cpp vendor/clang/dist/lib/AST/Expr.cpp vendor/clang/dist/lib/AST/ExprConstant.cpp vendor/clang/dist/lib/AST/ExternalASTSource.cpp vendor/clang/dist/lib/AST/ItaniumMangle.cpp vendor/clang/dist/lib/AST/Stmt.cpp vendor/clang/dist/lib/AST/StmtPrinter.cpp vendor/clang/dist/lib/AST/StmtProfile.cpp vendor/clang/dist/lib/AST/Type.cpp vendor/clang/dist/lib/AST/VTableBuilder.cpp vendor/clang/dist/lib/Analysis/CFG.cpp vendor/clang/dist/lib/Analysis/CMakeLists.txt vendor/clang/dist/lib/Basic/TargetInfo.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/Basic/Version.cpp vendor/clang/dist/lib/CMakeLists.txt vendor/clang/dist/lib/CodeGen/CGBlocks.cpp vendor/clang/dist/lib/CodeGen/CGCall.cpp vendor/clang/dist/lib/CodeGen/CGClass.cpp vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp vendor/clang/dist/lib/CodeGen/CGDecl.cpp vendor/clang/dist/lib/CodeGen/CGExpr.cpp vendor/clang/dist/lib/CodeGen/CGExprAgg.cpp vendor/clang/dist/lib/CodeGen/CGExprCXX.cpp vendor/clang/dist/lib/CodeGen/CGExprConstant.cpp vendor/clang/dist/lib/CodeGen/CGStmt.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.h vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/CodeGen/CodeGenTBAA.cpp vendor/clang/dist/lib/CodeGen/CodeGenTBAA.h vendor/clang/dist/lib/CodeGen/TargetInfo.cpp vendor/clang/dist/lib/Driver/Compilation.cpp vendor/clang/dist/lib/Driver/Driver.cpp vendor/clang/dist/lib/Driver/ToolChains.cpp vendor/clang/dist/lib/Driver/Tools.cpp vendor/clang/dist/lib/Frontend/ASTUnit.cpp vendor/clang/dist/lib/Frontend/CompilerInstance.cpp vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp vendor/clang/dist/lib/Frontend/FrontendActions.cpp vendor/clang/dist/lib/Frontend/TextDiagnostic.cpp vendor/clang/dist/lib/FrontendTool/ExecuteCompilerInvocation.cpp vendor/clang/dist/lib/Headers/avx2intrin.h vendor/clang/dist/lib/Headers/avxintrin.h vendor/clang/dist/lib/Makefile vendor/clang/dist/lib/Parse/ParseCXXInlineMethods.cpp vendor/clang/dist/lib/Parse/ParseDecl.cpp vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp vendor/clang/dist/lib/Parse/ParseExpr.cpp vendor/clang/dist/lib/Parse/ParseExprCXX.cpp vendor/clang/dist/lib/Parse/ParseStmt.cpp vendor/clang/dist/lib/Parse/ParseTemplate.cpp vendor/clang/dist/lib/Parse/Parser.cpp vendor/clang/dist/lib/Rewrite/RewriteModernObjC.cpp vendor/clang/dist/lib/Rewrite/RewriteRope.cpp vendor/clang/dist/lib/Sema/CMakeLists.txt vendor/clang/dist/lib/Sema/DeclSpec.cpp vendor/clang/dist/lib/Sema/Sema.cpp vendor/clang/dist/lib/Sema/SemaAccess.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp vendor/clang/dist/lib/Sema/SemaExceptionSpec.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaExprCXX.cpp vendor/clang/dist/lib/Sema/SemaExprMember.cpp vendor/clang/dist/lib/Sema/SemaLookup.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/lib/Sema/SemaPseudoObject.cpp vendor/clang/dist/lib/Sema/SemaStmt.cpp vendor/clang/dist/lib/Sema/SemaTemplate.cpp vendor/clang/dist/lib/Sema/SemaTemplateDeduction.cpp vendor/clang/dist/lib/Sema/SemaTemplateInstantiate.cpp vendor/clang/dist/lib/Sema/SemaTemplateInstantiateDecl.cpp vendor/clang/dist/lib/Sema/SemaType.cpp vendor/clang/dist/lib/Sema/TreeTransform.h vendor/clang/dist/lib/Serialization/ASTReader.cpp vendor/clang/dist/lib/Serialization/ASTReaderDecl.cpp vendor/clang/dist/lib/Serialization/ASTReaderInternals.h vendor/clang/dist/lib/Serialization/ASTReaderStmt.cpp vendor/clang/dist/lib/Serialization/ASTWriter.cpp vendor/clang/dist/lib/Serialization/ASTWriterDecl.cpp vendor/clang/dist/lib/Serialization/ASTWriterStmt.cpp vendor/clang/dist/lib/Serialization/Module.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/AnalysisManager.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/CoreEngine.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/ExprEngine.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp vendor/clang/dist/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp vendor/clang/dist/lib/Tooling/CompilationDatabase.cpp vendor/clang/dist/test/Analysis/objc-bool.m vendor/clang/dist/test/Analysis/redefined_system.c vendor/clang/dist/test/Analysis/self-init.m vendor/clang/dist/test/CXX/class/class.mem/p2.cpp vendor/clang/dist/test/CXX/except/except.spec/p1.cpp vendor/clang/dist/test/CXX/special/class.inhctor/elsewhere.cpp vendor/clang/dist/test/CXX/special/class.inhctor/p3.cpp vendor/clang/dist/test/CXX/special/class.inhctor/p7.cpp vendor/clang/dist/test/CXX/temp/temp.decls/temp.variadic/p5.cpp vendor/clang/dist/test/CodeGen/avx-shuffle-builtins.c vendor/clang/dist/test/CodeGen/avx2-builtins.c vendor/clang/dist/test/CodeGen/builtins-x86.c vendor/clang/dist/test/CodeGen/may-alias.c vendor/clang/dist/test/CodeGen/packed-nest-unpacked.c vendor/clang/dist/test/CodeGen/tbaa-for-vptr.cpp vendor/clang/dist/test/CodeGenCXX/block-byref-cxx-objc.cpp vendor/clang/dist/test/CodeGenCXX/const-init-cxx11.cpp vendor/clang/dist/test/CodeGenCXX/inheriting-constructor.cpp vendor/clang/dist/test/CodeGenCXX/static-init.cpp vendor/clang/dist/test/Headers/typedef_guards.c vendor/clang/dist/test/Index/get-cursor.m vendor/clang/dist/test/Lexer/newline-eof-c++98-compat.cpp vendor/clang/dist/test/Lexer/newline-eof.c vendor/clang/dist/test/Lexer/utf-16.c vendor/clang/dist/test/Misc/message-length.c vendor/clang/dist/test/Parser/MicrosoftExtensions.cpp vendor/clang/dist/test/Parser/objcxx11-attributes.mm vendor/clang/dist/test/Preprocessor/pragma_sysheader.c vendor/clang/dist/test/Rewriter/blockcast3.mm vendor/clang/dist/test/Rewriter/instancetype-test.mm vendor/clang/dist/test/Rewriter/objc-bool-literal-check-modern.mm vendor/clang/dist/test/Rewriter/objc-bool-literal-modern.mm vendor/clang/dist/test/Rewriter/objc-modern-numeric-literal.mm vendor/clang/dist/test/Rewriter/rewrite-block-consts.mm vendor/clang/dist/test/Rewriter/rewrite-block-literal-1.mm vendor/clang/dist/test/Rewriter/rewrite-block-literal.mm vendor/clang/dist/test/Rewriter/rewrite-block-pointer.mm vendor/clang/dist/test/Rewriter/rewrite-byref-in-nested-blocks.mm vendor/clang/dist/test/Rewriter/rewrite-elaborated-type.mm vendor/clang/dist/test/Rewriter/rewrite-foreach-in-block.mm vendor/clang/dist/test/Rewriter/rewrite-modern-container-literal.mm vendor/clang/dist/test/Rewriter/rewrite-nested-blocks-1.mm vendor/clang/dist/test/Rewriter/rewrite-nested-blocks-2.mm vendor/clang/dist/test/Rewriter/rewrite-nested-blocks.mm vendor/clang/dist/test/Rewriter/rewrite-nested-property-in-blocks.mm vendor/clang/dist/test/Rewriter/rewrite-unique-block-api.mm vendor/clang/dist/test/Sema/const-eval.c vendor/clang/dist/test/Sema/surpress-deprecated.c vendor/clang/dist/test/SemaCXX/constant-expression-cxx11.cpp vendor/clang/dist/test/SemaCXX/cxx98-compat.cpp vendor/clang/dist/test/SemaCXX/dependent-noexcept-unevaluated.cpp vendor/clang/dist/test/SemaCXX/implicit-exception-spec.cpp vendor/clang/dist/test/SemaCXX/warn-everthing.cpp vendor/clang/dist/test/SemaCXX/warn-thread-safety-parsing.cpp vendor/clang/dist/test/SemaObjC/objc-literal-nsnumber.m vendor/clang/dist/test/SemaObjCXX/literals.mm vendor/clang/dist/test/SemaObjCXX/property-reference.mm vendor/clang/dist/test/SemaTemplate/default-expr-arguments.cpp vendor/clang/dist/test/SemaTemplate/dependent-names.cpp vendor/clang/dist/test/SemaTemplate/instantiate-declref.cpp vendor/clang/dist/tools/arcmt-test/Makefile vendor/clang/dist/tools/c-arcmt-test/Makefile vendor/clang/dist/tools/c-index-test/Makefile vendor/clang/dist/tools/c-index-test/c-index-test.c vendor/clang/dist/tools/clang-check/ClangCheck.cpp vendor/clang/dist/tools/driver/CMakeLists.txt vendor/clang/dist/tools/driver/Makefile vendor/clang/dist/tools/libclang/CIndex.cpp vendor/clang/dist/tools/libclang/CMakeLists.txt vendor/clang/dist/tools/libclang/CXCursor.cpp vendor/clang/dist/tools/libclang/Makefile vendor/clang/dist/tools/scan-build/ccc-analyzer vendor/clang/dist/unittests/Frontend/Makefile vendor/clang/dist/unittests/Tooling/CompilationDatabaseTest.cpp vendor/clang/dist/www/cxx_status.html vendor/clang/dist/www/hacking.html Modified: vendor/clang/dist/CMakeLists.txt ============================================================================== --- vendor/clang/dist/CMakeLists.txt Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/CMakeLists.txt Thu May 3 16:53:59 2012 (r234973) @@ -66,6 +66,10 @@ set(CLANG_RESOURCE_DIR "" CACHE STRING set(C_INCLUDE_DIRS "" CACHE STRING "Colon separated list of directories clang will search for headers.") +set(GCC_INSTALL_PREFIX "" CACHE PATH "Directory where gcc is installed." ) +set(DEFAULT_SYSROOT "" CACHE PATH + "Default <path> to all compiler invocations for --sysroot=<path>." ) + set(CLANG_VENDOR "" CACHE STRING "Vendor-specific text for showing with version information.") Modified: vendor/clang/dist/bindings/python/clang/cindex.py ============================================================================== --- vendor/clang/dist/bindings/python/clang/cindex.py Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/bindings/python/clang/cindex.py Thu May 3 16:53:59 2012 (r234973) @@ -1079,6 +1079,11 @@ class TypeKind(object): self._name_map[value] = key return self._name_map[self] + @property + def spelling(self): + """Retrieve the spelling of this TypeKind.""" + return TypeKind_spelling(self.value) + @staticmethod def from_id(id): if id >= len(TypeKind._kinds) or TypeKind._kinds[id] is None: @@ -1088,6 +1093,10 @@ class TypeKind(object): def __repr__(self): return 'TypeKind.%s' % (self.name,) +TypeKind_spelling = lib.clang_getTypeKindSpelling +TypeKind_spelling.argtypes = [c_uint] +TypeKind_spelling.restype = _CXString +TypeKind_spelling.errcheck = _CXString.from_result TypeKind.INVALID = TypeKind(0) Modified: vendor/clang/dist/bindings/python/tests/cindex/test_type.py ============================================================================== --- vendor/clang/dist/bindings/python/tests/cindex/test_type.py Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/bindings/python/tests/cindex/test_type.py Thu May 3 16:53:59 2012 (r234973) @@ -1,5 +1,4 @@ from clang.cindex import CursorKind -from clang.cindex import Index from clang.cindex import TypeKind from nose.tools import raises from .util import get_cursor @@ -109,6 +108,14 @@ def test_equal(): assert a.type != None assert a.type != 'foo' +def test_typekind_spelling(): + """Ensure TypeKind.spelling works.""" + tu = get_tu('int a;') + a = get_cursor(tu, 'a') + + assert a is not None + assert a.type.kind.spelling == 'Int' + def test_function_argument_types(): """Ensure that Type.argument_types() works as expected.""" tu = get_tu('void f(int, int);') Modified: vendor/clang/dist/examples/clang-interpreter/CMakeLists.txt ============================================================================== --- vendor/clang/dist/examples/clang-interpreter/CMakeLists.txt Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/examples/clang-interpreter/CMakeLists.txt Thu May 3 16:53:59 2012 (r234973) @@ -7,7 +7,6 @@ set(LLVM_USED_LIBS clangStaticAnalyzerFrontend clangStaticAnalyzerCheckers clangStaticAnalyzerCore - clangIndex clangAnalysis clangRewrite clangAST Modified: vendor/clang/dist/include/clang/AST/Decl.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Decl.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/AST/Decl.h Thu May 3 16:53:59 2012 (r234973) @@ -64,6 +64,9 @@ public: /// \brief Return the TypeLoc wrapper for the type source info. TypeLoc getTypeLoc() const; // implemented in TypeLoc.h + + /// \brief Override the type stored in this TypeSourceInfo. Use with caution! + void overrideType(QualType T) { Ty = T; } }; /// TranslationUnitDecl - The top declaration context. @@ -242,11 +245,7 @@ public: bool visibilityExplicit() const { return explicit_; } void setLinkage(Linkage L) { linkage_ = L; } - void setVisibility(Visibility V) { visibility_ = V; } void setVisibility(Visibility V, bool E) { visibility_ = V; explicit_ = E; } - void setVisibility(LinkageInfo Other) { - setVisibility(Other.visibility(), Other.visibilityExplicit()); - } void mergeLinkage(Linkage L) { setLinkage(minLinkage(linkage(), L)); Modified: vendor/clang/dist/include/clang/AST/DeclBase.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclBase.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/AST/DeclBase.h Thu May 3 16:53:59 2012 (r234973) @@ -861,7 +861,6 @@ public: void dumpXML(raw_ostream &OS) const; private: - const Attr *getAttrsImpl() const; void setAttrsImpl(const AttrVec& Attrs, ASTContext &Ctx); void setDeclContextsImpl(DeclContext *SemaDC, DeclContext *LexicalDC, ASTContext &Ctx); Modified: vendor/clang/dist/include/clang/AST/DeclLookups.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclLookups.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/AST/DeclLookups.h Thu May 3 16:53:59 2012 (r234973) @@ -67,6 +67,8 @@ public: DeclContext::all_lookups_iterator DeclContext::lookups_begin() const { DeclContext *Primary = const_cast<DeclContext*>(this)->getPrimaryContext(); + if (hasExternalVisibleStorage()) + getParentASTContext().getExternalSource()->completeVisibleDeclsMap(Primary); if (StoredDeclsMap *Map = Primary->buildLookup()) return all_lookups_iterator(Map->begin(), Map->end()); return all_lookups_iterator(); @@ -74,6 +76,8 @@ DeclContext::all_lookups_iterator DeclCo DeclContext::all_lookups_iterator DeclContext::lookups_end() const { DeclContext *Primary = const_cast<DeclContext*>(this)->getPrimaryContext(); + if (hasExternalVisibleStorage()) + getParentASTContext().getExternalSource()->completeVisibleDeclsMap(Primary); if (StoredDeclsMap *Map = Primary->buildLookup()) return all_lookups_iterator(Map->end(), Map->end()); return all_lookups_iterator(); Modified: vendor/clang/dist/include/clang/AST/Expr.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Expr.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/AST/Expr.h Thu May 3 16:53:59 2012 (r234973) @@ -581,16 +581,6 @@ public: /// member expression. static QualType findBoundMemberType(const Expr *expr); - /// \brief Result type of CanThrow(). - enum CanThrowResult { - CT_Cannot, - CT_Dependent, - CT_Can - }; - /// \brief Test if this expression, if evaluated, might throw, according to - /// the rules of C++ [expr.unary.noexcept]. - CanThrowResult CanThrow(ASTContext &C) const; - /// IgnoreImpCasts - Skip past any implicit casts which might /// surround this expression. Only skips ImplicitCastExprs. Expr *IgnoreImpCasts() LLVM_READONLY; @@ -3608,6 +3598,10 @@ public: return LBraceLoc.isValid() && RBraceLoc.isValid(); } + // Is this an initializer for an array of characters, initialized by a string + // literal or an @encode? + bool isStringLiteralInit() const; + SourceLocation getLBraceLoc() const { return LBraceLoc; } void setLBraceLoc(SourceLocation Loc) { LBraceLoc = Loc; } SourceLocation getRBraceLoc() const { return RBraceLoc; } Modified: vendor/clang/dist/include/clang/AST/ExternalASTSource.h ============================================================================== --- vendor/clang/dist/include/clang/AST/ExternalASTSource.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/AST/ExternalASTSource.h Thu May 3 16:53:59 2012 (r234973) @@ -126,6 +126,12 @@ public: virtual DeclContextLookupResult FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name); + /// \brief Ensures that the table of all visible declarations inside this + /// context is up to date. + /// + /// The default implementation of this functino is a no-op. + virtual void completeVisibleDeclsMap(const DeclContext *DC); + /// \brief Finds all declarations lexically contained within the given /// DeclContext, after applying an optional filter predicate. /// Modified: vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h ============================================================================== --- vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h Thu May 3 16:53:59 2012 (r234973) @@ -1870,6 +1870,7 @@ DEF_TRAVERSE_STMT(GotoStmt, { }) DEF_TRAVERSE_STMT(IfStmt, { }) DEF_TRAVERSE_STMT(IndirectGotoStmt, { }) DEF_TRAVERSE_STMT(LabelStmt, { }) +DEF_TRAVERSE_STMT(AttributedStmt, { }) DEF_TRAVERSE_STMT(NullStmt, { }) DEF_TRAVERSE_STMT(ObjCAtCatchStmt, { }) DEF_TRAVERSE_STMT(ObjCAtFinallyStmt, { }) Modified: vendor/clang/dist/include/clang/AST/Stmt.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Stmt.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/AST/Stmt.h Thu May 3 16:53:59 2012 (r234973) @@ -20,6 +20,7 @@ #include "clang/AST/StmtIterator.h" #include "clang/AST/DeclGroup.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/Attr.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/raw_ostream.h" @@ -794,6 +795,47 @@ public: }; +/// \brief Represents an attribute applied to a statement. +/// +/// Represents an attribute applied to a statement. For example: +/// [[omp::for(...)]] for (...) { ... } +/// +class AttributedStmt : public Stmt { + Stmt *SubStmt; + SourceLocation AttrLoc; + AttrVec Attrs; + // TODO: It can be done as Attr *Attrs[1]; and variable size array as in + // StringLiteral + + friend class ASTStmtReader; + +public: + AttributedStmt(SourceLocation loc, const AttrVec &attrs, Stmt *substmt) + : Stmt(AttributedStmtClass), SubStmt(substmt), AttrLoc(loc), Attrs(attrs) { + } + + // \brief Build an empty attributed statement. + explicit AttributedStmt(EmptyShell Empty) + : Stmt(AttributedStmtClass, Empty) { + } + + SourceLocation getAttrLoc() const { return AttrLoc; } + const AttrVec &getAttrs() const { return Attrs; } + Stmt *getSubStmt() { return SubStmt; } + const Stmt *getSubStmt() const { return SubStmt; } + + SourceRange getSourceRange() const LLVM_READONLY { + return SourceRange(AttrLoc, SubStmt->getLocEnd()); + } + child_range children() { return child_range(&SubStmt, &SubStmt + 1); } + + static bool classof(const Stmt *T) { + return T->getStmtClass() == AttributedStmtClass; + } + static bool classof(const AttributedStmt *) { return true; } +}; + + /// IfStmt - This represents an if/then/else. /// class IfStmt : public Stmt { Modified: vendor/clang/dist/include/clang/AST/Type.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Type.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/AST/Type.h Thu May 3 16:53:59 2012 (r234973) @@ -79,6 +79,7 @@ namespace clang { class CXXRecordDecl; class EnumDecl; class FieldDecl; + class FunctionDecl; class ObjCInterfaceDecl; class ObjCProtocolDecl; class ObjCMethodDecl; @@ -2700,7 +2701,9 @@ public: ExtProtoInfo() : Variadic(false), HasTrailingReturn(false), TypeQuals(0), ExceptionSpecType(EST_None), RefQualifier(RQ_None), - NumExceptions(0), Exceptions(0), NoexceptExpr(0), ConsumedArguments(0) {} + NumExceptions(0), Exceptions(0), NoexceptExpr(0), + ExceptionSpecDecl(0), ExceptionSpecTemplate(0), + ConsumedArguments(0) {} FunctionType::ExtInfo ExtInfo; bool Variadic : 1; @@ -2711,6 +2714,8 @@ public: unsigned NumExceptions; const QualType *Exceptions; Expr *NoexceptExpr; + FunctionDecl *ExceptionSpecDecl; + FunctionDecl *ExceptionSpecTemplate; const bool *ConsumedArguments; }; @@ -2756,6 +2761,11 @@ private: // NoexceptExpr - Instead of Exceptions, there may be a single Expr* pointing // to the expression in the noexcept() specifier. + // ExceptionSpecDecl, ExceptionSpecTemplate - Instead of Exceptions, there may + // be a pair of FunctionDecl* pointing to the function which should be used to + // instantiate this function type's exception specification, and the function + // from which it should be instantiated. + // ConsumedArgs - A variable size array, following Exceptions // and of length NumArgs, holding flags indicating which arguments // are consumed. This only appears if HasAnyConsumedArgs is true. @@ -2795,6 +2805,9 @@ public: EPI.Exceptions = exception_begin(); } else if (EPI.ExceptionSpecType == EST_ComputedNoexcept) { EPI.NoexceptExpr = getNoexceptExpr(); + } else if (EPI.ExceptionSpecType == EST_Uninstantiated) { + EPI.ExceptionSpecDecl = getExceptionSpecDecl(); + EPI.ExceptionSpecTemplate = getExceptionSpecTemplate(); } if (hasAnyConsumedArgs()) EPI.ConsumedArguments = getConsumedArgsBuffer(); @@ -2838,9 +2851,26 @@ public: // NoexceptExpr sits where the arguments end. return *reinterpret_cast<Expr *const *>(arg_type_end()); } + /// \brief If this function type has an uninstantiated exception + /// specification, this is the function whose exception specification + /// is represented by this type. + FunctionDecl *getExceptionSpecDecl() const { + if (getExceptionSpecType() != EST_Uninstantiated) + return 0; + return reinterpret_cast<FunctionDecl * const *>(arg_type_end())[0]; + } + /// \brief If this function type has an uninstantiated exception + /// specification, this is the function whose exception specification + /// should be instantiated to find the exception specification for + /// this type. + FunctionDecl *getExceptionSpecTemplate() const { + if (getExceptionSpecType() != EST_Uninstantiated) + return 0; + return reinterpret_cast<FunctionDecl * const *>(arg_type_end())[1]; + } bool isNothrow(ASTContext &Ctx) const { ExceptionSpecificationType EST = getExceptionSpecType(); - assert(EST != EST_Delayed); + assert(EST != EST_Delayed && EST != EST_Uninstantiated); if (EST == EST_DynamicNone || EST == EST_BasicNoexcept) return true; if (EST != EST_ComputedNoexcept) Modified: vendor/clang/dist/include/clang/AST/VTableBuilder.h ============================================================================== --- vendor/clang/dist/include/clang/AST/VTableBuilder.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/AST/VTableBuilder.h Thu May 3 16:53:59 2012 (r234973) @@ -205,11 +205,11 @@ public: typedef llvm::DenseMap<BaseSubobject, uint64_t> AddressPointsMapTy; private: uint64_t NumVTableComponents; - VTableComponent *VTableComponents; + llvm::OwningArrayPtr<VTableComponent> VTableComponents; /// VTableThunks - Contains thunks needed by vtables. uint64_t NumVTableThunks; - VTableThunkTy *VTableThunks; + llvm::OwningArrayPtr<VTableThunkTy> VTableThunks; /// Address points - Address points for all vtables. AddressPointsMapTy AddressPoints; @@ -227,11 +227,11 @@ public: } vtable_component_iterator vtable_component_begin() const { - return VTableComponents; + return VTableComponents.get(); } vtable_component_iterator vtable_component_end() const { - return VTableComponents+NumVTableComponents; + return VTableComponents.get()+NumVTableComponents; } uint64_t getNumVTableThunks() const { @@ -239,11 +239,11 @@ public: } vtable_thunk_iterator vtable_thunk_begin() const { - return VTableThunks; + return VTableThunks.get(); } vtable_thunk_iterator vtable_thunk_end() const { - return VTableThunks+NumVTableThunks; + return VTableThunks.get()+NumVTableThunks; } uint64_t getAddressPoint(BaseSubobject Base) const { Modified: vendor/clang/dist/include/clang/Analysis/ProgramPoint.h ============================================================================== --- vendor/clang/dist/include/clang/Analysis/ProgramPoint.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Analysis/ProgramPoint.h Thu May 3 16:53:59 2012 (r234973) @@ -129,7 +129,7 @@ public: static bool classof(const ProgramPoint*) { return true; } bool operator==(const ProgramPoint & RHS) const { - return Data1 == Data1 && + return Data1 == RHS.Data1 && Data2 == RHS.Data2 && L == RHS.L && Tag == RHS.Tag; Modified: vendor/clang/dist/include/clang/Basic/BuiltinsX86.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/BuiltinsX86.def Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Basic/BuiltinsX86.def Thu May 3 16:53:59 2012 (r234973) @@ -412,6 +412,9 @@ BUILTIN(__builtin_ia32_cvtps2pd256, "V4d BUILTIN(__builtin_ia32_cvttpd2dq256, "V4iV4d", "") BUILTIN(__builtin_ia32_cvtpd2dq256, "V4iV4d", "") BUILTIN(__builtin_ia32_cvttps2dq256, "V8iV8f", "") +BUILTIN(__builtin_ia32_vperm2f128_pd256, "V4dV4dV4dIc", "") +BUILTIN(__builtin_ia32_vperm2f128_ps256, "V8fV8fV8fIc", "") +BUILTIN(__builtin_ia32_vperm2f128_si256, "V8iV8iV8iIc", "") BUILTIN(__builtin_ia32_vinsertf128_pd256, "V4dV4dV2dIc", "") BUILTIN(__builtin_ia32_vinsertf128_ps256, "V8fV8fV4fIc", "") BUILTIN(__builtin_ia32_vinsertf128_si256, "V8iV8iV4iIc", "") @@ -560,9 +563,8 @@ BUILTIN(__builtin_ia32_pbroadcastw128, " BUILTIN(__builtin_ia32_pbroadcastd128, "V4iV4i", "") BUILTIN(__builtin_ia32_pbroadcastq128, "V2LLiV2LLi", "") BUILTIN(__builtin_ia32_permvarsi256, "V8iV8iV8i", "") -BUILTIN(__builtin_ia32_permdf256, "V4dV4dIc", "") BUILTIN(__builtin_ia32_permvarsf256, "V8fV8fV8f", "") -BUILTIN(__builtin_ia32_permdi256, "V4LLiV4LLiIc", "") +BUILTIN(__builtin_ia32_permti256, "V4LLiV4LLiV4LLiIc", "") BUILTIN(__builtin_ia32_extract128i256, "V2LLiV4LLiIc", "") BUILTIN(__builtin_ia32_insert128i256, "V4LLiV4LLiV2LLiIc", "") BUILTIN(__builtin_ia32_maskloadd256, "V8iV8iC*V8i", "") Modified: vendor/clang/dist/include/clang/Basic/ConvertUTF.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/ConvertUTF.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Basic/ConvertUTF.h Thu May 3 16:53:59 2012 (r234973) @@ -151,9 +151,9 @@ ConversionResult ConvertUTF16toUTF32 ( ConversionResult ConvertUTF32toUTF16 ( const UTF32** sourceStart, const UTF32* sourceEnd, UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); +#endif Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); -#endif Boolean isLegalUTF8String(const UTF8 *source, const UTF8 *sourceEnd); Modified: vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td Thu May 3 16:53:59 2012 (r234973) @@ -410,6 +410,8 @@ def ext_ellipsis_exception_spec : Extens "exception specification of '...' is a Microsoft extension">; def err_dynamic_and_noexcept_specification : Error< "cannot have both throw() and noexcept() clause on the same function">; +def err_except_spec_unparsed : Error< + "unexpected end of exception specification">; def warn_cxx98_compat_noexcept_decl : Warning< "noexcept specifications are incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Thu May 3 16:53:59 2012 (r234973) @@ -231,9 +231,13 @@ def err_using_decl_can_not_refer_to_name "using declaration can not refer to namespace">; def err_using_decl_constructor : Error< "using declaration can not refer to a constructor">; -def warn_cxx98_compat_using_decl_constructor : Warning< - "inherited constructors are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; +def err_using_decl_constructor_unsupported : Error< + "inheriting constructors are not supported">; +// FIXME: Replace the above error with this warning if support for +// inheriting constructors is implemented. +//def warn_cxx98_compat_using_decl_constructor : Warning< +// "inheriting constructors are incompatible with C++98">, +// InGroup<CXX98Compat>, DefaultIgnore; def err_using_decl_destructor : Error< "using declaration can not refer to a destructor">; def err_using_decl_template_id : Error< @@ -1547,9 +1551,6 @@ def warn_objc_redundant_literal_use : Wa "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>; } -def warn_bool_for_boolean_literal : Warning< - "BOOL of type %0 is non-intergal and unsuitable for a " - "boolean literal - ignored">, InGroup<DiagGroup<"numeric-literals">>; def err_only_annotate_after_access_spec : Error< "access specifier can only have annotation attributes">; def err_attribute_section_invalid_for_target : Error< @@ -1563,6 +1564,9 @@ def warn_redeclaration_without_attribute def warn_attribute_ignored : Warning<"%0 attribute ignored">; def warn_unknown_attribute_ignored : Warning< "unknown attribute %0 ignored">, InGroup<UnknownAttributes>; +def warn_attribute_invalid_on_stmt : Warning< + "attribute %0 cannot be specified on a statement">, + InGroup<IgnoredAttributes>; def warn_declspec_attribute_ignored : Warning< "attribute %0 is ignored, place it after \"%select{class|struct|union|enum}1\" to apply attribute to type declaration">, InGroup<IgnoredAttributes>; def warn_attribute_precede_definition : Warning< @@ -2583,6 +2587,8 @@ def note_template_enum_def_here : Note< "in instantiation of enumeration %q0 requested here">; def note_template_type_alias_instantiation_here : Note< "in instantiation of template type alias %0 requested here">; +def note_template_exception_spec_instantiation_here : Note< + "in instantiation of exception specification for %0 requested here">; def note_default_arg_instantiation_here : Note< "in instantiation of default argument for '%0' required here">; @@ -3798,6 +3804,9 @@ def warn_null_in_comparison_operation : def err_invalid_this_use : Error< "invalid use of 'this' outside of a non-static member function">; +def err_this_static_member_func : Error< + "'this' cannot be%select{| implicitly}0 used in a static member function " + "declaration">; def err_invalid_member_use_in_static_method : Error< "invalid use of member %0 in static member function">; def err_invalid_qualified_function_type : Error< @@ -3907,7 +3916,7 @@ def err_nosetter_property_incdec : Error def err_nogetter_property_compound_assignment : Error< "a getter method is needed to perform a compound assignment on a property">; def err_nogetter_property_incdec : Error< - "no getter method %1 for %select{increment|decrement} of property">; + "no getter method %1 for %select{increment|decrement}0 of property">; def error_no_subobject_property_setting : Error< "expression is not assignable">; def err_qualified_objc_access : Error< Modified: vendor/clang/dist/include/clang/Basic/ExceptionSpecificationType.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/ExceptionSpecificationType.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Basic/ExceptionSpecificationType.h Thu May 3 16:53:59 2012 (r234973) @@ -16,7 +16,7 @@ namespace clang { -/// \brief The various types of exception specifications that exist in C++0x. +/// \brief The various types of exception specifications that exist in C++11. enum ExceptionSpecificationType { EST_None, ///< no exception specification EST_DynamicNone, ///< throw() @@ -24,7 +24,8 @@ enum ExceptionSpecificationType { EST_MSAny, ///< Microsoft throw(...) extension EST_BasicNoexcept, ///< noexcept EST_ComputedNoexcept, ///< noexcept(expression) - EST_Delayed ///< not known yet + EST_Delayed, ///< not known yet + EST_Uninstantiated ///< not instantiated yet }; inline bool isDynamicExceptionSpec(ExceptionSpecificationType ESpecType) { @@ -35,6 +36,19 @@ inline bool isNoexceptExceptionSpec(Exce return ESpecType == EST_BasicNoexcept || ESpecType == EST_ComputedNoexcept; } +/// \brief Possible results from evaluation of a noexcept expression. +enum CanThrowResult { + CT_Cannot, + CT_Dependent, + CT_Can +}; + +inline CanThrowResult mergeCanThrow(CanThrowResult CT1, CanThrowResult CT2) { + // CanThrowResult constants are ordered so that the maximum is the correct + // merge result. + return CT1 > CT2 ? CT1 : CT2; +} + } // end namespace clang #endif // LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H Modified: vendor/clang/dist/include/clang/Basic/OnDiskHashTable.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/OnDiskHashTable.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Basic/OnDiskHashTable.h Thu May 3 16:53:59 2012 (r234973) @@ -132,7 +132,7 @@ class OnDiskChainedHashTableGenerator { class Bucket { public: io::Offset off; - Item* head; + Item* head; unsigned length; Bucket() {} @@ -201,6 +201,7 @@ public: // Write out the number of items in the bucket. Emit16(out, B.length); + assert(B.length != 0 && "Bucket has a head but zero length?"); // Write out the entries in the bucket. for (Item *I = B.head; I ; I = I->next) { @@ -398,31 +399,30 @@ public: } key_iterator key_end() { return key_iterator(); } - /// \brief Iterates over all the entries in the table, returning - /// a key/data pair. - class item_iterator { + /// \brief Iterates over all the entries in the table, returning the data. + class data_iterator { const unsigned char* Ptr; unsigned NumItemsInBucketLeft; unsigned NumEntriesLeft; Info *InfoObj; public: - typedef std::pair<external_key_type, data_type> value_type; + typedef data_type value_type; - item_iterator(const unsigned char* const Ptr, unsigned NumEntries, + data_iterator(const unsigned char* const Ptr, unsigned NumEntries, Info *InfoObj) : Ptr(Ptr), NumItemsInBucketLeft(0), NumEntriesLeft(NumEntries), InfoObj(InfoObj) { } - item_iterator() + data_iterator() : Ptr(0), NumItemsInBucketLeft(0), NumEntriesLeft(0), InfoObj(0) { } - bool operator==(const item_iterator& X) const { + bool operator==(const data_iterator& X) const { return X.NumEntriesLeft == NumEntriesLeft; } - bool operator!=(const item_iterator& X) const { + bool operator!=(const data_iterator& X) const { return X.NumEntriesLeft != NumEntriesLeft; } - item_iterator& operator++() { // Preincrement + data_iterator& operator++() { // Preincrement if (!NumItemsInBucketLeft) { // 'Items' starts with a 16-bit unsigned integer representing the // number of items in this bucket. @@ -438,8 +438,8 @@ public: --NumEntriesLeft; return *this; } - item_iterator operator++(int) { // Postincrement - item_iterator tmp = *this; ++*this; return tmp; + data_iterator operator++(int) { // Postincrement + data_iterator tmp = *this; ++*this; return tmp; } value_type operator*() const { @@ -454,15 +454,14 @@ public: // Read the key. const internal_key_type& Key = InfoObj->ReadKey(LocalPtr, L.first); - return std::make_pair(InfoObj->GetExternalKey(Key), - InfoObj->ReadData(Key, LocalPtr + L.first, L.second)); + return InfoObj->ReadData(Key, LocalPtr + L.first, L.second); } }; - item_iterator item_begin() { - return item_iterator(Base + 4, getNumEntries(), &InfoObj); + data_iterator data_begin() { + return data_iterator(Base + 4, getNumEntries(), &InfoObj); } - item_iterator item_end() { return item_iterator(); } + data_iterator data_end() { return data_iterator(); } Info &getInfoObj() { return InfoObj; } Modified: vendor/clang/dist/include/clang/Basic/StmtNodes.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/StmtNodes.td Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Basic/StmtNodes.td Thu May 3 16:53:59 2012 (r234973) @@ -12,6 +12,7 @@ class DStmt<Stmt base, bit abstract = 0> def NullStmt : Stmt; def CompoundStmt : Stmt; def LabelStmt : Stmt; +def AttributedStmt : Stmt; def IfStmt : Stmt; def SwitchStmt : Stmt; def WhileStmt : Stmt; Modified: vendor/clang/dist/include/clang/Basic/TargetInfo.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/TargetInfo.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Basic/TargetInfo.h Thu May 3 16:53:59 2012 (r234973) @@ -132,6 +132,11 @@ protected: IntType SizeType, IntMaxType, UIntMaxType, PtrDiffType, IntPtrType, WCharType, WIntType, Char16Type, Char32Type, Int64Type, SigAtomicType; + /// Flag whether the Objective-C built-in boolean type should be signed char. + /// Otherwise, when this flag is not set, the normal built-in boolean type is + /// used. + unsigned UseSignedCharForObjCBool : 1; + /// Control whether the alignment of bit-field types is respected when laying /// out structures. If true, then the alignment of the bit-field type will be /// used to (a) impact the alignment of the containing structure, and (b) @@ -299,6 +304,16 @@ public: return MCountName; } + /// useSignedCharForObjCBool - Check if the Objective-C built-in boolean + /// type should be signed char. Otherwise, if this returns false, the + /// normal built-in boolean type should also be used for Objective-C. + bool useSignedCharForObjCBool() const { + return UseSignedCharForObjCBool; + } + void noSignedCharForObjCBool() { + UseSignedCharForObjCBool = false; + } + /// useBitFieldTypeAlignment() - Check whether the alignment of bit-field /// types is respected when laying out structures. bool useBitFieldTypeAlignment() const { Modified: vendor/clang/dist/include/clang/Basic/TokenKinds.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/TokenKinds.def Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Basic/TokenKinds.def Thu May 3 16:53:59 2012 (r234973) @@ -105,6 +105,7 @@ TOK(eod) // End of prepr // directive). TOK(code_completion) // Code completion marker TOK(cxx_defaultarg_end) // C++ default argument end marker +TOK(cxx_exceptspec_end) // C++ exception-specification end marker // C99 6.4.9: Comments. TOK(comment) // Comment (only in -E -C[C] mode) Modified: vendor/clang/dist/include/clang/Config/config.h.cmake ============================================================================== --- vendor/clang/dist/include/clang/Config/config.h.cmake Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Config/config.h.cmake Thu May 3 16:53:59 2012 (r234973) @@ -4,8 +4,11 @@ /* Relative directory for resource files */ #define CLANG_RESOURCE_DIR "${CLANG_RESOURCE_DIR}" -/* Directory where gcc is installed. */ -#define GCC_INSTALL_PREFIX "${GCC_INSTALL_PREFIX}" - /* Directories clang will search for headers */ #define C_INCLUDE_DIRS "${C_INCLUDE_DIRS}" + +/* Default <path> to all compiler invocations for --sysroot=<path>. */ +#define DEFAULT_SYSROOT "${DEFAULT_SYSROOT}" + +/* Directory where gcc is installed. */ +#define GCC_INSTALL_PREFIX "${GCC_INSTALL_PREFIX}" Modified: vendor/clang/dist/include/clang/Config/config.h.in ============================================================================== --- vendor/clang/dist/include/clang/Config/config.h.in Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Config/config.h.in Thu May 3 16:53:59 2012 (r234973) @@ -9,13 +9,16 @@ /* Relative directory for resource files */ #undef CLANG_RESOURCE_DIR -/* Directory where gcc is installed. */ -#undef GCC_INSTALL_PREFIX - /* Directories clang will search for headers */ #undef C_INCLUDE_DIRS /* Linker version detected at compile time. */ #undef HOST_LINK_VERSION +/* Default <path> to all compiler invocations for --sysroot=<path>. */ +#undef DEFAULT_SYSROOT + +/* Directory where gcc is installed. */ +#undef GCC_INSTALL_PREFIX + #endif Modified: vendor/clang/dist/include/clang/Driver/CC1Options.td ============================================================================== --- vendor/clang/dist/include/clang/Driver/CC1Options.td Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Driver/CC1Options.td Thu May 3 16:53:59 2012 (r234973) @@ -428,9 +428,6 @@ def ast_view : Flag<"-ast-view">, HelpText<"Build ASTs and view them with GraphViz">; def print_decl_contexts : Flag<"-print-decl-contexts">, HelpText<"Print DeclContexts and their Decls">; -def pubnames_dump : Flag<"-pubnames-dump">, - HelpText<"Print all of the public (global) names in the source, e.g., the " - "names of all global declarations and macros">; def emit_module : Flag<"-emit-module">, HelpText<"Generate pre-compiled module file from a module map">; def emit_pth : Flag<"-emit-pth">, Modified: vendor/clang/dist/include/clang/Driver/Compilation.h ============================================================================== --- vendor/clang/dist/include/clang/Driver/Compilation.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Driver/Compilation.h Thu May 3 16:53:59 2012 (r234973) @@ -92,6 +92,9 @@ public: return FailureResultFiles; } + /// Returns the sysroot path. + StringRef getSysRoot() const; + /// getArgsForToolChain - Return the derived argument list for the /// tool chain \arg TC (or the default tool chain, if TC is not /// specified). Modified: vendor/clang/dist/include/clang/Frontend/ASTUnit.h ============================================================================== --- vendor/clang/dist/include/clang/Frontend/ASTUnit.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Frontend/ASTUnit.h Thu May 3 16:53:59 2012 (r234973) @@ -14,7 +14,6 @@ #ifndef LLVM_CLANG_FRONTEND_ASTUNIT_H #define LLVM_CLANG_FRONTEND_ASTUNIT_H -#include "clang/Index/ASTLocation.h" #include "clang/Serialization/ASTBitCodes.h" #include "clang/Sema/Sema.h" #include "clang/Sema/CodeCompleteConsumer.h" @@ -57,8 +56,6 @@ class SourceManager; class TargetInfo; class ASTFrontendAction; -using namespace idx; - /// \brief Utility class for loading a ASTContext from an AST file. /// class ASTUnit : public ModuleLoader { @@ -134,9 +131,6 @@ private: /// The name of the original source file used to generate this ASTUnit. std::string OriginalSourceFile; - // Critical optimization when using clang_getCursor(). - ASTLocation LastLoc; - /// \brief The set of diagnostics produced when creating the preamble. SmallVector<StoredDiagnostic, 4> PreambleDiagnostics; @@ -474,10 +468,6 @@ public: bool getOwnsRemappedFileBuffers() const { return OwnsRemappedFileBuffers; } void setOwnsRemappedFileBuffers(bool val) { OwnsRemappedFileBuffers = val; } - void setLastASTLocation(ASTLocation ALoc) { LastLoc = ALoc; } - ASTLocation getLastASTLocation() const { return LastLoc; } - - StringRef getMainFileName() const; typedef std::vector<Decl *>::iterator top_level_iterator; Modified: vendor/clang/dist/include/clang/Frontend/FrontendActions.h ============================================================================== --- vendor/clang/dist/include/clang/Frontend/FrontendActions.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Frontend/FrontendActions.h Thu May 3 16:53:59 2012 (r234973) @@ -173,15 +173,6 @@ protected: virtual bool usesPreprocessorOnly() const { return true; } }; -class PubnamesDumpAction : public ASTFrontendAction { -protected: - virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI, - StringRef InFile); - -public: - virtual bool hasCodeCompletionSupport() const { return false; } -}; - //===----------------------------------------------------------------------===// // Preprocessor Actions //===----------------------------------------------------------------------===// Modified: vendor/clang/dist/include/clang/Frontend/FrontendOptions.h ============================================================================== --- vendor/clang/dist/include/clang/Frontend/FrontendOptions.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Frontend/FrontendOptions.h Thu May 3 16:53:59 2012 (r234973) @@ -42,7 +42,6 @@ namespace frontend { PrintDeclContext, ///< Print DeclContext and their Decls. PrintPreamble, ///< Print the "preamble" of the input file PrintPreprocessedInput, ///< -E mode. - PubnamesDump, ///< Print all of the "public" names in the source. RewriteMacros, ///< Expand macros but not #includes. RewriteObjC, ///< ObjC->C Rewriter. RewriteTest, ///< Rewriter playground Modified: vendor/clang/dist/include/clang/Frontend/TextDiagnostic.h ============================================================================== --- vendor/clang/dist/include/clang/Frontend/TextDiagnostic.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Frontend/TextDiagnostic.h Thu May 3 16:53:59 2012 (r234973) @@ -18,6 +18,8 @@ #include "clang/Frontend/DiagnosticRenderer.h" +struct SourceColumnMap; + namespace clang { /// \brief Class to encapsulate the logic for formatting and printing a textual @@ -103,15 +105,16 @@ private: SmallVectorImpl<CharSourceRange>& Ranges, ArrayRef<FixItHint> Hints); + void emitSnippet(StringRef SourceLine); + void highlightRange(const CharSourceRange &R, unsigned LineNo, FileID FID, - const std::string &SourceLine, + const SourceColumnMap &map, std::string &CaretLine); + std::string buildFixItInsertionLine(unsigned LineNo, - const char *LineStart, - const char *LineEnd, + const SourceColumnMap &map, ArrayRef<FixItHint> Hints); - void expandTabs(std::string &SourceLine, std::string &CaretLine); void emitParseableFixits(ArrayRef<FixItHint> Hints); }; Modified: vendor/clang/dist/include/clang/Parse/Parser.h ============================================================================== --- vendor/clang/dist/include/clang/Parse/Parser.h Thu May 3 16:52:07 2012 (r234972) +++ vendor/clang/dist/include/clang/Parse/Parser.h Thu May 3 16:53:59 2012 (r234973) @@ -15,7 +15,6 @@ #define LLVM_CLANG_PARSE_PARSER_H #include "clang/Basic/Specifiers.h" -#include "clang/Basic/DelayedCleanupPool.h" #include "clang/Lex/Preprocessor.h" #include "clang/Lex/CodeCompletionHandler.h" #include "clang/Sema/Sema.h" @@ -192,9 +191,9 @@ class Parser : public CodeCompletionHand /// Factory object for creating AttributeList objects. AttributeFactory AttrFactory; - /// \brief Gathers and cleans up objects when parsing of a top-level - /// declaration is finished. - DelayedCleanupPool TopLevelDeclCleanupPool; + /// \brief Gathers and cleans up TemplateIdAnnotations when parsing of a + /// top-level declaration is finished. + SmallVector<TemplateIdAnnotation *, 16> TemplateIds; IdentifierInfo *getSEHExceptKeyword(); @@ -568,9 +567,7 @@ private: const char *&PrevSpec, unsigned &DiagID, bool &isInvalid); - /// \brief Get the TemplateIdAnnotation from the token and put it in the - /// cleanup pool so that it gets destroyed when parsing the current top level - /// declaration is finished. + /// \brief Get the TemplateIdAnnotation from the token. TemplateIdAnnotation *takeTemplateIdAnnotation(const Token &tok); /// TentativeParsingAction - An object that is used as a kind of "tentative @@ -858,7 +855,7 @@ private: /// argument (C++ [class.mem]p2). struct LateParsedMethodDeclaration : public LateParsedDeclaration { explicit LateParsedMethodDeclaration(Parser *P, Decl *M) - : Self(P), Method(M), TemplateScope(false) { } + : Self(P), Method(M), TemplateScope(false), ExceptionSpecTokens(0) { } virtual void ParseLexedMethodDeclarations(); @@ -878,6 +875,10 @@ private: /// method will be stored so that they can be reintroduced into /// scope at the appropriate times. SmallVector<LateParsedDefaultArgument, 8> DefaultArgs; + + /// \brief The set of tokens that make up an exception-specification that + /// has not yet been parsed. + CachedTokens *ExceptionSpecTokens; }; /// LateParsedMemberInitializer - An initializer for a non-static class data @@ -1420,11 +1421,13 @@ private: // C++ 15: C++ Throw Expression ExprResult ParseThrowExpression(); - ExceptionSpecificationType MaybeParseExceptionSpecification( + ExceptionSpecificationType tryParseExceptionSpecification( + bool Delayed, SourceRange &SpecificationRange, SmallVectorImpl<ParsedType> &DynamicExceptions, SmallVectorImpl<SourceRange> &DynamicExceptionRanges, - ExprResult &NoexceptExpr); + ExprResult &NoexceptExpr, + CachedTokens *&ExceptionSpecTokens); // EndLoc is filled with the location of the last token of the specification. ExceptionSpecificationType ParseDynamicExceptionSpecification( @@ -1517,42 +1520,40 @@ private: //===--------------------------------------------------------------------===// // C99 6.8: Statements and Blocks. - StmtResult ParseStatement(SourceLocation *TrailingElseLoc = NULL) { + StmtResult ParseStatement(SourceLocation *TrailingElseLoc = 0) { StmtVector Stmts(Actions); return ParseStatementOrDeclaration(Stmts, true, TrailingElseLoc); } - StmtResult ParseStatementOrDeclaration(StmtVector& Stmts, + StmtResult ParseStatementOrDeclaration(StmtVector &Stmts, + bool OnlyStatement, + SourceLocation *TrailingElseLoc = 0); + StmtResult ParseStatementOrDeclarationAfterAttributes( + StmtVector &Stmts, bool OnlyStatement, - SourceLocation *TrailingElseLoc = NULL); - StmtResult ParseExprStatement(ParsedAttributes &Attrs); - StmtResult ParseLabeledStatement(ParsedAttributes &Attr); - StmtResult ParseCaseStatement(ParsedAttributes &Attr, - bool MissingCase = false, + SourceLocation *TrailingElseLoc, + ParsedAttributesWithRange &Attrs); + StmtResult ParseExprStatement(); + StmtResult ParseLabeledStatement(ParsedAttributesWithRange &attrs); + StmtResult ParseCaseStatement(bool MissingCase = false, ExprResult Expr = ExprResult()); - StmtResult ParseDefaultStatement(ParsedAttributes &Attr); - StmtResult ParseCompoundStatement(ParsedAttributes &Attr, - bool isStmtExpr = false); - StmtResult ParseCompoundStatement(ParsedAttributes &Attr, - bool isStmtExpr, + StmtResult ParseDefaultStatement(); + StmtResult ParseCompoundStatement(bool isStmtExpr = false); + StmtResult ParseCompoundStatement(bool isStmtExpr, unsigned ScopeFlags); StmtResult ParseCompoundStatementBody(bool isStmtExpr = false); bool ParseParenExprOrCondition(ExprResult &ExprResult, Decl *&DeclResult, SourceLocation Loc, bool ConvertToBoolean); - StmtResult ParseIfStatement(ParsedAttributes &Attr, - SourceLocation *TrailingElseLoc); - StmtResult ParseSwitchStatement(ParsedAttributes &Attr, - SourceLocation *TrailingElseLoc); - StmtResult ParseWhileStatement(ParsedAttributes &Attr, - SourceLocation *TrailingElseLoc); - StmtResult ParseDoStatement(ParsedAttributes &Attr); - StmtResult ParseForStatement(ParsedAttributes &Attr, - SourceLocation *TrailingElseLoc); - StmtResult ParseGotoStatement(ParsedAttributes &Attr); - StmtResult ParseContinueStatement(ParsedAttributes &Attr); - StmtResult ParseBreakStatement(ParsedAttributes &Attr); - StmtResult ParseReturnStatement(ParsedAttributes &Attr); + StmtResult ParseIfStatement(SourceLocation *TrailingElseLoc); + StmtResult ParseSwitchStatement(SourceLocation *TrailingElseLoc); + StmtResult ParseWhileStatement(SourceLocation *TrailingElseLoc); + StmtResult ParseDoStatement(); + StmtResult ParseForStatement(SourceLocation *TrailingElseLoc); + StmtResult ParseGotoStatement(); + StmtResult ParseContinueStatement(); + StmtResult ParseBreakStatement(); + StmtResult ParseReturnStatement(); StmtResult ParseAsmStatement(bool &msAsm); StmtResult ParseMicrosoftAsmStatement(SourceLocation AsmLoc); @@ -1586,7 +1587,7 @@ private: /// \brief The behavior of this __if_exists or __if_not_exists block /// should. IfExistsBehavior Behavior; -}; + }; bool ParseMicrosoftIfExistsCondition(IfExistsCondition& Result); void ParseMicrosoftIfExistsStatement(StmtVector &Stmts); @@ -1602,14 +1603,14 @@ private: //===--------------------------------------------------------------------===// // C++ 6: Statements and Blocks - StmtResult ParseCXXTryBlock(ParsedAttributes &Attr); + StmtResult ParseCXXTryBlock(); StmtResult ParseCXXTryBlockCommon(SourceLocation TryLoc); StmtResult ParseCXXCatchBlock(); //===--------------------------------------------------------------------===// // MS: SEH Statements and Blocks - StmtResult ParseSEHTryBlock(ParsedAttributes &Attr); + StmtResult ParseSEHTryBlock(); StmtResult ParseSEHTryBlockCommon(SourceLocation Loc); StmtResult ParseSEHExceptBlock(SourceLocation Loc); StmtResult ParseSEHFinallyBlock(SourceLocation Loc); @@ -1883,6 +1884,7 @@ private: void ProhibitAttributes(ParsedAttributesWithRange &attrs) { if (!attrs.Range.isValid()) return; DiagnoseProhibitedAttributes(attrs); + attrs.clear(); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205031654.q43Gs1Ek052968>