From 29cafa66ad3878dbb9f82615f19fa0bded2e443c Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 12 Jun 2011 15:46:16 +0000 Subject: Vendor import of clang trunk r132879: http://llvm.org/svn/llvm-project/cfe/trunk@132879 --- CMakeLists.txt | 9 +- clang.xcodeproj/project.pbxproj | 15 + docs/LanguageExtensions.html | 340 +++- docs/Makefile | 4 +- docs/UsersManual.html | 31 + docs/doxygen.cfg | 1230 ------------ docs/doxygen.cfg.in | 18 +- docs/libIndex.html | 267 --- examples/CMakeLists.txt | 1 - examples/Tooling/CMakeLists.txt | 6 - examples/Tooling/ClangCheck.cpp | 108 -- examples/Tooling/Makefile | 24 - examples/clang-interpreter/Makefile | 5 +- examples/clang-interpreter/main.cpp | 2 +- examples/wpa/Makefile | 9 +- include/clang-c/Index.h | 40 +- include/clang/AST/APValue.h | 8 +- include/clang/AST/ASTContext.h | 56 +- include/clang/AST/CanonicalType.h | 10 + include/clang/AST/Decl.h | 125 +- include/clang/AST/DeclBase.h | 11 +- include/clang/AST/DeclCXX.h | 184 +- include/clang/AST/DeclObjC.h | 20 +- include/clang/AST/DeclTemplate.h | 75 + include/clang/AST/Expr.h | 66 +- include/clang/AST/ExternalASTSource.h | 2 +- include/clang/AST/RecursiveASTVisitor.h | 17 + include/clang/AST/StmtVisitor.h | 57 +- include/clang/AST/Type.h | 95 +- include/clang/AST/TypeLoc.h | 47 + include/clang/AST/TypeNodes.def | 1 + include/clang/Basic/BuiltinsARM.def | 14 + include/clang/Basic/BuiltinsX86.def | 1 - include/clang/Basic/DeclNodes.td | 1 + include/clang/Basic/Diagnostic.h | 9 +- include/clang/Basic/DiagnosticCommonKinds.td | 6 + include/clang/Basic/DiagnosticFrontendKinds.td | 3 + include/clang/Basic/DiagnosticGroups.td | 8 +- include/clang/Basic/DiagnosticIDs.h | 21 +- include/clang/Basic/DiagnosticParseKinds.td | 22 + include/clang/Basic/DiagnosticSemaKinds.td | 263 ++- include/clang/Basic/ExceptionSpecificationType.h | 13 +- include/clang/Basic/IdentifierTable.h | 3 +- include/clang/Basic/LangOptions.h | 3 + include/clang/Basic/SourceLocation.h | 3 + include/clang/Basic/SourceManager.h | 8 + include/clang/Basic/Specifiers.h | 1 + include/clang/Basic/StmtNodes.td | 2 + include/clang/Basic/TargetInfo.h | 9 +- include/clang/Basic/TokenKinds.def | 7 + include/clang/Basic/TypeTraits.h | 3 +- include/clang/Basic/arm_neon.td | 7 +- include/clang/Driver/CC1AsOptions.td | 3 + include/clang/Driver/CC1Options.td | 13 + include/clang/Driver/Options.td | 17 +- include/clang/Driver/ToolChain.h | 2 +- include/clang/Frontend/ASTUnit.h | 26 +- include/clang/Frontend/CodeGenOptions.h | 4 + include/clang/Frontend/DiagnosticOptions.h | 5 + include/clang/Frontend/LangStandard.h | 20 +- include/clang/Frontend/LangStandards.def | 11 +- include/clang/Frontend/PreprocessorOptions.h | 5 + include/clang/Frontend/Utils.h | 3 - include/clang/Lex/HeaderSearch.h | 46 +- include/clang/Lex/LiteralSupport.h | 8 +- include/clang/Lex/PreprocessingRecord.h | 11 +- include/clang/Lex/Preprocessor.h | 3 +- include/clang/Parse/Parser.h | 60 +- include/clang/Sema/CodeCompleteConsumer.h | 5 +- include/clang/Sema/DeclSpec.h | 45 +- include/clang/Sema/Initialization.h | 49 +- include/clang/Sema/Lookup.h | 16 + include/clang/Sema/Overload.h | 3 +- include/clang/Sema/Scope.h | 7 +- include/clang/Sema/Sema.h | 326 +++- include/clang/Sema/Template.h | 3 +- include/clang/Serialization/ASTBitCodes.h | 37 +- include/clang/Serialization/ASTReader.h | 24 + include/clang/Serialization/ASTWriter.h | 23 +- include/clang/StaticAnalyzer/Core/Checker.h | 22 +- include/clang/StaticAnalyzer/Core/CheckerManager.h | 35 +- .../Core/PathSensitive/BasicValueFactory.h | 9 +- .../StaticAnalyzer/Core/PathSensitive/ExprEngine.h | 16 +- .../StaticAnalyzer/Core/PathSensitive/GRState.h | 6 + .../Core/PathSensitive/ObjCMessage.h | 1 + .../Core/PathSensitive/SValBuilder.h | 2 +- .../StaticAnalyzer/Core/PathSensitive/Store.h | 2 +- .../StaticAnalyzer/Core/PathSensitive/SubEngine.h | 17 +- include/clang/Tooling/Tooling.h | 81 - lib/AST/APValue.cpp | 8 +- lib/AST/ASTContext.cpp | 351 +++- lib/AST/ASTDiagnostic.cpp | 8 +- lib/AST/ASTImporter.cpp | 29 +- lib/AST/Decl.cpp | 78 +- lib/AST/DeclBase.cpp | 9 +- lib/AST/DeclCXX.cpp | 323 ++-- lib/AST/DeclObjC.cpp | 3 + lib/AST/DeclPrinter.cpp | 126 +- lib/AST/DeclTemplate.cpp | 31 + lib/AST/DumpXML.cpp | 10 +- lib/AST/Expr.cpp | 75 +- lib/AST/ExprClassification.cpp | 11 +- lib/AST/ExprConstant.cpp | 616 +++--- lib/AST/ExternalASTSource.cpp | 2 + lib/AST/ItaniumMangle.cpp | 141 +- lib/AST/Mangle.cpp | 5 + lib/AST/MicrosoftMangle.cpp | 4 + lib/AST/RecordLayoutBuilder.cpp | 154 +- lib/AST/StmtPrinter.cpp | 10 +- lib/AST/StmtProfile.cpp | 4 + lib/AST/Type.cpp | 116 +- lib/AST/TypePrinter.cpp | 17 +- lib/Analysis/AnalysisContext.cpp | 8 +- lib/Analysis/CFG.cpp | 69 +- lib/Analysis/CocoaConventions.cpp | 1 + lib/Analysis/LiveVariables.cpp | 2 +- lib/Analysis/UninitializedValues.cpp | 51 +- lib/Basic/Diagnostic.cpp | 47 +- lib/Basic/DiagnosticIDs.cpp | 185 +- lib/Basic/FileManager.cpp | 4 - lib/Basic/IdentifierTable.cpp | 1 + lib/Basic/SourceManager.cpp | 73 + lib/Basic/Targets.cpp | 46 +- lib/CMakeLists.txt | 1 - lib/CodeGen/BackendUtil.cpp | 75 +- lib/CodeGen/CGBlocks.cpp | 64 +- lib/CodeGen/CGBuiltin.cpp | 59 +- lib/CodeGen/CGCXX.cpp | 24 +- lib/CodeGen/CGCall.cpp | 120 +- lib/CodeGen/CGCall.h | 9 +- lib/CodeGen/CGClass.cpp | 262 ++- lib/CodeGen/CGDebugInfo.cpp | 60 +- lib/CodeGen/CGDebugInfo.h | 2 + lib/CodeGen/CGDecl.cpp | 19 +- lib/CodeGen/CGDeclCXX.cpp | 12 +- lib/CodeGen/CGException.cpp | 188 +- lib/CodeGen/CGExpr.cpp | 5 +- lib/CodeGen/CGExprAgg.cpp | 2 +- lib/CodeGen/CGExprCXX.cpp | 437 +++-- lib/CodeGen/CGExprConstant.cpp | 11 +- lib/CodeGen/CGExprScalar.cpp | 100 +- lib/CodeGen/CGObjC.cpp | 100 +- lib/CodeGen/CGObjCGNU.cpp | 99 +- lib/CodeGen/CGObjCMac.cpp | 755 ++++---- lib/CodeGen/CGObjCRuntime.cpp | 13 +- lib/CodeGen/CGObjCRuntime.h | 7 +- lib/CodeGen/CGRecordLayoutBuilder.cpp | 8 +- lib/CodeGen/CGStmt.cpp | 12 +- lib/CodeGen/CGVTT.cpp | 2 + lib/CodeGen/CGVTables.cpp | 183 +- lib/CodeGen/CodeGenFunction.cpp | 64 +- lib/CodeGen/CodeGenFunction.h | 25 +- lib/CodeGen/CodeGenModule.cpp | 189 +- lib/CodeGen/CodeGenModule.h | 10 +- lib/CodeGen/CodeGenTypes.h | 5 +- lib/CodeGen/ItaniumCXXABI.cpp | 14 +- lib/CodeGen/ModuleBuilder.cpp | 2 +- lib/CodeGen/TargetInfo.cpp | 90 +- lib/Driver/Driver.cpp | 31 +- lib/Driver/HostInfo.cpp | 15 +- lib/Driver/ToolChains.cpp | 205 +- lib/Driver/ToolChains.h | 5 +- lib/Driver/Tools.cpp | 242 ++- lib/Driver/Tools.h | 14 +- lib/Frontend/ASTConsumers.cpp | 2 +- lib/Frontend/ASTUnit.cpp | 137 +- lib/Frontend/CMakeLists.txt | 1 - lib/Frontend/CompilerInstance.cpp | 3 +- lib/Frontend/CompilerInvocation.cpp | 69 +- lib/Frontend/CreateInvocationFromCommandLine.cpp | 2 +- lib/Frontend/DiagChecker.cpp | 301 --- lib/Frontend/InitHeaderSearch.cpp | 52 +- lib/Frontend/InitPreprocessor.cpp | 69 +- lib/Frontend/LogDiagnosticPrinter.cpp | 4 +- lib/Frontend/TextDiagnosticPrinter.cpp | 36 +- lib/Frontend/Warnings.cpp | 51 +- lib/Headers/emmintrin.h | 14 +- lib/Headers/mmintrin.h | 8 +- lib/Headers/xmmintrin.h | 5 +- lib/Index/CallGraph.cpp | 2 +- lib/Index/Indexer.cpp | 2 +- lib/Lex/HeaderSearch.cpp | 18 +- lib/Lex/Lexer.cpp | 3 +- lib/Lex/LiteralSupport.cpp | 19 +- lib/Lex/MacroInfo.cpp | 1 + lib/Lex/PPDirectives.cpp | 4 +- lib/Lex/PPMacroExpansion.cpp | 53 +- lib/Lex/Pragma.cpp | 23 +- lib/Lex/PreprocessingRecord.cpp | 8 +- lib/Lex/Preprocessor.cpp | 5 +- lib/Makefile | 2 +- lib/Parse/ParseCXXInlineMethods.cpp | 157 +- lib/Parse/ParseDecl.cpp | 60 +- lib/Parse/ParseDeclCXX.cpp | 487 ++++- lib/Parse/ParseExpr.cpp | 72 +- lib/Parse/ParseExprCXX.cpp | 72 +- lib/Parse/ParseObjc.cpp | 8 +- lib/Parse/ParsePragma.cpp | 1 - lib/Parse/ParseStmt.cpp | 37 + lib/Parse/ParseTemplate.cpp | 8 +- lib/Parse/ParseTentative.cpp | 6 + lib/Parse/Parser.cpp | 155 +- lib/Rewrite/RewriteObjC.cpp | 15 +- lib/Sema/AnalysisBasedWarnings.cpp | 7 +- lib/Sema/DeclSpec.cpp | 1 + lib/Sema/JumpDiagnostics.cpp | 50 +- lib/Sema/Sema.cpp | 154 +- lib/Sema/SemaAccess.cpp | 102 +- lib/Sema/SemaCXXCast.cpp | 75 +- lib/Sema/SemaCXXScopeSpec.cpp | 45 +- lib/Sema/SemaChecking.cpp | 96 +- lib/Sema/SemaCodeComplete.cpp | 162 +- lib/Sema/SemaDecl.cpp | 474 +++-- lib/Sema/SemaDeclCXX.cpp | 2004 +++++++++++++++++--- lib/Sema/SemaDeclObjC.cpp | 287 ++- lib/Sema/SemaExceptionSpec.cpp | 28 +- lib/Sema/SemaExpr.cpp | 719 ++++--- lib/Sema/SemaExprCXX.cpp | 238 ++- lib/Sema/SemaExprObjC.cpp | 119 +- lib/Sema/SemaInit.cpp | 103 +- lib/Sema/SemaLookup.cpp | 211 ++- lib/Sema/SemaOverload.cpp | 235 ++- lib/Sema/SemaStmt.cpp | 134 +- lib/Sema/SemaTemplate.cpp | 688 +++++-- lib/Sema/SemaTemplateDeduction.cpp | 19 +- lib/Sema/SemaTemplateInstantiate.cpp | 81 +- lib/Sema/SemaTemplateInstantiateDecl.cpp | 162 +- lib/Sema/SemaTemplateVariadic.cpp | 3 +- lib/Sema/SemaType.cpp | 182 +- lib/Sema/TreeTransform.h | 139 +- lib/Serialization/ASTReader.cpp | 211 ++- lib/Serialization/ASTReaderDecl.cpp | 40 +- lib/Serialization/ASTReaderStmt.cpp | 6 +- lib/Serialization/ASTWriter.cpp | 109 +- lib/Serialization/ASTWriterDecl.cpp | 399 +++- lib/Serialization/ASTWriterStmt.cpp | 31 +- lib/StaticAnalyzer/Checkers/CStringChecker.cpp | 112 +- lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp | 2 +- lib/StaticAnalyzer/Core/BasicStore.cpp | 18 +- lib/StaticAnalyzer/Core/BasicValueFactory.cpp | 3 +- lib/StaticAnalyzer/Core/CFRefCount.cpp | 251 ++- lib/StaticAnalyzer/Core/CXXExprEngine.cpp | 4 +- lib/StaticAnalyzer/Core/CheckerManager.cpp | 17 +- lib/StaticAnalyzer/Core/Environment.cpp | 27 +- lib/StaticAnalyzer/Core/ExprEngine.cpp | 34 +- lib/StaticAnalyzer/Core/FlatStore.cpp | 4 +- lib/StaticAnalyzer/Core/GRState.cpp | 16 +- lib/StaticAnalyzer/Core/ObjCMessage.cpp | 7 + lib/StaticAnalyzer/Core/RegionStore.cpp | 26 +- .../Core/SimpleConstraintManager.cpp | 3 +- lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp | 6 +- lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp | 13 +- lib/Tooling/CMakeLists.txt | 6 - lib/Tooling/JsonCompileCommandLineDatabase.cpp | 214 --- lib/Tooling/JsonCompileCommandLineDatabase.h | 107 -- lib/Tooling/Makefile | 15 - lib/Tooling/Tooling.cpp | 322 ---- test/Analysis/CFNumber.c | 7 +- test/Analysis/bstring.c | 37 + test/Analysis/misc-ps-cxx0x.cpp | 11 + test/Analysis/misc-ps-region-store.cpp | 19 + test/Analysis/misc-ps-region-store.m | 24 + test/Analysis/misc-ps.c | 83 + test/Analysis/misc-ps.m | 25 + test/Analysis/plist-output-alternate.m | 9 +- test/Analysis/retain-release.m | 10 +- test/Analysis/retain-release.mm | 306 +++ test/Analysis/string.c | 174 +- test/CMakeLists.txt | 24 - .../basic/basic.lookup/basic.lookup.argdep/p4.cpp | 3 + test/CXX/class.access/class.friend/p2-cxx03.cpp | 2 +- test/CXX/class.access/p4.cpp | 6 +- test/CXX/class/class.friend/p2.cpp | 4 +- test/CXX/class/class.mem/p1b.cpp | 2 +- test/CXX/class/class.mem/p5-0x.cpp | 9 + .../dcl.dcl/basic.namespace/namespace.def/p7.cpp | 2 +- test/CXX/dcl.dcl/dcl.spec/dcl.stc/p1.cpp | 32 + .../dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p4.cpp | 25 +- .../dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p5.cpp | 8 +- .../dcl.spec/dcl.type/dcl.type.elab/p2-0x.cpp | 19 + test/CXX/dcl.dcl/dcl.spec/dcl.type/p3-0x.cpp | 9 +- test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p1-0x.cpp | 63 + test/CXX/dcl.decl/dcl.init/p14-0x.cpp | 44 + test/CXX/dcl.decl/dcl.init/p6.cpp | 12 + test/CXX/except/except.spec/p1.cpp | 13 + test/CXX/except/except.spec/p14.cpp | 14 +- test/CXX/except/except.spec/p9-dynamic.cpp | 2 +- test/CXX/expr/expr.const/p2-0x.cpp | 25 + test/CXX/expr/expr.post/expr.call/p7-0x.cpp | 17 + test/CXX/expr/expr.prim/p12-0x.cpp | 12 + test/CXX/expr/expr.prim/p4-0x.cpp | 10 + .../expr/expr.unary/expr.unary.noexcept/sema.cpp | 13 + test/CXX/special/class.ctor/p5-0x.cpp | 173 ++ test/CXX/special/class.dtor/p3-0x.cpp | 177 ++ .../special/class.init/class.base.init/p8-0x.cpp | 23 + .../special/class.init/class.base.init/p9-0x.cpp | 36 + test/CXX/stmt.stmt/stmt.dcl/p3-0x.cpp | 55 + test/CXX/stmt.stmt/stmt.dcl/p3.cpp | 47 + test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp | 6 +- test/CXX/temp/temp.decls/p3.cpp | 7 + test/CXX/temp/temp.decls/temp.alias/p1.cpp | 8 + test/CXX/temp/temp.decls/temp.alias/p2.cpp | 45 + test/CXX/temp/temp.decls/temp.alias/p3.cpp | 13 + test/CXX/temp/temp.decls/temp.friend/p3.cpp | 2 +- .../temp/temp.decls/temp.variadic/ext-blocks.cpp | 7 + .../CXX/temp/temp.fct.spec/temp.deduct/cwg1170.cpp | 41 + test/CXX/temp/temp.param/p10-0x.cpp | 13 + test/CXX/temp/temp.param/p11-0x.cpp | 31 +- test/CXX/temp/temp.param/p9-0x.cpp | 9 + .../temp/temp.res/temp.dep/temp.dep.type/p1.cpp | 30 + .../CXX/temp/temp.spec/temp.expl.spec/examples.cpp | 209 ++ test/CXX/temp/temp.spec/temp.expl.spec/p15.cpp | 11 + test/CXX/temp/temp.spec/temp.expl.spec/p16.cpp | 14 +- test/CXX/temp/temp.spec/temp.expl.spec/p17.cpp | 5 +- .../temp/temp.spec/temp.expl.spec/p5-example.cpp | 34 + test/CXX/temp/temp.spec/temp.explicit/p2.cpp | 4 +- test/CXX/temp/temp.type/p1-0x.cpp | 23 + test/CodeGen/2009-10-20-GlobalDebug.c | 1 + test/CodeGen/altivec.c | 2 +- test/CodeGen/arm-asm.c | 7 + test/CodeGen/asm-errors.c | 1 + test/CodeGen/asm-label.c | 12 + test/CodeGen/available-externally-suppress.c | 10 +- test/CodeGen/avx-cmp-builtins.c | 46 + test/CodeGen/builtins-ppc-altivec.c | 86 +- test/CodeGen/builtins-x86.c | 1 - test/CodeGen/builtinshufflevector.c | 3 +- test/CodeGen/byval-memcpy-elim.c | 20 + test/CodeGen/debug-info-crash.c | 1 + test/CodeGen/debug-info.c | 9 +- test/CodeGen/decl.c | 4 +- test/CodeGen/ext-vector.c | 26 +- test/CodeGen/extern-inline.c | 1 + test/CodeGen/frame-pointer-elim.c | 2 + test/CodeGen/inline.c | 2 +- test/CodeGen/mmx-builtins.c | 1 + test/CodeGen/ms_struct-bitfield-1.c | 91 + test/CodeGen/ms_struct-bitfield-2.c | 135 ++ test/CodeGen/ms_struct-bitfield-3.c | 49 + test/CodeGen/ms_struct-pack.c | 125 ++ test/CodeGen/ms_struct.c | 23 + test/CodeGen/packed-arrays.c | 14 +- test/CodeGen/packed-structure.c | 9 +- test/CodeGen/palignr.c | 1 + test/CodeGen/string-literal-short-wstring.c | 2 +- test/CodeGen/string-literal.c | 8 +- test/CodeGen/struct-passing.c | 4 +- test/CodeGen/transparent-union.c | 2 +- test/CodeGen/x86_32-arguments-darwin.c | 6 +- test/CodeGen/x86_32-arguments-linux.c | 4 +- test/CodeGen/x86_64-arguments.c | 2 +- test/CodeGenCXX/PR5050-constructor-conversion.cpp | 1 + test/CodeGenCXX/abstract-class-ctors-dtors.cpp | 16 + test/CodeGenCXX/arm.cpp | 8 +- test/CodeGenCXX/array-construction.cpp | 1 + test/CodeGenCXX/array-operator-delete-call.cpp | 1 + test/CodeGenCXX/call-arg-zero-temp.cpp | 1 + test/CodeGenCXX/cast-conversion.cpp | 1 + test/CodeGenCXX/constructor-conversion.cpp | 1 + test/CodeGenCXX/constructor-default-arg.cpp | 1 + test/CodeGenCXX/constructor-for-array-members.cpp | 1 + test/CodeGenCXX/constructor-template.cpp | 1 + test/CodeGenCXX/convert-to-fptr.cpp | 1 + test/CodeGenCXX/copy-assign-synthesis-1.cpp | 1 + test/CodeGenCXX/cxx0x-defaulted-templates.cpp | 19 + test/CodeGenCXX/cxx0x-delegating-ctors.cpp | 42 +- test/CodeGenCXX/debug-info-pubtypes.cpp | 15 + test/CodeGenCXX/decl-ref-init.cpp | 1 + .../CodeGenCXX/default-constructor-for-members.cpp | 1 + test/CodeGenCXX/derived-to-base-conv.cpp | 1 + test/CodeGenCXX/destructors.cpp | 4 +- test/CodeGenCXX/eh.cpp | 22 +- test/CodeGenCXX/exceptions.cpp | 2 + test/CodeGenCXX/global-array-destruction.cpp | 1 + test/CodeGenCXX/global-llvm-constant.cpp | 22 + test/CodeGenCXX/goto.cpp | 1 + test/CodeGenCXX/instrument-functions.cpp | 30 + test/CodeGenCXX/internal-linkage.cpp | 8 + test/CodeGenCXX/mangle-alias-template.cpp | 41 + test/CodeGenCXX/mangle-exprs.cpp | 16 + test/CodeGenCXX/mangle-subst-std.cpp | 1 + test/CodeGenCXX/mangle-unnameable-conversions.cpp | 14 + test/CodeGenCXX/mangle.cpp | 43 +- test/CodeGenCXX/member-init-ctor.cpp | 14 + test/CodeGenCXX/new.cpp | 52 +- test/CodeGenCXX/nrvo.cpp | 2 +- test/CodeGenCXX/pr9965.cpp | 12 + test/CodeGenCXX/ptr-to-member-function.cpp | 1 + test/CodeGenCXX/scoped-enums.cpp | 9 + .../skip-vtable-pointer-initialization.cpp | 200 ++ test/CodeGenCXX/static-init-2.cpp | 2 +- test/CodeGenCXX/template-instantiation.cpp | 30 + test/CodeGenCXX/threadsafe-statics-exceptions.cpp | 2 +- test/CodeGenCXX/thunks.cpp | 30 +- test/CodeGenCXX/vararg-non-pod.cpp | 16 + test/CodeGenCXX/virtual-base-destructor-call.cpp | 10 +- test/CodeGenCXX/x86_32-arguments.cpp | 4 +- test/CodeGenObjC/bitfield-ivar-offsets.m | 14 +- test/CodeGenObjC/blocks-2.m | 2 +- test/CodeGenObjC/constant-string-class-1.m | 23 + test/CodeGenObjC/constant-string-class.m | 2 +- test/CodeGenObjC/debug-info-block-helper.m | 30 + test/CodeGenObjC/debug-info-blocks.m | 55 + test/CodeGenObjC/debug-info-class-extension.m | 15 + test/CodeGenObjC/debug-info-class-extension2.m | 14 + test/CodeGenObjC/debug-info-class-extension3.m | 12 + test/CodeGenObjC/debug-info-crash.m | 1 + test/CodeGenObjC/debug-info-getter-name.m | 3 + test/CodeGenObjC/debug-info-pubtypes.m | 19 + test/CodeGenObjC/debug-info-static-var.m | 1 + test/CodeGenObjC/debug-property-synth.m | 19 + test/CodeGenObjC/encode-test.m | 17 + test/CodeGenObjC/forward-decl-param.m | 19 + test/CodeGenObjC/instance-method-metadata.m | 1 + test/CodeGenObjC/interface-layout-64.m | 22 +- test/CodeGenObjC/ivar-layout-array0-struct.m | 1 + test/CodeGenObjC/ivar-layout-no-optimize.m | 1 + test/CodeGenObjC/messages-2.m | 28 +- test/CodeGenObjC/metadata-symbols-64.m | 2 +- test/CodeGenObjC/no-vararg-messaging.m | 1 + test/CodeGenObjC/objc-read-weak-byref.m | 1 + test/CodeGenObjC/protocol-in-extended-class.m | 1 + test/CodeGenObjC/try.m | 1 + test/CodeGenObjC/unwind-fn.m | 14 - test/CodeGenObjCXX/block-in-template-inst.mm | 71 + test/CodeGenObjCXX/blocks.mm | 18 +- test/CodeGenObjCXX/encode.mm | 70 + test/CodeGenObjCXX/mangle.mm | 12 + .../property-object-conditional-exp.mm | 7 +- test/Driver/cc-log-diagnostics.c | 12 +- test/Driver/cfi.c | 8 + test/Driver/darwin-debug-flags.c | 2 +- test/Driver/darwin-ld.c | 7 +- test/Driver/nostdlib.c | 4 + test/Driver/rewrite-objc.m | 2 +- test/Driver/sysroot.c | 18 + test/FixIt/fixit-cxx0x.cpp | 2 +- test/Frontend/diagnostic-name.c | 4 +- test/Frontend/ir-support-codegen.ll | 1 + test/Frontend/undef.c | 4 + test/Index/Inputs/guarded.h | 6 + test/Index/Inputs/pragma-once.h | 3 + test/Index/annotate-context-sensitive.cpp | 12 +- test/Index/annotate-tokens-pp.c | 8 +- test/Index/annotate-tokens.m | 8 +- test/Index/complete-kvc.m | 20 +- test/Index/complete-member-access.m | 17 + test/Index/complete-property-flags.m | 1 + test/Index/nested-macro-instantiations.cpp | 20 + test/Index/overrides.cpp | 4 +- test/Index/properties-class-extensions.m | 2 +- test/Index/recursive-cxx-member-calls.cpp | 34 +- test/Index/usrs.cpp | 22 + test/Index/usrs.m | 2 +- test/Lexer/block_cmt_end.c | 8 +- test/Lexer/has_extension.c | 30 + test/Lexer/has_extension_cxx.cpp | 36 + test/Lexer/has_feature_c1x.c | 20 + test/Lexer/has_feature_cxx0x.cpp | 11 +- test/Lexer/has_feature_type_traits.cpp | 10 + test/Misc/Inputs/include.h | 2 + test/Misc/diag-format.c | 34 + test/Misc/include-stack-for-note-flag.cpp | 10 + test/PCH/cxx-alias-decl.cpp | 20 + test/PCH/cxx-alias-decl.h | 11 + test/PCH/cxx-for-range.cpp | 6 +- test/PCH/cxx-member-init.cpp | 22 + test/PCH/cxx-reference.cpp | 6 +- test/PCH/cxx-static_assert.cpp | 15 +- test/PCH/cxx-static_assert.h | 9 - test/PCH/cxx0x-default-delete.cpp | 23 + test/PCH/cxx0x-delegating-ctors.cpp | 20 + test/PCH/modified-header-error.c | 11 + test/PCH/objc_methods.h | 2 +- test/PCH/objc_methods.m | 2 +- test/PCH/objcxx-ivar-class.mm | 2 +- test/Parser/MicrosoftExtensions.cpp | 100 +- test/Parser/cxx-default-delete.cpp | 15 + test/Parser/cxx-ext-delete-default.cpp | 11 + test/Parser/cxx-friend.cpp | 6 +- test/Parser/cxx0x-member-initializers.cpp | 15 + test/Parser/nested-namespaces-recovery.cpp | 24 + test/Parser/opencl-astype.cl | 20 + test/Preprocessor/if_warning.c | 4 + test/Preprocessor/pragma_sysheader.c | 9 + test/Sema/MicrosoftExtensions.c | 8 + test/Sema/arm-neon-types.c | 9 +- test/Sema/asm.c | 8 + test/Sema/attr-unknown.c | 2 +- test/Sema/builtins-arm.c | 5 + test/Sema/carbon.c | 2 +- test/Sema/exprs.c | 18 + test/Sema/illegal-types.c | 2 +- test/Sema/parentheses.c | 24 +- test/Sema/parentheses.cpp | 31 + test/Sema/stdcall-fastcall.c | 3 +- test/Sema/uninit-variables.c | 13 + test/Sema/x86-builtin-palignr.c | 3 +- test/SemaCXX/MicrosoftExtensions.cpp | 74 +- test/SemaCXX/PR9572.cpp | 8 +- test/SemaCXX/PR9884.cpp | 17 + test/SemaCXX/PR9902.cpp | 28 + test/SemaCXX/PR9908.cpp | 32 + test/SemaCXX/aggregate-initialization.cpp | 4 +- test/SemaCXX/alias-template.cpp | 147 ++ test/SemaCXX/anonymous-union.cpp | 30 +- test/SemaCXX/attr-cxx0x.cpp | 5 + test/SemaCXX/attr-noreturn.cpp | 17 + test/SemaCXX/attr-regparm.cpp | 3 +- test/SemaCXX/class.cpp | 2 +- test/SemaCXX/conversion.cpp | 11 + test/SemaCXX/copy-constructor-error.cpp | 4 +- test/SemaCXX/cxx0x-cursory-default-delete.cpp | 69 + test/SemaCXX/cxx0x-defaulted-functions.cpp | 45 + test/SemaCXX/cxx0x-delegating-ctors.cpp | 24 +- test/SemaCXX/cxx0x-deleted-default-ctor.cpp | 120 ++ test/SemaCXX/cxx0x-nontrivial-union.cpp | 22 + test/SemaCXX/default-arg-special-member.cpp | 12 + test/SemaCXX/default-constructor-initializers.cpp | 7 + test/SemaCXX/defaulted-ctor-loop.cpp | 14 + test/SemaCXX/deleted-function-extension.cpp | 8 - test/SemaCXX/deleted-function.cpp | 5 +- test/SemaCXX/dependent-noexcept-unevaluated.cpp | 41 + test/SemaCXX/dependent-types.cpp | 5 +- test/SemaCXX/destructor.cpp | 175 +- test/SemaCXX/enum-scoped.cpp | 10 + test/SemaCXX/expressions.cpp | 31 + test/SemaCXX/generalized-initializers.cpp | 174 ++ test/SemaCXX/implicit-exception-spec.cpp | 63 + test/SemaCXX/implicit-member-functions.cpp | 2 +- test/SemaCXX/member-expr.cpp | 12 +- test/SemaCXX/member-init.cpp | 50 + test/SemaCXX/member-pointer.cpp | 25 + test/SemaCXX/nullptr.cpp | 57 + test/SemaCXX/overload-call.cpp | 22 + test/SemaCXX/overloaded-operator.cpp | 17 +- test/SemaCXX/redeclared-alias-template.cpp | 23 + test/SemaCXX/reinterpret-cast.cpp | 162 +- test/SemaCXX/return.cpp | 16 + test/SemaCXX/struct-class-redecl.cpp | 160 +- test/SemaCXX/switch.cpp | 2 +- test/SemaCXX/tag-ambig.cpp | 28 + test/SemaCXX/type-traits.cpp | 102 +- test/SemaCXX/underlying_type.cpp | 37 + test/SemaCXX/value-initialization.cpp | 9 +- test/SemaCXX/vararg-non-pod.cpp | 9 +- test/SemaCXX/vtable-instantiation.cc | 50 +- test/SemaCXX/warn-bad-memaccess.cpp | 70 + test/SemaCXX/warn-non-pod-memset.cpp | 63 - .../warn-pure-virtual-call-from-ctor-dtor.cpp | 7 + test/SemaObjC/exprs.m | 10 + test/SemaObjC/gc-attributes.m | 22 + test/SemaObjC/objc2-warn-weak-decl.m | 2 +- test/SemaObjC/related-result-type-inference.m | 171 ++ test/SemaObjCXX/blocks.mm | 26 + test/SemaObjCXX/gc-attributes.mm | 22 + test/SemaObjCXX/namespace-lookup.mm | 14 + test/SemaObjCXX/nullptr.mm | 13 + test/SemaObjCXX/overload-gc.mm | 4 +- test/SemaObjCXX/overload.mm | 4 +- test/SemaObjCXX/related-result-type-inference.mm | 71 + test/SemaTemplate/alias-church-numerals.cpp | 34 + test/SemaTemplate/alias-nested-nontag.cpp | 6 + .../SemaTemplate/alias-template-template-param.cpp | 7 + test/SemaTemplate/alias-templates.cpp | 70 + test/SemaTemplate/deduction-crash.cpp | 36 +- test/SemaTemplate/dependent-names-no-std.cpp | 21 + test/SemaTemplate/dependent-names.cpp | 135 +- test/SemaTemplate/friend-template.cpp | 8 + test/SemaTemplate/instantiate-call.cpp | 5 +- test/SemaTemplate/instantiate-function-1.cpp | 22 + test/SemaTemplate/instantiate-init.cpp | 52 + test/SemaTemplate/partial-spec-instantiate.cpp | 10 + test/SemaTemplate/rdar9173693.cpp | 6 + test/SemaTemplate/typename-specifier.cpp | 31 + test/lit.cfg | 30 + tools/c-index-test/c-index-test.c | 54 +- tools/driver/cc1as_main.cpp | 2 + tools/libclang/CIndex.cpp | 114 +- tools/libclang/CIndexCodeCompletion.cpp | 3 +- tools/libclang/CIndexDiagnostic.cpp | 3 +- tools/libclang/CIndexUSRs.cpp | 3 + tools/libclang/CIndexer.h | 3 + tools/libclang/CXCursor.cpp | 1 + tools/libclang/CXType.cpp | 7 +- tools/libclang/libclang.darwin.exports | 2 + tools/libclang/libclang.exports | 2 + unittests/CMakeLists.txt | 12 +- .../Tooling/JsonCompileCommandLineDatabaseTest.cpp | 232 --- unittests/Tooling/ToolingTest.cpp | 175 -- www/CheckerNotes.html | 9 - www/StaticAnalysis.html | 21 - www/StaticAnalysisUsage.html | 21 - www/analyzer/latest_checker.html.incl | 2 +- www/analyzer/release_notes.html | 15 +- www/clang-tutorial.html | 56 - www/comparison.html | 17 +- www/compatibility.html | 24 +- www/cxx_status.html | 15 +- www/diagnostics.html | 122 +- www/distclang_status.html | 30 - www/features.html | 1 - www/libstdc++4.4-clang0x.patch | 239 +++ 603 files changed, 21539 insertions(+), 8388 deletions(-) delete mode 100644 docs/doxygen.cfg delete mode 100644 docs/libIndex.html delete mode 100644 examples/Tooling/CMakeLists.txt delete mode 100644 examples/Tooling/ClangCheck.cpp delete mode 100644 examples/Tooling/Makefile delete mode 100644 include/clang/Tooling/Tooling.h delete mode 100644 lib/Frontend/DiagChecker.cpp delete mode 100644 lib/Tooling/CMakeLists.txt delete mode 100644 lib/Tooling/JsonCompileCommandLineDatabase.cpp delete mode 100644 lib/Tooling/JsonCompileCommandLineDatabase.h delete mode 100644 lib/Tooling/Makefile delete mode 100644 lib/Tooling/Tooling.cpp create mode 100644 test/Analysis/misc-ps-cxx0x.cpp create mode 100644 test/Analysis/misc-ps.c create mode 100644 test/Analysis/retain-release.mm create mode 100644 test/CXX/class/class.mem/p5-0x.cpp create mode 100644 test/CXX/dcl.dcl/dcl.spec/dcl.stc/p1.cpp create mode 100644 test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p2-0x.cpp create mode 100644 test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p1-0x.cpp create mode 100644 test/CXX/dcl.decl/dcl.init/p14-0x.cpp create mode 100644 test/CXX/expr/expr.const/p2-0x.cpp create mode 100644 test/CXX/expr/expr.post/expr.call/p7-0x.cpp create mode 100644 test/CXX/expr/expr.prim/p12-0x.cpp create mode 100644 test/CXX/expr/expr.prim/p4-0x.cpp create mode 100644 test/CXX/special/class.ctor/p5-0x.cpp create mode 100644 test/CXX/special/class.dtor/p3-0x.cpp create mode 100644 test/CXX/special/class.init/class.base.init/p8-0x.cpp create mode 100644 test/CXX/special/class.init/class.base.init/p9-0x.cpp create mode 100644 test/CXX/stmt.stmt/stmt.dcl/p3-0x.cpp create mode 100644 test/CXX/stmt.stmt/stmt.dcl/p3.cpp create mode 100644 test/CXX/temp/temp.decls/p3.cpp create mode 100644 test/CXX/temp/temp.decls/temp.alias/p1.cpp create mode 100644 test/CXX/temp/temp.decls/temp.alias/p2.cpp create mode 100644 test/CXX/temp/temp.decls/temp.alias/p3.cpp create mode 100644 test/CXX/temp/temp.fct.spec/temp.deduct/cwg1170.cpp create mode 100644 test/CXX/temp/temp.param/p10-0x.cpp create mode 100644 test/CXX/temp/temp.res/temp.dep/temp.dep.type/p1.cpp create mode 100644 test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp create mode 100644 test/CXX/temp/temp.spec/temp.expl.spec/p5-example.cpp create mode 100644 test/CXX/temp/temp.type/p1-0x.cpp create mode 100644 test/CodeGen/arm-asm.c create mode 100644 test/CodeGen/asm-label.c create mode 100644 test/CodeGen/avx-cmp-builtins.c create mode 100644 test/CodeGen/byval-memcpy-elim.c create mode 100644 test/CodeGen/ms_struct-bitfield-1.c create mode 100644 test/CodeGen/ms_struct-bitfield-2.c create mode 100644 test/CodeGen/ms_struct-bitfield-3.c create mode 100644 test/CodeGen/ms_struct-pack.c create mode 100644 test/CodeGen/ms_struct.c create mode 100644 test/CodeGenCXX/abstract-class-ctors-dtors.cpp create mode 100644 test/CodeGenCXX/cxx0x-defaulted-templates.cpp create mode 100644 test/CodeGenCXX/debug-info-pubtypes.cpp create mode 100644 test/CodeGenCXX/instrument-functions.cpp create mode 100644 test/CodeGenCXX/mangle-alias-template.cpp create mode 100644 test/CodeGenCXX/mangle-unnameable-conversions.cpp create mode 100644 test/CodeGenCXX/member-init-ctor.cpp create mode 100644 test/CodeGenCXX/pr9965.cpp create mode 100644 test/CodeGenCXX/scoped-enums.cpp create mode 100644 test/CodeGenCXX/skip-vtable-pointer-initialization.cpp create mode 100644 test/CodeGenCXX/vararg-non-pod.cpp create mode 100644 test/CodeGenObjC/constant-string-class-1.m create mode 100644 test/CodeGenObjC/debug-info-block-helper.m create mode 100644 test/CodeGenObjC/debug-info-blocks.m create mode 100644 test/CodeGenObjC/debug-info-class-extension.m create mode 100644 test/CodeGenObjC/debug-info-class-extension2.m create mode 100644 test/CodeGenObjC/debug-info-class-extension3.m create mode 100644 test/CodeGenObjC/debug-info-pubtypes.m create mode 100644 test/CodeGenObjC/debug-property-synth.m create mode 100644 test/CodeGenObjC/forward-decl-param.m delete mode 100644 test/CodeGenObjC/unwind-fn.m create mode 100644 test/CodeGenObjCXX/block-in-template-inst.mm create mode 100644 test/Driver/cfi.c create mode 100644 test/Driver/nostdlib.c create mode 100644 test/Driver/sysroot.c create mode 100644 test/Frontend/undef.c create mode 100644 test/Index/Inputs/guarded.h create mode 100644 test/Index/Inputs/pragma-once.h create mode 100644 test/Index/nested-macro-instantiations.cpp create mode 100644 test/Lexer/has_extension.c create mode 100644 test/Lexer/has_extension_cxx.cpp create mode 100644 test/Lexer/has_feature_c1x.c create mode 100644 test/Misc/diag-format.c create mode 100644 test/PCH/cxx-alias-decl.cpp create mode 100644 test/PCH/cxx-alias-decl.h create mode 100644 test/PCH/cxx-member-init.cpp delete mode 100644 test/PCH/cxx-static_assert.h create mode 100644 test/PCH/cxx0x-default-delete.cpp create mode 100644 test/PCH/cxx0x-delegating-ctors.cpp create mode 100644 test/PCH/modified-header-error.c create mode 100644 test/Parser/cxx-default-delete.cpp create mode 100644 test/Parser/cxx-ext-delete-default.cpp create mode 100644 test/Parser/cxx0x-member-initializers.cpp create mode 100644 test/Parser/nested-namespaces-recovery.cpp create mode 100644 test/Parser/opencl-astype.cl create mode 100644 test/Sema/parentheses.cpp create mode 100644 test/SemaCXX/PR9884.cpp create mode 100644 test/SemaCXX/PR9902.cpp create mode 100644 test/SemaCXX/PR9908.cpp create mode 100644 test/SemaCXX/alias-template.cpp create mode 100644 test/SemaCXX/cxx0x-cursory-default-delete.cpp create mode 100644 test/SemaCXX/cxx0x-defaulted-functions.cpp create mode 100644 test/SemaCXX/cxx0x-deleted-default-ctor.cpp create mode 100644 test/SemaCXX/cxx0x-nontrivial-union.cpp create mode 100644 test/SemaCXX/default-arg-special-member.cpp create mode 100644 test/SemaCXX/defaulted-ctor-loop.cpp delete mode 100644 test/SemaCXX/deleted-function-extension.cpp create mode 100644 test/SemaCXX/dependent-noexcept-unevaluated.cpp create mode 100644 test/SemaCXX/generalized-initializers.cpp create mode 100644 test/SemaCXX/implicit-exception-spec.cpp create mode 100644 test/SemaCXX/member-init.cpp create mode 100644 test/SemaCXX/redeclared-alias-template.cpp create mode 100644 test/SemaCXX/tag-ambig.cpp create mode 100644 test/SemaCXX/underlying_type.cpp create mode 100644 test/SemaCXX/warn-bad-memaccess.cpp delete mode 100644 test/SemaCXX/warn-non-pod-memset.cpp create mode 100644 test/SemaCXX/warn-pure-virtual-call-from-ctor-dtor.cpp create mode 100644 test/SemaObjC/gc-attributes.m create mode 100644 test/SemaObjC/related-result-type-inference.m create mode 100644 test/SemaObjCXX/gc-attributes.mm create mode 100644 test/SemaObjCXX/namespace-lookup.mm create mode 100644 test/SemaObjCXX/nullptr.mm create mode 100644 test/SemaObjCXX/related-result-type-inference.mm create mode 100644 test/SemaTemplate/alias-church-numerals.cpp create mode 100644 test/SemaTemplate/alias-nested-nontag.cpp create mode 100644 test/SemaTemplate/alias-template-template-param.cpp create mode 100644 test/SemaTemplate/alias-templates.cpp create mode 100644 test/SemaTemplate/dependent-names-no-std.cpp create mode 100644 test/SemaTemplate/rdar9173693.cpp delete mode 100644 unittests/Tooling/JsonCompileCommandLineDatabaseTest.cpp delete mode 100644 unittests/Tooling/ToolingTest.cpp delete mode 100644 www/CheckerNotes.html delete mode 100644 www/StaticAnalysis.html delete mode 100644 www/StaticAnalysisUsage.html delete mode 100644 www/clang-tutorial.html delete mode 100644 www/distclang_status.html diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b54deaaf546..aa89823e76f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,13 @@ set(CLANG_RESOURCE_DIR "" CACHE STRING set(C_INCLUDE_DIRS "" CACHE STRING "Colon separated list of directories clang will search for headers.") +set(CLANG_VENDOR "" CACHE STRING + "Vendor-specific text for showing with version information.") + +if( CLANG_VENDOR ) + add_definitions( -DCLANG_VENDOR="${CLANG_VENDOR} " ) +endif() + set(CLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(CLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) @@ -103,7 +110,7 @@ configure_file( ${CMAKE_CURRENT_BINARY_DIR}/include/clang/Basic/Version.inc) # Add appropriate flags for GCC -if (CMAKE_COMPILER_IS_GNUCXX) +if (LLVM_COMPILER_IS_GCC_COMPATIBLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings") endif () diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj index e14448cdb141..1612d122f516 100644 --- a/clang.xcodeproj/project.pbxproj +++ b/clang.xcodeproj/project.pbxproj @@ -6,6 +6,12 @@ objectVersion = 42; objects = { +/* Begin PBXBuildFile section */ + BD6B0EDF13A1824C00B8E3FE /* Mangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BD6B0EDE13A1824C00B8E3FE /* Mangle.cpp */; }; + BD6B0EE213A182A600B8E3FE /* ItaniumMangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BD6B0EE113A182A600B8E3FE /* ItaniumMangle.cpp */; }; + BD6B0EE413A182DA00B8E3FE /* MicrosoftMangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BD6B0EE313A182DA00B8E3FE /* MicrosoftMangle.cpp */; }; +/* End PBXBuildFile section */ + /* Begin PBXCopyFilesBuildPhase section */ 8DD76F690486A84900D96B5E /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; @@ -472,6 +478,9 @@ BD59A952121496B9003A5A02 /* SemaConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SemaConsumer.h; path = clang/Sema/SemaConsumer.h; sourceTree = ""; }; BD59A953121496B9003A5A02 /* SemaDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SemaDiagnostic.h; path = clang/Sema/SemaDiagnostic.h; sourceTree = ""; }; BD59A954121496B9003A5A02 /* Template.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Template.h; path = clang/Sema/Template.h; sourceTree = ""; }; + BD6B0EDE13A1824C00B8E3FE /* Mangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Mangle.cpp; sourceTree = ""; }; + BD6B0EE113A182A600B8E3FE /* ItaniumMangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ItaniumMangle.cpp; sourceTree = ""; }; + BD6B0EE313A182DA00B8E3FE /* MicrosoftMangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MicrosoftMangle.cpp; sourceTree = ""; }; BDF87CF60FD746F300BBF872 /* SemaTemplateDeduction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateDeduction.cpp; path = lib/Sema/SemaTemplateDeduction.cpp; sourceTree = ""; tabWidth = 2; }; BF89C3E111595818001C2D68 /* AnalysisBasedWarnings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnalysisBasedWarnings.cpp; path = lib/Sema/AnalysisBasedWarnings.cpp; sourceTree = ""; }; BF89C3E5115958A1001C2D68 /* TargetAttributesSema.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TargetAttributesSema.h; path = lib/Sema/TargetAttributesSema.h; sourceTree = ""; }; @@ -1514,6 +1523,9 @@ DEC8D9920A9433F400353FCA /* AST */ = { isa = PBXGroup; children = ( + BD6B0EDE13A1824C00B8E3FE /* Mangle.cpp */, + BD6B0EE313A182DA00B8E3FE /* MicrosoftMangle.cpp */, + BD6B0EE113A182A600B8E3FE /* ItaniumMangle.cpp */, BF9FEE051225E770003A8B71 /* MicrosoftCXXABI.cpp */, BF9FEE031225E759003A8B71 /* ItaniumCXXABI.cpp */, BF9FEE011225E73F003A8B71 /* ExprClassification.cpp */, @@ -1900,6 +1912,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + BD6B0EDF13A1824C00B8E3FE /* Mangle.cpp in Sources */, + BD6B0EE213A182A600B8E3FE /* ItaniumMangle.cpp in Sources */, + BD6B0EE413A182DA00B8E3FE /* MicrosoftMangle.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/docs/LanguageExtensions.html b/docs/LanguageExtensions.html index f86835a9d1df..8f43725d82a2 100644 --- a/docs/LanguageExtensions.html +++ b/docs/LanguageExtensions.html @@ -32,28 +32,42 @@ td {
  • Checks for Upcoming Standard Language Features
  • Checks for Type Traits
  • Blocks
  • +
  • Objective-C Features + +
  • Function Overloading in C
  • -
  • Generic Selections
  • Builtin Functions
    • __builtin_shufflevector
    • @@ -115,28 +129,48 @@ not. It can be used like this:

      -

      __has_feature

      +

      __has_feature and __has_extension

      -

      This function-like macro takes a single identifier argument that is the name -of a feature. It evaluates to 1 if the feature is supported or 0 if not. It -can be used like this:

      +

      These function-like macros take a single identifier argument that is the +name of a feature. __has_feature evaluates to 1 if the feature +is both supported by Clang and standardized in the current language standard +or 0 if not (but see below), while +__has_extension evaluates to 1 if the feature is supported by +Clang in the current language (either as a language extension or a standard +language feature) or 0 if not. They can be used like this:

       #ifndef __has_feature         // Optional of course.
         #define __has_feature(x) 0  // Compatibility with non-clang compilers.
       #endif
      +#ifndef __has_extension
      +  #define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
      +#endif
       
       ...
      -#if __has_feature(attribute_overloadable) || \
      -    __has_feature(blocks)
      -...
      +#if __has_feature(cxx_rvalue_references)
      +// This code will only be compiled with the -std=c++0x and -std=gnu++0x
      +// options, because rvalue references are only standardized in C++0x.
      +#endif
      +
      +#if __has_extension(cxx_rvalue_references)
      +// This code will be compiled with the -std=c++0x, -std=gnu++0x, -std=c++98
      +// and -std=gnu++98 options, because rvalue references are supported as a
      +// language extension in C++98.
       #endif
      -...
       
      +

      For backwards compatibility reasons, +__has_feature can also be used to test for support for +non-standardized features, i.e. features not prefixed c_, +cxx_ or objc_.

      + +

      If the -pedantic-errors option is given, +__has_extension is equivalent to __has_feature.

      +

      The feature tag is described along with the language feature below.

      @@ -293,7 +327,7 @@ float4 foo(float2 a, float2 b) { -

      Query for this feature with __has_feature(attribute_ext_vector_type).

      +

      Query for this feature with __has_extension(attribute_ext_vector_type).

      See also __builtin_shufflevector.

      @@ -318,8 +352,8 @@ will be incorporated into the appropriate diagnostic:

      Query for this feature -with __has_feature(attribute_deprecated_with_message) -and __has_feature(attribute_unavailable_with_message).

      +with __has_extension(attribute_deprecated_with_message) +and __has_extension(attribute_unavailable_with_message).

      Attributes on Enumerators

      @@ -342,7 +376,7 @@ initializer, like so:

      Attributes on the enum declaration do not apply to individual enumerators.

      -

      Query for this feature with __has_feature(enumerator_attributes).

      +

      Query for this feature with __has_extension(enumerator_attributes).

      Checks for Standard Language Features

      @@ -365,106 +399,165 @@ compiling code with -fno-rtti disables the use of RTTI.

      Checks for Upcoming Standard Language Features

      -

      The __has_feature macro can be used to query if certain upcoming -standard language features are enabled. Those features are listed here.

      +

      The __has_feature or __has_extension macros can be used +to query if certain upcoming standard language features are enabled. Those +features are listed here. Features that are not yet implemented will be +noted.

      + +

      C++0x

      -

      Currently, all features listed here are slated for inclusion in the upcoming -C++0x standard. As a result, all the features that clang supports are enabled -with the -std=c++0x option when compiling C++ code. Features that are -not yet implemented will be noted.

      +

      The features listed below are slated for inclusion in the upcoming +C++0x standard. As a result, all these features are enabled +with the -std=c++0x option when compiling C++ code.

      -

      C++0x decltype()

      +

      C++0x decltype()

      -

      Use __has_feature(cxx_decltype) to determine if support for the +

      Use __has_feature(cxx_decltype) or +__has_extension(cxx_decltype) to determine if support for the decltype() specifier is enabled.

      -

      C++0x attributes

      +

      C++0x SFINAE includes access control

      + +

      Use __has_feature(cxx_access_control_sfinae) or __has_extension(cxx_access_control_sfinae) to determine whether access-control errors (e.g., calling a private constructor) are considered to be template argument deduction errors (aka SFINAE errors), per C++ DR1170.

      + +

      C++0x alias templates

      + +

      Use __has_feature(cxx_alias_templates) or +__has_extension(cxx_alias_templates) to determine if support for +C++0x's alias declarations and alias templates is enabled.

      + +

      C++0x attributes

      -

      Use __has_feature(cxx_attributes) to determine if support for -attribute parsing with C++0x's square bracket notation is enabled.

      +

      Use __has_feature(cxx_attributes) or +__has_extension(cxx_attributes) to determine if support for attribute +parsing with C++0x's square bracket notation is enabled.

      -

      C++0x default template arguments in function templates

      +

      C++0x default template arguments in function templates

      -

      Use __has_feature(cxx_default_function_template_args) to determine if support for default template arguments in function templates is enabled.

      +

      Use __has_feature(cxx_default_function_template_args) or +__has_extension(cxx_default_function_template_args) to determine +if support for default template arguments in function templates is enabled.

      -

      C++0x deleted functions

      +

      C++0x deleted functions

      -

      Use __has_feature(cxx_deleted_functions) to determine if support for +

      Use __has_feature(cxx_deleted_functions) or +__has_extension(cxx_deleted_functions) to determine if support for deleted function definitions (with = delete) is enabled.

      -

      C++0x lambdas

      +

      C++0x lambdas

      -

      Use __has_feature(cxx_lambdas) to determine if support for -lambdas is enabled. clang does not currently implement this feature.

      +

      Use __has_feature(cxx_lambdas) or +__has_extension(cxx_lambdas) to determine if support for lambdas +is enabled. clang does not currently implement this feature.

      -

      C++0x nullptr

      +

      C++0x nullptr

      -

      Use __has_feature(cxx_nullptr) to determine if support for -nullptr is enabled. clang does not yet fully implement this -feature.

      +

      Use __has_feature(cxx_nullptr) or +__has_extension(cxx_nullptr) to determine if support for +nullptr is enabled.

      -

      C++0x override control

      +

      C++0x override control

      -

      Use __has_feature(cxx_override_control) to determine if support for +

      Use __has_feature(cxx_override_control) or +__has_extension(cxx_override_control) to determine if support for the override control keywords is enabled.

      -

      C++0x reference-qualified functions

      -

      Use __has_feature(cxx_reference_qualified_functions) to determine if support for reference-qualified functions (e.g., member functions with & or && applied to *this) is enabled.

      +

      C++0x reference-qualified functions

      +

      Use __has_feature(cxx_reference_qualified_functions) or +__has_extension(cxx_reference_qualified_functions) to determine +if support for reference-qualified functions (e.g., member functions with +& or && applied to *this) +is enabled.

      -

      C++0x range-based for loop

      +

      C++0x range-based for loop

      -

      Use __has_feature(cxx_range_for) to determine if support for -the range-based for loop is enabled.

      +

      Use __has_feature(cxx_range_for) or +__has_extension(cxx_range_for) to determine if support for the +range-based for loop is enabled.

      -

      C++0x rvalue references

      +

      C++0x rvalue references

      -

      Use __has_feature(cxx_rvalue_references) to determine if support for +

      Use __has_feature(cxx_rvalue_references) or +__has_extension(cxx_rvalue_references) to determine if support for rvalue references is enabled.

      -

      C++0x static_assert()

      +

      C++0x static_assert()

      -

      Use __has_feature(cxx_static_assert) to determine if support for +

      Use __has_feature(cxx_static_assert) or +__has_extension(cxx_static_assert) to determine if support for compile-time assertions using static_assert is enabled.

      -

      C++0x type inference

      +

      C++0x type inference

      -

      Use __has_feature(cxx_auto_type) to determine C++0x type inference -is supported using the auto specifier. If this is disabled, -auto will instead be a storage class specifier, as in C or C++98.

      +

      Use __has_feature(cxx_auto_type) or +__has_extension(cxx_auto_type) to determine C++0x type inference is +supported using the auto specifier. If this is disabled, auto +will instead be a storage class specifier, as in C or C++98.

      -

      C++0x variadic templates

      +

      C++0x variadic templates

      -

      Use __has_feature(cxx_variadic_templates) to determine if support +

      Use __has_feature(cxx_variadic_templates) or +__has_extension(cxx_variadic_templates) to determine if support for variadic templates is enabled.

      -

      C++0x inline namespaces

      +

      C++0x inline namespaces

      -

      Use __has_feature(cxx_inline_namespaces) to determine if support for +

      Use __has_feature(cxx_inline_namespaces) or +__has_extension(cxx_inline_namespaces) to determine if support for inline namespaces is enabled.

      -

      C++0x trailing return type

      +

      C++0x trailing return type

      -

      Use __has_feature(cxx_trailing_return) to determine if support for -the alternate function declaration syntax with trailing return type is enabled.

      +

      Use __has_feature(cxx_trailing_return) or +__has_extension(cxx_trailing_return) to determine if support for the +alternate function declaration syntax with trailing return type is enabled.

      -

      C++0x noexcept

      +

      C++0x noexcept

      -

      Use __has_feature(cxx_noexcept) to determine if support for -noexcept exception specifications is enabled.

      +

      Use __has_feature(cxx_noexcept) or +__has_extension(cxx_noexcept) to determine if support for noexcept +exception specifications is enabled.

      -

      C++0x strongly typed enumerations

      +

      C++0x strongly typed enumerations

      -

      Use __has_feature(cxx_strong_enums) to determine if support for +

      Use __has_feature(cxx_strong_enums) or +__has_extension(cxx_strong_enums) to determine if support for strongly typed, scoped enumerations is enabled.

      +

      C1X

      + +

      The features listed below are slated for inclusion in the upcoming +C1X standard. As a result, all these features are enabled +with the -std=c1x option when compiling C code.

      + +

      C1X generic selections

      + +

      Use __has_feature(c_generic_selections) or +__has_extension(c_generic_selections) to determine if support for +generic selections is enabled.

      + +

      As an extension, the C1X generic selection expression is available in all +languages supported by Clang. The syntax is the same as that given in the +C1X draft standard.

      + +

      In C, type compatibility is decided according to the rules given in the +appropriate standard, but in C++, which lacks the type compatibility rules +used in C, types are considered compatible only if they are equivalent.

      + +

      C1X _Static_assert()

      + +

      Use __has_feature(c_static_assert) or +__has_extension(c_static_assert) to determine if support for +compile-time assertions using _Static_assert is enabled.

      +

      Checks for Type Traits

      -

      Clang supports the GNU C++ type traits and a subset of the Microsoft Visual C++ Type traits. For each supported type trait __X, __has_feature(X) indicates the presence of the type trait. For example: +

      Clang supports the GNU C++ type traits and a subset of the Microsoft Visual C++ Type traits. For each supported type trait __X, __has_extension(X) indicates the presence of the type trait. For example:

      -#if __has_feature(is_convertible_to)
      +#if __has_extension(is_convertible_to)
       template<typename From, typename To>
       struct is_convertible_to {
         static const bool value = __is_convertible_to(From, To);
      @@ -507,7 +600,74 @@ details for the clang implementation are in Block-ABI-Apple.txt.

      -

      Query for this feature with __has_feature(blocks).

      +

      Query for this feature with __has_extension(blocks).

      + + +

      Objective-C Features

      + + +

      Related result types

      + +

      According to Cocoa conventions, Objective-C methods with certain names ("init", "alloc", etc.) always return objects that are an instance of the receiving class's type. Such methods are said to have a "related result type", meaning that a message send to one of these methods will have the same static type as an instance of the receiver class. For example, given the following classes:

      + +
      +
      +@interface NSObject
      ++ (id)alloc;
      +- (id)init;
      +@end
      +
      +@interface NSArray : NSObject
      +@end
      +
      +
      + +

      and this common initialization pattern

      + +
      +
      +NSArray *array = [[NSArray alloc] init];
      +
      +
      + +

      the type of the expression [NSArray alloc] is +NSArray* because alloc implicitly has a +related result type. Similarly, the type of the expression +[[NSArray alloc] init] is NSArray*, since +init has a related result type and its receiver is known +to have the type NSArray *. If neither alloc nor init had a related result type, the expressions would have had type id, as declared in the method signature.

      + +

      To determine whether a method has a related result type, the first +word in the camel-case selector (e.g., "init" in "initWithObjects") is +considered, and the method will a related result type if its return +type is compatible with the type of its class and if + +

        + +
      • the first word is "alloc" or "new", and the method is a class + method, or
      • + +
      • the first word is "autorelease", "init", "retain", or "self", + and the method is an instance method.
      • + +

      + +

      If a method with a related result type is overridden by a subclass +method, the subclass method must also return a type that is compatible +with the subclass type. For example:

      + +
      +
      +@interface NSString : NSObject
      +- (NSUnrelated *)init; // incorrect usage: NSUnrelated is not NSString or a superclass of NSString
      +@end
      +
      +
      + +

      Related result types only affect the type of a message send or +property access via the given method. In all other respects, a method +with a related result type is treated the same way as method without a +related result type.

      Function Overloading in C

      @@ -607,22 +767,8 @@ caveats to this use of name mangling:

      C.
    -

    Query for this feature with __has_feature(attribute_overloadable).

    - - - -

    Generic Selections

    - - -

    The C1X generic selection expression is available in all languages -supported by Clang. The syntax is the same as that given in the C1X draft -standard.

    - -

    In C, type compatibility is decided according to the rules given in the -appropriate standard, but in C++, which lacks the type compatibility rules -used in C, types are considered compatible only if they are equivalent.

    +

    Query for this feature with __has_extension(attribute_overloadable).

    -

    Query for this feature with __has_feature(generic_selections).

    Builtin Functions

    diff --git a/docs/Makefile b/docs/Makefile index f82d8208fd94..2608046f1f85 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -16,10 +16,10 @@ DOXYGEN = doxygen $(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in cat $< | sed \ - -e 's/@abs_top_srcdir@/../g' \ + -e 's/@abs_srcdir@/./g' \ -e 's/@DOT@/dot/g' \ -e 's/@PACKAGE_VERSION@/mainline/' \ - -e 's/@abs_top_builddir@/../g' > $@ + -e 's/@abs_builddir@/./g' > $@ endif include $(CLANG_LEVEL)/Makefile diff --git a/docs/UsersManual.html b/docs/UsersManual.html index 73ca6c6980b3..4962a9211066 100644 --- a/docs/UsersManual.html +++ b/docs/UsersManual.html @@ -273,6 +273,35 @@ when this is enabled, Clang will print something like: +
    -fdiagnostics-format=clang/msvc/vi: +Changes diagnostic output format to better match IDEs and command line tools.
    +
    This option controls the output format of the filename, line number, and column printed in diagnostic messages. The options, and their affect on formatting a simple conversion diagnostic, follow: + +
    +
    clang (default)
    +
    +
    t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int'
    +
    + +
    msvc
    +
    +
    t.c(3,11) : warning: conversion specifies type 'char *' but the argument has type 'int'
    +
    + +
    vi
    +
    +
    t.c +3:11: warning: conversion specifies type 'char *' but the argument has type 'int'
    +
    +
    +
    + + +
    -f[no-]diagnostics-show-name: +Enable the display of the diagnostic name.
    +
    This option, which defaults to off, controls whether or not +Clang prints the associated name.
    +
    +
    -f[no-]diagnostics-show-option: Enable [-Woption] information in diagnostic line.
    This option, which defaults to on, @@ -499,6 +528,8 @@ it:

  • A categorization of the diagnostic as a note, warning, error, or fatal error.
  • A text string that describes what the problem is.
  • +
  • An option that indicates whether to print the diagnostic name [-fdiagnostics-show-name].
  • An option that indicates how to control the diagnostic (for diagnostics that support it) [-fdiagnostics-show-option].
  • diff --git a/docs/doxygen.cfg b/docs/doxygen.cfg deleted file mode 100644 index 40180b2415df..000000000000 --- a/docs/doxygen.cfg +++ /dev/null @@ -1,1230 +0,0 @@ -# Doxyfile 1.4.4 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = clang - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = mainline - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = ../docs/doxygen - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, -# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, -# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, -# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, -# Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = NO - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = ../.. - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. - -JAVADOC_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -#SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 2 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources -# only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is YES. - -SHOW_DIRECTORIES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from the -# version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the progam writes to standard output -# is used as the file version. See the manual for examples. - -#FILE_VERSION_FILTER = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = NO - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = NO - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -#WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = ../include \ - ../lib \ - ../docs/doxygen.intro - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = ../examples - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = YES - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = ../docs/img - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = NO - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -#USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 4 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = llvm:: - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = ../docs/doxygen.header - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = ../docs/doxygen.footer - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = ../docs/doxygen.css - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = letter - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_PREDEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = ../include - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = YES - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = NO - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -#GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -#DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = dot - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_WIDTH = 1024 - -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_HEIGHT = 1024 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that a graph may be further truncated if the graph's -# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH -# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), -# the graph is not depth-constrained. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, which results in a white background. -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). - -#DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -#DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO diff --git a/docs/doxygen.cfg.in b/docs/doxygen.cfg.in index c1130fba4eee..ed9ffcb85a53 100644 --- a/docs/doxygen.cfg.in +++ b/docs/doxygen.cfg.in @@ -30,7 +30,7 @@ PROJECT_NUMBER = @PACKAGE_VERSION@ # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = @abs_top_builddir@/docs/doxygen +OUTPUT_DIRECTORY = @abs_builddir@/doxygen # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output @@ -450,9 +450,9 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = @abs_top_srcdir@/include \ - @abs_top_srcdir@/lib \ - @abs_top_srcdir@/docs/doxygen.intro +INPUT = @abs_srcdir@/../include \ + @abs_srcdir@/../lib \ + @abs_srcdir@/doxygen.intro # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp @@ -493,7 +493,7 @@ EXCLUDE_PATTERNS = # directories that contain example code fragments that are included (see # the \include command). -EXAMPLE_PATH = @abs_top_srcdir@/examples +EXAMPLE_PATH = @abs_srcdir@/../examples # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp @@ -513,7 +513,7 @@ EXAMPLE_RECURSIVE = YES # directories that contain image that are included in the documentation (see # the \image command). -IMAGE_PATH = @abs_top_srcdir@/docs/img +IMAGE_PATH = @abs_srcdir@/img # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -636,13 +636,13 @@ HTML_FILE_EXTENSION = .html # each generated HTML page. If it is left blank doxygen will generate a # standard header. -HTML_HEADER = @abs_top_srcdir@/docs/doxygen.header +HTML_HEADER = @abs_srcdir@/doxygen.header # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. -HTML_FOOTER = @abs_top_srcdir@/docs/doxygen.footer +HTML_FOOTER = @abs_srcdir@/doxygen.footer # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to @@ -651,7 +651,7 @@ HTML_FOOTER = @abs_top_srcdir@/docs/doxygen.footer # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! -HTML_STYLESHEET = @abs_top_srcdir@/docs/doxygen.css +HTML_STYLESHEET = @abs_srcdir@/doxygen.css # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to diff --git a/docs/libIndex.html b/docs/libIndex.html deleted file mode 100644 index e722ee14d4a2..000000000000 --- a/docs/libIndex.html +++ /dev/null @@ -1,267 +0,0 @@ - - - The Index Library - - - - - - - - - -
    - -

    The Index Library

    - -

    Table of Contents

    - - -

    Design Philosophy

    - -

    The Index library is meant to provide the basic infrastructure for - cross-translation-unit analysis and is primarily focused on indexing - related functionality. It provides an API for clients that need to - accurately map the AST nodes of the ASTContext to the locations in the source files. -It also allows them to analyze information across multiple translation units.

    - -

    As a "general rule", ASTContexts are considered the primary source of -information that a client wants about a translation unit. There will be no such class as an - "indexing database" that stores, for example, source locations of identifiers separately from ASTContext. -All the information that a client needs from a translation unit will be extracted from the ASTContext.

    - -

    Classes

    - -

    Entity

    - -

    To be able to reason about semantically the same Decls that are contained in multiple ASTContexts, the 'Entity' class was introduced. -An Entity is an ASTContext-independent "token" that can be created from a Decl (and a typename in the future) with -the purpose to "resolve" it into a Decl belonging to another ASTContext. Some examples to make the concept of Entities more clear:

    - -

    -t1.c: -

    -void foo(void);
    -void bar(void);
    -
    -

    - -

    -t2.c: -

    -void foo(void) {
    -}
    -
    -

    - -

    -Translation unit t1.c contains 2 Entities foo and bar, while t2.c contains 1 Entity foo. -Entities are uniqued in such a way that the Entity* pointer for t1.c/foo is the same as the Entity* pointer for t2.c/foo. -An Entity doesn't convey any information about the declaration, it is more like an opaque pointer used only to get the -associated Decl out of an ASTContext so that the actual information for the declaration can be accessed. -Another important aspect of Entities is that they can only be created/associated for declarations that are visible outside the -translation unit. This means that for: -

    -

    -t3.c: -

    -static void foo(void);
    -
    -

    -

    -there can be no Entity (if you ask for the Entity* of the static function foo you'll get a null pointer). -This is for 2 reasons: -

      -
    • To preserve the invariant that the same Entity* pointers refer to the same semantic Decls. - In the above example t1.c/foo and t2.c/foo are the same, while t3.c/foo is different.
    • -
    • The purpose of Entity is to get the same semantic Decl from multiple ASTContexts. For a Decl that is not visible - outside of its own translation unit, you don't need an Entity since it won't appear in another ASTContext.
    • -
    -

    - -

    ASTLocation

    - -Encapsulates a "point" in the AST tree of the ASTContext. -It represents either a Decl*, or a Stmt* along with its immediate Decl* parent. -An example for its usage is that libIndex will provide the references of foo in the form of ASTLocations, -"pointing" at the expressions that reference foo. - -

    DeclReferenceMap

    - -Accepts an ASTContext and creates a mapping from NamedDecls to the ASTLocations that reference them (in the same ASTContext). - -

    Functions

    - -

    ResolveLocationInAST

    - -A function that accepts an ASTContext and a SourceLocation which it resolves into an ASTLocation. - -

    AST Files

    - -The precompiled headers implementation of clang (PCH) is ideal for storing an ASTContext in a compact form that -will be loaded later for AST analysis. An "AST file" refers to a translation unit that was "compiled" into a precompiled header file. - -

    index-test tool

    - -

    Usage

    - -A command-line tool that exercises the libIndex API, useful for testing its features. -As input it accepts multiple AST files (representing multiple translation units) and a few options: - -

    -

    -   -point-at  [file:line:column]
    -
    -Resolves a [file:line:column] triplet into a ASTLocation from the first AST file. If no other option is specified, it prints the ASTLocation. -It also prints a declaration's associated doxygen comment, if one is available. -

    - -

    -

    -   -print-refs
    -
    -Prints the ASTLocations that reference the declaration that was resolved out of the [file:line:column] triplet -

    - -

    -

    -   -print-defs
    -
    -Prints the ASTLocations that define the resolved declaration -

    - -

    -

    -   -print-decls
    -
    -Prints the ASTLocations that declare the resolved declaration -

    - -

    Examples

    - -

    -Here's an example of using index-test: -

    - -

    -We have 3 files, -

    - -

    -foo.h: -

    -extern int global_var;
    -
    -void foo_func(int param1);
    -void bar_func(void);
    -
    - -t1.c: -
    -#include "foo.h"
    -
    -void foo_func(int param1) {
    -  int local_var = global_var;
    -  for (int for_var = 100; for_var < 500; ++for_var) {
    -    local_var = param1 + for_var;
    -  }
    -  bar_func();
    -}
    -
    - -t2.c: -
    -#include "foo.h"
    -
    -int global_var = 10;
    -
    -void bar_func(void) {
    -  global_var += 100;
    -  foo_func(global_var);
    -}
    -
    -

    - -

    -You first get AST files out of t1.c and t2.c: - -

    -$ clang -emit-ast t1.c -o t1.ast
    -$ clang -emit-ast t2.c -o t2.ast
    -
    -

    - -

    -Find the ASTLocation under this position of t1.c: -

    -[...]
    -void foo_func(int param1) {
    -  int local_var = global_var;
    -                      ^
    -[...]
    -
    - -
    -$ index-test t1.ast -point-at t1.c:4:23
    -> [Decl: Var local_var | Stmt: DeclRefExpr global_var] <t1.c:4:19, t1.c:4:19>
    -
    -

    - -

    -Find the declaration: - -

    -$ index-test t1.ast -point-at t1.c:4:23 -print-decls
    -> [Decl: Var global_var] <foo.h:1:12, foo.h:1:12>
    -
    -

    - -

    -Find the references: - -

    -$ index-test t1.ast t2.ast -point-at t1.c:4:23 -print-refs
    -> [Decl: Var local_var | Stmt: DeclRefExpr global_var] <t1.c:4:19, t1.c:4:19>
    -> [Decl: Function bar_func | Stmt: DeclRefExpr global_var] <t2.c:6:3, t2.c:6:3>
    -> [Decl: Function bar_func | Stmt: DeclRefExpr global_var] <t2.c:7:12, t2.c:7:12>
    -
    -

    - -

    -Find definitions: - -

    -$ index-test t1.ast t2.ast -point-at t1.c:4:23 -print-defs
    -> [Decl: Var global_var] <t2.c:3:5, t2.c:3:18>
    -
    -

    - -
    - - - diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 8e16ef1c6cfb..317bc81637d8 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,3 +1,2 @@ add_subdirectory(clang-interpreter) add_subdirectory(PrintFunctionNames) -add_subdirectory(Tooling) diff --git a/examples/Tooling/CMakeLists.txt b/examples/Tooling/CMakeLists.txt deleted file mode 100644 index 257d3ea8eaa3..000000000000 --- a/examples/Tooling/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -set(LLVM_USED_LIBS clangTooling clangBasic) - -add_clang_executable(clang-check - ClangCheck.cpp - ) - diff --git a/examples/Tooling/ClangCheck.cpp b/examples/Tooling/ClangCheck.cpp deleted file mode 100644 index 41283759a104..000000000000 --- a/examples/Tooling/ClangCheck.cpp +++ /dev/null @@ -1,108 +0,0 @@ -//===- examples/Tooling/ClangCheck.cpp - Clang check tool -----------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements a clang-check tool that runs the -// clang::SyntaxOnlyAction over a number of translation units. -// -// Usage: -// clang-check ... -// -// Where is a CMake build directory in which a file named -// compile_commands.json exists (enable -DCMAKE_EXPORT_COMPILE_COMMANDS in -// CMake to get this output). -// -// ... specify the paths of files in the CMake source tree. This path -// is looked up in the compile command database. If the path of a file is -// absolute, it needs to point into CMake's source tree. If the path is -// relative, the current working directory needs to be in the CMake source -// tree and the file must be in a subdirectory of the current working -// directory. "./" prefixes in the relative files will be automatically -// removed, but the rest of a relative path must be a suffix of a path in -// the compile command line database. -// -// For example, to use clang-check on all files in a subtree of the source -// tree, use: -// -// /path/in/subtree $ find . -name '*.cpp'| xargs clang-check /path/to/source -// -//===----------------------------------------------------------------------===// - -#include "clang/Frontend/FrontendActions.h" -#include "clang/Tooling/Tooling.h" -#include "llvm/ADT/OwningPtr.h" -#include "llvm/ADT/Twine.h" -#include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/Path.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/Support/system_error.h" - -/// \brief Returns the absolute path of 'File', by prepending it with -/// 'BaseDirectory' if 'File' is not absolute. Otherwise returns 'File'. -/// If 'File' starts with "./", the returned path will not contain the "./". -/// Otherwise, the returned path will contain the literal path-concatenation of -/// 'BaseDirectory' and 'File'. -/// -/// \param File Either an absolute or relative path. -/// \param BaseDirectory An absolute path. -/// -/// FIXME: Put this somewhere where it is more generally available. -static std::string GetAbsolutePath( - llvm::StringRef File, llvm::StringRef BaseDirectory) { - assert(llvm::sys::path::is_absolute(BaseDirectory)); - if (llvm::sys::path::is_absolute(File)) { - return File; - } - llvm::StringRef RelativePath(File); - if (RelativePath.startswith("./")) { - RelativePath = RelativePath.substr(strlen("./")); - } - llvm::SmallString<1024> AbsolutePath(BaseDirectory); - llvm::sys::path::append(AbsolutePath, RelativePath); - return AbsolutePath.str(); -} - -int main(int argc, char **argv) { - if (argc < 3) { - llvm::outs() << "Usage: " << argv[0] << " " - << " ...\n"; - return 1; - } - // FIXME: We should pull how to find the database into the Tooling package. - llvm::OwningPtr JsonDatabase; - llvm::SmallString<1024> JsonDatabasePath(argv[1]); - llvm::sys::path::append(JsonDatabasePath, "compile_commands.json"); - llvm::error_code Result = - llvm::MemoryBuffer::getFile(JsonDatabasePath, JsonDatabase); - if (Result != 0) { - llvm::outs() << "Error while opening JSON database: " << Result.message() - << "\n"; - return 1; - } - llvm::StringRef BaseDirectory(::getenv("PWD")); - for (int I = 2; I < argc; ++I) { - llvm::SmallString<1024> File(GetAbsolutePath(argv[I], BaseDirectory)); - llvm::outs() << "Processing " << File << ".\n"; - std::string ErrorMessage; - clang::tooling::CompileCommand LookupResult = - clang::tooling::FindCompileArgsInJsonDatabase( - File.str(), JsonDatabase->getBuffer(), ErrorMessage); - if (!LookupResult.CommandLine.empty()) { - if (!clang::tooling::RunToolWithFlags( - new clang::SyntaxOnlyAction, - LookupResult.CommandLine.size(), - clang::tooling::CommandLineToArgv( - &LookupResult.CommandLine).data())) { - llvm::outs() << "Error while processing " << File << ".\n"; - } - } else { - llvm::outs() << "Skipping " << File << ". Command line not found.\n"; - } - } - return 0; -} diff --git a/examples/Tooling/Makefile b/examples/Tooling/Makefile deleted file mode 100644 index 66e86a03f1c6..000000000000 --- a/examples/Tooling/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -##===- examples/Tooling/Makefile ---------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. - -TOOLNAME = clang-check -NO_INSTALL = 1 - -# No plugins, optimize startup time. -TOOL_NO_EXPORTS = 1 - -LINK_COMPONENTS := support mc -USEDLIBS = clangFrontend.a clangSerialization.a clangDriver.a \ - clangTooling.a clangSema.a clangAnalysis.a \ - clangAST.a clangParse.a clangLex.a clangBasic.a - -include $(CLANG_LEVEL)/Makefile - diff --git a/examples/clang-interpreter/Makefile b/examples/clang-interpreter/Makefile index 3f020037e16f..b565bb172b07 100644 --- a/examples/clang-interpreter/Makefile +++ b/examples/clang-interpreter/Makefile @@ -18,7 +18,8 @@ TOOL_NO_EXPORTS = 1 LINK_COMPONENTS := jit interpreter nativecodegen bitreader bitwriter ipo \ selectiondag asmparser instrumentation USEDLIBS = clangFrontend.a clangSerialization.a clangDriver.a clangCodeGen.a \ - clangSema.a clangStaticAnalyzerFrontend.a clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a clangAnalysis.a clangRewrite.a \ - clangAST.a clangParse.a clangLex.a clangBasic.a + clangParse.a clangSema.a clangStaticAnalyzerFrontend.a \ + clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a \ + clangAnalysis.a clangRewrite.a clangAST.a clangLex.a clangBasic.a include $(CLANG_LEVEL)/Makefile diff --git a/examples/clang-interpreter/main.cpp b/examples/clang-interpreter/main.cpp index ad39ecec9bd3..16f4dab05d70 100644 --- a/examples/clang-interpreter/main.cpp +++ b/examples/clang-interpreter/main.cpp @@ -94,7 +94,7 @@ int main(int argc, const char **argv, char * const *envp) { // We expect to get back exactly one command job, if we didn't something // failed. Extract that job from the compilation. const driver::JobList &Jobs = C->getJobs(); - if (Jobs.size() != 1 || !isa(Jobs.begin())) { + if (Jobs.size() != 1 || !isa(*Jobs.begin())) { llvm::SmallString<256> Msg; llvm::raw_svector_ostream OS(Msg); C->PrintJob(OS, C->getJobs(), "; ", true); diff --git a/examples/wpa/Makefile b/examples/wpa/Makefile index 2ce2040c87ca..2cfedbcfdfb0 100644 --- a/examples/wpa/Makefile +++ b/examples/wpa/Makefile @@ -16,8 +16,11 @@ NO_INSTALL = 1 TOOL_NO_EXPORTS = 1 LINK_COMPONENTS := asmparser bitreader mc core -USEDLIBS = clangStaticAnalyzerFrontend.a clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a clangIndex.a clangFrontend.a clangDriver.a \ - clangSema.a clangAnalysis.a clangSerialization.a \ - clangAST.a clangParse.a clangLex.a clangBasic.a +USEDLIBS = clangStaticAnalyzerFrontend.a \ + clangStaticAnalyzerCheckers.a \ + clangStaticAnalyzerCore.a \ + clangIndex.a clangFrontend.a clangDriver.a \ + clangParse.a clangSema.a clangAnalysis.a clangSerialization.a \ + clangAST.a clangLex.a clangBasic.a include $(CLANG_LEVEL)/Makefile diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index d89a903e4112..cb0b3c1babcb 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -221,6 +221,14 @@ CINDEX_LINKAGE CXString clang_getFileName(CXFile SFile); */ CINDEX_LINKAGE time_t clang_getFileTime(CXFile SFile); +/** + * \brief Determine whether the given header is guarded against + * multiple inclusions, either with the conventional + * #ifndef/#define/#endif macro guards or with #pragma once. + */ +CINDEX_LINKAGE unsigned +clang_isFileMultipleIncludeGuarded(CXTranslationUnit tu, CXFile file); + /** * \brief Retrieve a file handle within the given translation unit. * @@ -821,7 +829,18 @@ enum CXTranslationUnit_Flags { * Note: this is a *temporary* option that is available only while * we are testing C++ precompiled preamble support. */ - CXTranslationUnit_CXXChainedPCH = 0x20 + CXTranslationUnit_CXXChainedPCH = 0x20, + + /** + * \brief Used to indicate that the "detailed" preprocessing record, + * if requested, should also contain nested macro instantiations. + * + * Nested macro instantiations (i.e., macro instantiations that occur + * inside another macro instantiation) can, in some code bases, require + * a large amount of storage to due preprocessor metaprogramming. Moreover, + * its fairly rare that this information is useful for libclang clients. + */ + CXTranslationUnit_NestedMacroInstantiations = 0x40 }; /** @@ -1027,12 +1046,14 @@ enum CXTUResourceUsageKind { CXTUResourceUsage_SourceManager_Membuffer_MMap = 8, CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9, CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10, + CXTUResourceUsage_Preprocessor = 11, + CXTUResourceUsage_PreprocessingRecord = 12, CXTUResourceUsage_MEMORY_IN_BYTES_BEGIN = CXTUResourceUsage_AST, CXTUResourceUsage_MEMORY_IN_BYTES_END = - CXTUResourceUsage_ExternalASTSource_Membuffer_MMap, + CXTUResourceUsage_PreprocessingRecord, CXTUResourceUsage_First = CXTUResourceUsage_AST, - CXTUResourceUsage_Last = CXTUResourceUsage_ExternalASTSource_Membuffer_MMap + CXTUResourceUsage_Last = CXTUResourceUsage_PreprocessingRecord }; /** @@ -1166,8 +1187,12 @@ enum CXCursorKind { CXCursor_UsingDeclaration = 35, /** \brief A C++ alias declaration */ CXCursor_TypeAliasDecl = 36, + /** \brief An Objective-C @synthesize definition. */ + CXCursor_ObjCSynthesizeDecl = 37, + /** \brief An Objective-C @dynamic definition. */ + CXCursor_ObjCDynamicDecl = 38, CXCursor_FirstDecl = CXCursor_UnexposedDecl, - CXCursor_LastDecl = CXCursor_TypeAliasDecl, + CXCursor_LastDecl = CXCursor_ObjCDynamicDecl, /* References */ CXCursor_FirstRef = 40, /* Decl references */ @@ -2245,6 +2270,13 @@ CINDEX_LINKAGE CXCursor clang_getCanonicalCursor(CXCursor); */ CINDEX_LINKAGE unsigned clang_CXXMethod_isStatic(CXCursor C); +/** + * \brief Determine if a C++ member function or member function template is + * explicitly declared 'virtual' or if it overrides a virtual method from + * one of the base classes. + */ +CINDEX_LINKAGE unsigned clang_CXXMethod_isVirtual(CXCursor C); + /** * \brief Given a cursor that represents a template, determine * the cursor kind of the specializations would be generated by instantiating diff --git a/include/clang/AST/APValue.h b/include/clang/AST/APValue.h index 5effa9057a4e..fec7d29f6d7b 100644 --- a/include/clang/AST/APValue.h +++ b/include/clang/AST/APValue.h @@ -85,10 +85,10 @@ public: APValue(const APValue &RHS) : Kind(Uninitialized) { *this = RHS; } - APValue(Expr* B, const CharUnits &O) : Kind(Uninitialized) { + APValue(const Expr* B, const CharUnits &O) : Kind(Uninitialized) { MakeLValue(); setLValue(B, O); } - APValue(Expr* B); + APValue(const Expr* B); ~APValue() { MakeUninit(); @@ -167,7 +167,7 @@ public: return const_cast(this)->getComplexFloatImag(); } - Expr* getLValueBase() const; + const Expr* getLValueBase() const; CharUnits getLValueOffset() const; void setInt(const APSInt &I) { @@ -199,7 +199,7 @@ public: ((ComplexAPFloat*)(char*)Data)->Real = R; ((ComplexAPFloat*)(char*)Data)->Imag = I; } - void setLValue(Expr *B, const CharUnits &O); + void setLValue(const Expr *B, const CharUnits &O); const APValue &operator=(const APValue &RHS); diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 28ec8cf88d52..517c25df24bb 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -406,6 +406,21 @@ public: /// bitfield which follows the bitfield 'LastFD'. bool ZeroBitfieldFollowsBitfield(const FieldDecl *FD, const FieldDecl *LastFD) const; + + /// BitfieldFollowsBitfield - return 'true" if 'FD' is a + /// bitfield which follows the bitfield 'LastFD'. + bool BitfieldFollowsBitfield(const FieldDecl *FD, + const FieldDecl *LastFD) const; + + /// NoneBitfieldFollowsBitfield - return 'true" if 'FD' is not a + /// bitfield which follows the bitfield 'LastFD'. + bool NoneBitfieldFollowsBitfield(const FieldDecl *FD, + const FieldDecl *LastFD) const; + + /// BitfieldFollowsNoneBitfield - return 'true" if 'FD' is a + /// bitfield which follows the none bitfield 'LastFD'. + bool BitfieldFollowsNoneBitfield(const FieldDecl *FD, + const FieldDecl *LastFD) const; // Access to the set of methods overridden by the given C++ method. typedef CXXMethodVector::iterator overridden_cxx_method_iterator; @@ -764,6 +779,10 @@ public: /// getDecltypeType - C++0x decltype. QualType getDecltypeType(Expr *e) const; + /// getUnaryTransformType - unary type transforms + QualType getUnaryTransformType(QualType BaseType, QualType UnderlyingType, + UnaryTransformType::UTTKind UKind) const; + /// getAutoType - C++0x deduced auto type. QualType getAutoType(QualType DeducedType) const; @@ -895,12 +914,18 @@ public: std::string &S) const; /// getObjCEncodingForFunctionDecl - Returns the encoded type for this - //function. This is in the same format as Objective-C method encodings. - void getObjCEncodingForFunctionDecl(const FunctionDecl *Decl, std::string& S); + /// function. This is in the same format as Objective-C method encodings. + /// + /// \returns true if an error occurred (e.g., because one of the parameter + /// types is incomplete), false otherwise. + bool getObjCEncodingForFunctionDecl(const FunctionDecl *Decl, std::string& S); /// getObjCEncodingForMethodDecl - Return the encoded type for this method /// declaration. - void getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, std::string &S) + /// + /// \returns true if an error occurred (e.g., because one of the parameter + /// types is incomplete), false otherwise. + bool getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, std::string &S) const; /// getObjCEncodingForBlock - Return the encoded type for this block @@ -1438,7 +1463,8 @@ public: /// MakeIntValue - Make an APSInt of the appropriate width and /// signedness for the given \arg Value and integer \arg Type. llvm::APSInt MakeIntValue(uint64_t Value, QualType Type) const { - llvm::APSInt Res(getIntWidth(Type), !Type->isSignedIntegerType()); + llvm::APSInt Res(getIntWidth(Type), + !Type->isSignedIntegerOrEnumerationType()); Res = Value; return Res; } @@ -1526,6 +1552,13 @@ public: /// which declarations were built. static unsigned NumImplicitCopyConstructorsDeclared; + /// \brief The number of implicitly-declared move constructors. + static unsigned NumImplicitMoveConstructors; + + /// \brief The number of implicitly-declared move constructors for + /// which declarations were built. + static unsigned NumImplicitMoveConstructorsDeclared; + /// \brief The number of implicitly-declared copy assignment operators. static unsigned NumImplicitCopyAssignmentOperators; @@ -1533,6 +1566,13 @@ public: /// which declarations were built. static unsigned NumImplicitCopyAssignmentOperatorsDeclared; + /// \brief The number of implicitly-declared move assignment operators. + static unsigned NumImplicitMoveAssignmentOperators; + + /// \brief The number of implicitly-declared move assignment operators for + /// which declarations were built. + static unsigned NumImplicitMoveAssignmentOperatorsDeclared; + /// \brief The number of implicitly-declared destructors. static unsigned NumImplicitDestructors; @@ -1553,7 +1593,13 @@ private: bool ExpandStructures, const FieldDecl *Field, bool OutermostType = false, - bool EncodingProperty = false) const; + bool EncodingProperty = false, + bool StructField = false) const; + + // Adds the encoding of the structure's members. + void getObjCEncodingForStructureImpl(RecordDecl *RD, std::string &S, + const FieldDecl *Field, + bool includeVBases = true) const; const ASTRecordLayout & getObjCLayout(const ObjCInterfaceDecl *D, diff --git a/include/clang/AST/CanonicalType.h b/include/clang/AST/CanonicalType.h index b3550f877323..251881490499 100644 --- a/include/clang/AST/CanonicalType.h +++ b/include/clang/AST/CanonicalType.h @@ -291,6 +291,8 @@ public: LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isPromotableIntegerType) LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isSignedIntegerType) LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isUnsignedIntegerType) + LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isSignedIntegerOrEnumerationType) + LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isUnsignedIntegerOrEnumerationType) LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isConstantSizeType) LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isSpecifierType) @@ -630,6 +632,14 @@ struct CanProxyAdaptor : public CanProxyBase { LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getUnderlyingType) }; +template <> +struct CanProxyAdaptor + : public CanProxyBase { + LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getBaseType) + LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getUnderlyingType) + LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(UnaryTransformType::UTTKind, getUTTKind) +}; + template<> struct CanProxyAdaptor : public CanProxyBase { LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(TagDecl *, getDecl) diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index ef4920520391..d993d345ef96 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -1365,6 +1365,8 @@ private: bool HasWrittenPrototype : 1; bool IsDeleted : 1; bool IsTrivial : 1; // sunk from CXXMethodDecl + bool IsDefaulted : 1; // sunk from CXXMethoDecl + bool IsExplicitlyDefaulted : 1; //sunk from CXXMethodDecl bool HasImplicitReturnZero : 1; bool IsLateTemplateParsed : 1; @@ -1448,6 +1450,7 @@ protected: IsInline(isInlineSpecified), IsInlineSpecified(isInlineSpecified), IsVirtualAsWritten(false), IsPure(false), HasInheritedPrototype(false), HasWrittenPrototype(true), IsDeleted(false), IsTrivial(false), + IsDefaulted(false), IsExplicitlyDefaulted(false), HasImplicitReturnZero(false), IsLateTemplateParsed(false), EndRangeLoc(NameInfo.getEndLoc()), TemplateOrSpecialization(), @@ -1512,6 +1515,20 @@ public: return hasBody(Definition); } + /// hasTrivialBody - Returns whether the function has a trivial body that does + /// not require any specific codegen. + bool hasTrivialBody() const; + + /// isDefined - Returns true if the function is defined at all, including + /// a deleted definition. Except for the behavior when the function is + /// deleted, behaves like hasBody. + bool isDefined(const FunctionDecl *&Definition) const; + + virtual bool isDefined() const { + const FunctionDecl* Definition; + return isDefined(Definition); + } + /// getBody - Retrieve the body (definition) of the function. The /// function body might be in any of the (re-)declarations of this /// function. The variant that accepts a FunctionDecl pointer will @@ -1529,10 +1546,17 @@ public: /// isThisDeclarationADefinition - Returns whether this specific /// declaration of the function is also a definition. This does not /// determine whether the function has been defined (e.g., in a - /// previous definition); for that information, use getBody. - /// FIXME: Should return true if function is deleted or defaulted. However, - /// CodeGenModule.cpp uses it, and I don't know if this would break it. + /// previous definition); for that information, use isDefined. Note + /// that this returns false for a defaulted function unless that function + /// has been implicitly defined (possibly as deleted). bool isThisDeclarationADefinition() const { + return IsDeleted || Body || IsLateTemplateParsed; + } + + /// doesThisDeclarationHaveABody - Returns whether this specific + /// declaration of the function has a body - that is, if it is a non- + /// deleted definition. + bool doesThisDeclarationHaveABody() const { return Body || IsLateTemplateParsed; } @@ -1566,6 +1590,16 @@ public: bool isTrivial() const { return IsTrivial; } void setTrivial(bool IT) { IsTrivial = IT; } + /// Whether this function is defaulted per C++0x. Only valid for + /// special member functions. + bool isDefaulted() const { return IsDefaulted; } + void setDefaulted(bool D = true) { IsDefaulted = D; } + + /// Whether this function is explicitly defaulted per C++0x. Only valid + /// for special member functions. + bool isExplicitlyDefaulted() const { return IsExplicitlyDefaulted; } + void setExplicitlyDefaulted(bool ED = true) { IsExplicitlyDefaulted = ED; } + /// Whether falling off this function implicitly returns null/zero. /// If a more specific implicit return value is required, front-ends /// should synthesize the appropriate return statements. @@ -1605,13 +1639,30 @@ public: /// Integer(long double) = delete; // no construction from long double /// }; /// @endcode - bool isDeleted() const { return IsDeleted; } - void setDeleted(bool D = true) { IsDeleted = D; } + // If a function is deleted, its first declaration must be. + bool isDeleted() const { return getCanonicalDecl()->IsDeleted; } + bool isDeletedAsWritten() const { return IsDeleted && !IsDefaulted; } + void setDeletedAsWritten(bool D = true) { IsDeleted = D; } - /// \brief Determines whether this is a function "main", which is - /// the entry point into an executable program. + /// \brief Determines whether this function is "main", which is the + /// entry point into an executable program. bool isMain() const; + /// \brief Determines whether this operator new or delete is one + /// of the reserved global placement operators: + /// void *operator new(size_t, void *); + /// void *operator new[](size_t, void *); + /// void operator delete(void *, void *); + /// void operator delete[](void *, void *); + /// These functions have special behavior under [new.delete.placement]: + /// These functions are reserved, a C++ program may not define + /// functions that displace the versions in the Standard C++ library. + /// The provisions of [basic.stc.dynamic] do not apply to these + /// reserved placement forms of operator new and operator delete. + /// + /// This function must be an allocation or deallocation function. + bool isReservedGlobalPlacementOperator() const; + /// \brief Determines whether this function is a function with /// external, C linkage. bool isExternC() const; @@ -1902,20 +1953,33 @@ class FieldDecl : public DeclaratorDecl { bool Mutable : 1; mutable unsigned CachedFieldIndex : 31; - Expr *BitWidth; + /// \brief A pointer to either the in-class initializer for this field (if + /// the boolean value is false), or the bit width expression for this bit + /// field (if the boolean value is true). + /// + /// We can safely combine these two because in-class initializers are not + /// permitted for bit-fields. + /// + /// If the boolean is false and the initializer is null, then this field has + /// an in-class initializer which has not yet been parsed and attached. + llvm::PointerIntPair InitializerOrBitWidth; protected: FieldDecl(Kind DK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, - QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable) + QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable, + bool HasInit) : DeclaratorDecl(DK, DC, IdLoc, Id, T, TInfo, StartLoc), - Mutable(Mutable), CachedFieldIndex(0), BitWidth(BW) { + Mutable(Mutable), CachedFieldIndex(0), + InitializerOrBitWidth(BW, !HasInit) { + assert(!(BW && HasInit) && "got initializer for bitfield"); } public: static FieldDecl *Create(const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, - TypeSourceInfo *TInfo, Expr *BW, bool Mutable); + TypeSourceInfo *TInfo, Expr *BW, bool Mutable, + bool HasInit); /// getFieldIndex - Returns the index of this field within its record, /// as appropriate for passing to ASTRecordLayout::getFieldOffset. @@ -1928,10 +1992,12 @@ public: void setMutable(bool M) { Mutable = M; } /// isBitfield - Determines whether this field is a bitfield. - bool isBitField() const { return BitWidth != NULL; } + bool isBitField() const { + return InitializerOrBitWidth.getInt() && InitializerOrBitWidth.getPointer(); + } /// @brief Determines whether this is an unnamed bitfield. - bool isUnnamedBitfield() const { return BitWidth != NULL && !getDeclName(); } + bool isUnnamedBitfield() const { return isBitField() && !getDeclName(); } /// isAnonymousStructOrUnion - Determines whether this field is a /// representative for an anonymous struct or union. Such fields are @@ -1939,8 +2005,37 @@ public: /// store the data for the anonymous union or struct. bool isAnonymousStructOrUnion() const; - Expr *getBitWidth() const { return BitWidth; } - void setBitWidth(Expr *BW) { BitWidth = BW; } + Expr *getBitWidth() const { + return isBitField() ? InitializerOrBitWidth.getPointer() : 0; + } + void setBitWidth(Expr *BW) { + assert(!InitializerOrBitWidth.getPointer() && + "bit width or initializer already set"); + InitializerOrBitWidth.setPointer(BW); + InitializerOrBitWidth.setInt(1); + } + + /// hasInClassInitializer - Determine whether this member has a C++0x in-class + /// initializer. + bool hasInClassInitializer() const { + return !InitializerOrBitWidth.getInt(); + } + /// getInClassInitializer - Get the C++0x in-class initializer for this + /// member, or null if one has not been set. If a valid declaration has an + /// in-class initializer, but this returns null, then we have not parsed and + /// attached it yet. + Expr *getInClassInitializer() const { + return hasInClassInitializer() ? InitializerOrBitWidth.getPointer() : 0; + } + /// setInClassInitializer - Set the C++0x in-class initializer for this member. + void setInClassInitializer(Expr *Init); + /// removeInClassInitializer - Remove the C++0x in-class initializer from this + /// member. + void removeInClassInitializer() { + assert(!InitializerOrBitWidth.getInt() && "no initializer to remove"); + InitializerOrBitWidth.setPointer(0); + InitializerOrBitWidth.setInt(1); + } /// getParent - Returns the parent of this field declaration, which /// is the struct in which this method is defined. diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index ce48187f3ade..b5047b91c0e8 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -1355,17 +1355,12 @@ struct cast_convert_decl_context { namespace llvm { /// isa(DeclContext*) -template -struct isa_impl_wrap { +template +struct isa_impl { static bool doit(const ::clang::DeclContext &Val) { - return ToTy::classofKind(Val.getDeclKind()); + return To::classofKind(Val.getDeclKind()); } }; -template -struct isa_impl_wrap - : public isa_impl_wrap {}; /// cast(DeclContext*) template diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index 8c819e38781d..42a12eb5a34c 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -278,10 +278,18 @@ class CXXRecordDecl : public RecordDecl { /// user-declared copy constructor. bool UserDeclaredCopyConstructor : 1; + /// UserDeclareMoveConstructor - True when this class has a + /// user-declared move constructor. + bool UserDeclaredMoveConstructor : 1; + /// UserDeclaredCopyAssignment - True when this class has a /// user-declared copy assignment operator. bool UserDeclaredCopyAssignment : 1; + /// UserDeclareMoveAssignment - True when this class has a + /// user-declared move assignment. + bool UserDeclaredMoveAssignment : 1; + /// UserDeclaredDestructor - True when this class has a /// user-declared destructor. bool UserDeclaredDestructor : 1; @@ -337,15 +345,24 @@ class CXXRecordDecl : public RecordDecl { /// HasPublicFields - True when there are private non-static data members. bool HasPublicFields : 1; - /// HasTrivialConstructor - True when this class has a trivial constructor. + /// \brief True if this class (or any subobject) has mutable fields. + bool HasMutableFields : 1; + + /// HasTrivialDefaultConstructor - True when, if this class has a default + /// constructor, this default constructor is trivial. /// - /// C++ [class.ctor]p5. A constructor is trivial if it is an - /// implicitly-declared default constructor and if: - /// * its class has no virtual functions and no virtual base classes, and - /// * all the direct base classes of its class have trivial constructors, and - /// * for all the nonstatic data members of its class that are of class type - /// (or array thereof), each such class has a trivial constructor. - bool HasTrivialConstructor : 1; + /// C++0x [class.ctor]p5 + /// A default constructor is trivial if it is not user-provided and if + /// -- its class has no virtual functions and no virtual base classes, + /// and + /// -- no non-static data member of its class has a + /// brace-or-equal-initializer, and + /// -- all the direct base classes of its class have trivial + /// default constructors, and + /// -- for all the nonstatic data members of its class that are of class + /// type (or array thereof), each such class has a trivial + /// default constructor. + bool HasTrivialDefaultConstructor : 1; /// HasConstExprNonCopyMoveConstructor - True when this class has at least /// one constexpr constructor which is neither the copy nor move @@ -357,7 +374,7 @@ class CXXRecordDecl : public RecordDecl { /// /// C++0x [class.copy]p13: /// A copy/move constructor for class X is trivial if it is neither - /// user-provided nor deleted and if + /// user-provided and if /// -- class X has no virtual functions and no virtual base classes, and /// -- the constructor selected to copy/move each direct base class /// subobject is trivial, and @@ -372,7 +389,7 @@ class CXXRecordDecl : public RecordDecl { /// /// C++0x [class.copy]p13: /// A copy/move constructor for class X is trivial if it is neither - /// user-provided nor deleted and if + /// user-provided and if /// -- class X has no virtual functions and no virtual base classes, and /// -- the constructor selected to copy/move each direct base class /// subobject is trivial, and @@ -430,15 +447,24 @@ class CXXRecordDecl : public RecordDecl { /// already computed and are available. bool ComputedVisibleConversions : 1; - /// \brief Whether we have already declared the default constructor or - /// do not need to have one declared. + /// \brief Whether we have a C++0x user-provided default constructor (not + /// explicitly deleted or defaulted). + bool UserProvidedDefaultConstructor : 1; + + /// \brief Whether we have already declared the default constructor. bool DeclaredDefaultConstructor : 1; /// \brief Whether we have already declared the copy constructor. bool DeclaredCopyConstructor : 1; + + /// \brief Whether we have already declared the move constructor. + bool DeclaredMoveConstructor : 1; /// \brief Whether we have already declared the copy-assignment operator. bool DeclaredCopyAssignment : 1; + + /// \brief Whether we have already declared the move-assignment operator. + bool DeclaredMoveAssignment : 1; /// \brief Whether we have already declared a destructor within the class. bool DeclaredDestructor : 1; @@ -666,21 +692,30 @@ public: return data().FirstFriend != 0; } - /// \brief Determine whether this class has had its default constructor - /// declared implicitly or does not need one declared implicitly. + /// \brief Determine if we need to declare a default constructor for + /// this class. /// /// This value is used for lazy creation of default constructors. + bool needsImplicitDefaultConstructor() const { + return !data().UserDeclaredConstructor && + !data().DeclaredDefaultConstructor; + } + + /// hasDeclaredDefaultConstructor - Whether this class's default constructor + /// has been declared (either explicitly or implicitly). bool hasDeclaredDefaultConstructor() const { return data().DeclaredDefaultConstructor; } - + /// hasConstCopyConstructor - Determines whether this class has a /// copy constructor that accepts a const-qualified argument. - bool hasConstCopyConstructor(const ASTContext &Context) const; + bool hasConstCopyConstructor() const; /// getCopyConstructor - Returns the copy constructor for this class - CXXConstructorDecl *getCopyConstructor(const ASTContext &Context, - unsigned TypeQuals) const; + CXXConstructorDecl *getCopyConstructor(unsigned TypeQuals) const; + + /// getMoveConstructor - Returns the move constructor for this class + CXXConstructorDecl *getMoveConstructor() const; /// \brief Retrieve the copy-assignment operator for this class, if available. /// @@ -693,6 +728,10 @@ public: /// \returns The copy-assignment operator that can be invoked, or NULL if /// a unique copy-assignment operator could not be found. CXXMethodDecl *getCopyAssignmentOperator(bool ArgIsConst) const; + + /// getMoveAssignmentOperator - Returns the move assignment operator for this + /// class + CXXMethodDecl *getMoveAssignmentOperator() const; /// hasUserDeclaredConstructor - Whether this class has any /// user-declared constructors. When true, a default constructor @@ -701,6 +740,12 @@ public: return data().UserDeclaredConstructor; } + /// hasUserProvidedDefaultconstructor - Whether this class has a + /// user-provided default constructor per C++0x. + bool hasUserProvidedDefaultConstructor() const { + return data().UserProvidedDefaultConstructor; + } + /// hasUserDeclaredCopyConstructor - Whether this class has a /// user-declared copy constructor. When false, a copy constructor /// will be implicitly declared. @@ -715,7 +760,27 @@ public: bool hasDeclaredCopyConstructor() const { return data().DeclaredCopyConstructor; } - + + /// hasUserDeclaredMoveOperation - Whether this class has a user- + /// declared move constructor or assignment operator. When false, a + /// move constructor and assignment operator may be implicitly declared. + bool hasUserDeclaredMoveOperation() const { + return data().UserDeclaredMoveConstructor || + data().UserDeclaredMoveAssignment; + } + + /// \brief Determine whether this class has had a move constructor + /// declared by the user. + bool hasUserDeclaredMoveConstructor() const { + return data().UserDeclaredMoveConstructor; + } + + /// \brief Determine whether this class has had a move constructor + /// declared. + bool hasDeclaredMoveConstructor() const { + return data().DeclaredMoveConstructor; + } + /// hasUserDeclaredCopyAssignment - Whether this class has a /// user-declared copy assignment operator. When false, a copy /// assigment operator will be implicitly declared. @@ -730,7 +795,19 @@ public: bool hasDeclaredCopyAssignment() const { return data().DeclaredCopyAssignment; } - + + /// \brief Determine whether this class has had a move assignment + /// declared by the user. + bool hasUserDeclaredMoveAssignment() const { + return data().UserDeclaredMoveAssignment; + } + + /// hasDeclaredMoveAssignment - Whether this class has a + /// declared move assignment operator. + bool hasDeclaredMoveAssignment() const { + return data().DeclaredMoveAssignment; + } + /// hasUserDeclaredDestructor - Whether this class has a /// user-declared destructor. When false, a destructor will be /// implicitly declared. @@ -800,9 +877,18 @@ public: /// (C++ [class]p7) bool isStandardLayout() const { return data().IsStandardLayout; } - // hasTrivialConstructor - Whether this class has a trivial constructor - // (C++ [class.ctor]p5) - bool hasTrivialConstructor() const { return data().HasTrivialConstructor; } + /// \brief Whether this class, or any of its class subobjects, contains a + /// mutable field. + bool hasMutableFields() const { return data().HasMutableFields; } + + // hasTrivialDefaultConstructor - Whether this class has a trivial default + // constructor + // (C++0x [class.ctor]p5) + bool hasTrivialDefaultConstructor() const { + return data().HasTrivialDefaultConstructor && + (!data().UserDeclaredConstructor || + data().DeclaredDefaultConstructor); + } // hasConstExprNonCopyMoveConstructor - Whether this class has at least one // constexpr constructor other than the copy or move constructors @@ -845,9 +931,18 @@ public: } // isTriviallyCopyable - Whether this class is considered trivially copyable - // (C++0x [class]p5). + // (C++0x [class]p6). bool isTriviallyCopyable() const; + // isTrivial - Whether this class is considered trivial + // + // C++0x [class]p6 + // A trivial class is a class that has a trivial default constructor and + // is trivially copiable. + bool isTrivial() const { + return isTriviallyCopyable() && hasTrivialDefaultConstructor(); + } + /// \brief If this record is an instantiation of a member class, /// retrieves the member class from which it was instantiated. /// @@ -1182,6 +1277,9 @@ public: /// \brief Determine whether this is a copy-assignment operator, regardless /// of whether it was declared implicitly or explicitly. bool isCopyAssignmentOperator() const; + + /// \brief Determine whether this is a move assignment operator. + bool isMoveAssignmentOperator() const; const CXXMethodDecl *getCanonicalDecl() const { return cast(FunctionDecl::getCanonicalDecl()); @@ -1189,6 +1287,12 @@ public: CXXMethodDecl *getCanonicalDecl() { return cast(FunctionDecl::getCanonicalDecl()); } + + /// isUserProvided - True if it is either an implicit constructor or + /// if it was defaulted or deleted on first declaration. + bool isUserProvided() const { + return !(isDeleted() || getCanonicalDecl()->isDefaulted()); + } /// void addOverriddenMethod(const CXXMethodDecl *MD); @@ -1274,6 +1378,8 @@ class CXXCtorInitializer { /// \brief The argument used to initialize the base or member, which may /// end up constructing an object (when multiple arguments are involved). + /// If 0, this is a field initializer, and the in-class member initializer + /// will be used. Stmt *Init; /// LParenLoc - Location of the left paren of the ctor-initializer. @@ -1348,6 +1454,13 @@ public: return Initializee.is(); } + /// isInClassMemberInitializer - Returns true when this initializer is an + /// implicit ctor initializer generated for a field with an initializer + /// defined on the member declaration. + bool isInClassMemberInitializer() const { + return !Init; + } + /// isDelegatingInitializer - Returns true when this initializer is creating /// a delegating constructor. bool isDelegatingInitializer() const { @@ -1476,7 +1589,14 @@ public: reinterpret_cast(this + 1)[I] = Index; } - Expr *getInit() const { return static_cast(Init); } + /// \brief Get the initializer. This is 0 if this is an in-class initializer + /// for a non-static data member which has not yet been parsed. + Expr *getInit() const { + if (!Init) + return getAnyMember()->getInClassInitializer(); + + return static_cast(Init); + } }; /// CXXConstructorDecl - Represents a C++ constructor within a @@ -1619,10 +1739,9 @@ public: /// getTargetConstructor - When this constructor delegates to /// another, retrieve the target CXXConstructorDecl *getTargetConstructor() const { - if (isDelegatingConstructor()) - return CtorInitializers[0]->getTargetConstructor(); - else - return 0; + assert(isDelegatingConstructor() && + "A non-delegating constructor has no target"); + return CtorInitializers[0]->getTargetConstructor(); } /// isDefaultConstructor - Whether this constructor is a default @@ -1693,6 +1812,13 @@ public: /// \brief Set the constructor that this inheriting constructor is based on. void setInheritedConstructor(const CXXConstructorDecl *BaseCtor); + + const CXXConstructorDecl *getCanonicalDecl() const { + return cast(FunctionDecl::getCanonicalDecl()); + } + CXXConstructorDecl *getCanonicalDecl() { + return cast(FunctionDecl::getCanonicalDecl()); + } // Implement isa/cast/dyncast/etc. static bool classof(const Decl *D) { return classofKind(D->getKind()); } diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index 0a4d864cd867..74ceb43c713c 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -135,6 +135,9 @@ private: /// in, inout, etc. unsigned objcDeclQualifier : 6; + /// \brief Indicates whether this method has a related result type. + unsigned RelatedResultType : 1; + // Number of args separated by ':' in a method declaration. unsigned NumSelectorArgs; @@ -171,6 +174,7 @@ private: bool isSynthesized = false, bool isDefined = false, ImplementationControl impControl = None, + bool HasRelatedResultType = false, unsigned numSelectorArgs = 0) : NamedDecl(ObjCMethod, contextDecl, beginLoc, SelInfo), DeclContext(ObjCMethod), Family(InvalidObjCMethodFamily), @@ -178,8 +182,8 @@ private: IsSynthesized(isSynthesized), IsDefined(isDefined), DeclImplementation(impControl), objcDeclQualifier(OBJC_TQ_None), - NumSelectorArgs(numSelectorArgs), MethodDeclType(T), - ResultTInfo(ResultTInfo), + RelatedResultType(HasRelatedResultType), NumSelectorArgs(numSelectorArgs), + MethodDeclType(T), ResultTInfo(ResultTInfo), EndLoc(endLoc), Body(0), SelfDecl(0), CmdDecl(0) {} /// \brief A definition will return its interface declaration. @@ -199,6 +203,7 @@ public: bool isSynthesized = false, bool isDefined = false, ImplementationControl impControl = None, + bool HasRelatedResultType = false, unsigned numSelectorArgs = 0); virtual ObjCMethodDecl *getCanonicalDecl(); @@ -211,6 +216,13 @@ public: } void setObjCDeclQualifier(ObjCDeclQualifier QV) { objcDeclQualifier = QV; } + /// \brief Determine whether this method has a result type that is related + /// to the message receiver's type. + bool hasRelatedResultType() const { return RelatedResultType; } + + /// \brief Note whether this method has a related result type. + void SetRelatedResultType(bool RRT = true) { RelatedResultType = RRT; } + unsigned getNumSelectorArgs() const { return NumSelectorArgs; } void setNumSelectorArgs(unsigned numSelectorArgs) { NumSelectorArgs = numSelectorArgs; @@ -712,7 +724,7 @@ private: QualType T, TypeSourceInfo *TInfo, AccessControl ac, Expr *BW, bool synthesized) : FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id, T, TInfo, BW, - /*Mutable=*/false), + /*Mutable=*/false, /*HasInit=*/false), NextIvar(0), DeclAccess(ac), Synthesized(synthesized) {} public: @@ -767,7 +779,7 @@ private: QualType T, Expr *BW) : FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc, Id, T, /*TInfo=*/0, // FIXME: Do ObjCAtDefs have declarators ? - BW, /*Mutable=*/false) {} + BW, /*Mutable=*/false, /*HasInit=*/false) {} public: static ObjCAtDefsFieldDecl *Create(ASTContext &C, DeclContext *DC, diff --git a/include/clang/AST/DeclTemplate.h b/include/clang/AST/DeclTemplate.h index ddbe344cdffd..dc50d614bf7c 100644 --- a/include/clang/AST/DeclTemplate.h +++ b/include/clang/AST/DeclTemplate.h @@ -30,6 +30,7 @@ class ClassTemplatePartialSpecializationDecl; class TemplateTypeParmDecl; class NonTypeTemplateParmDecl; class TemplateTemplateParmDecl; +class TypeAliasTemplateDecl; /// \brief Stores a template parameter of any kind. typedef llvm::PointerUnion3= firstTemplate && K <= lastTemplate; } @@ -672,6 +674,7 @@ public: static bool classof(const RedeclarableTemplateDecl *D) { return true; } static bool classof(const FunctionTemplateDecl *D) { return true; } static bool classof(const ClassTemplateDecl *D) { return true; } + static bool classof(const TypeAliasTemplateDecl *D) { return true; } static bool classofKind(Kind K) { return K >= firstRedeclarableTemplate && K <= lastRedeclarableTemplate; } @@ -2014,6 +2017,78 @@ public: friend class ASTDeclReader; }; +/// Declaration of an alias template. For example: +/// +/// template using V = std::map>; +class TypeAliasTemplateDecl : public RedeclarableTemplateDecl, + public RedeclarableTemplate { + static void DeallocateCommon(void *Ptr); + +protected: + typedef RedeclarableTemplate redeclarable_base; + + typedef CommonBase Common; + + TypeAliasTemplateDecl(DeclContext *DC, SourceLocation L, DeclarationName Name, + TemplateParameterList *Params, NamedDecl *Decl) + : RedeclarableTemplateDecl(TypeAliasTemplate, DC, L, Name, Params, Decl) { } + + CommonBase *newCommon(ASTContext &C); + + Common *getCommonPtr() { + return static_cast(RedeclarableTemplateDecl::getCommonPtr()); + } + +public: + /// Get the underlying function declaration of the template. + TypeAliasDecl *getTemplatedDecl() const { + return static_cast(TemplatedDecl); + } + + + TypeAliasTemplateDecl *getCanonicalDecl() { + return redeclarable_base::getCanonicalDecl(); + } + const TypeAliasTemplateDecl *getCanonicalDecl() const { + return redeclarable_base::getCanonicalDecl(); + } + + /// \brief Retrieve the previous declaration of this function template, or + /// NULL if no such declaration exists. + TypeAliasTemplateDecl *getPreviousDeclaration() { + return redeclarable_base::getPreviousDeclaration(); + } + + /// \brief Retrieve the previous declaration of this function template, or + /// NULL if no such declaration exists. + const TypeAliasTemplateDecl *getPreviousDeclaration() const { + return redeclarable_base::getPreviousDeclaration(); + } + + TypeAliasTemplateDecl *getInstantiatedFromMemberTemplate() { + return redeclarable_base::getInstantiatedFromMemberTemplate(); + } + + + /// \brief Create a function template node. + static TypeAliasTemplateDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, + DeclarationName Name, + TemplateParameterList *Params, + NamedDecl *Decl); + + /// \brief Create an empty alias template node. + static TypeAliasTemplateDecl *Create(ASTContext &C, EmptyShell); + + // Implement isa/cast/dyncast support + static bool classof(const Decl *D) { return classofKind(D->getKind()); } + static bool classof(const TypeAliasTemplateDecl *D) { return true; } + static bool classofKind(Kind K) { return K == TypeAliasTemplate; } + + friend class ASTDeclReader; + friend class ASTDeclWriter; +}; + /// Implementation of inline functions that require the template declarations inline AnyFunctionDecl::AnyFunctionDecl(FunctionTemplateDecl *FTD) : Function(FTD) { } diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index 5f2d144eb544..ce86458ed4f4 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -515,6 +515,14 @@ public: /// ParenExpr or ImplicitCastExprs, returning their operand. Expr *IgnoreParenImpCasts(); + /// IgnoreConversionOperator - Ignore conversion operator. If this Expr is a + /// call to a conversion operator, return the argument. + Expr *IgnoreConversionOperator(); + + const Expr *IgnoreConversionOperator() const { + return const_cast(this)->IgnoreConversionOperator(); + } + const Expr *IgnoreParenImpCasts() const { return const_cast(this)->IgnoreParenImpCasts(); } @@ -1018,13 +1026,18 @@ public: false), Loc(l) { assert(type->isIntegerType() && "Illegal type in IntegerLiteral"); + assert(V.getBitWidth() == C.getIntWidth(type) && + "Integer type is not the correct size for constant."); setValue(C, V); } - // type should be IntTy, LongTy, LongLongTy, UnsignedIntTy, UnsignedLongTy, - // or UnsignedLongLongTy + /// \brief Returns a new integer literal with value 'V' and type 'type'. + /// \param type - either IntTy, LongTy, LongLongTy, UnsignedIntTy, + /// UnsignedLongTy, or UnsignedLongLongTy which should match the size of V + /// \param V - the value that the returned integer literal contains. static IntegerLiteral *Create(ASTContext &C, const llvm::APInt &V, QualType type, SourceLocation l); + /// \brief Returns a new empty integer literal. static IntegerLiteral *Create(ASTContext &C, EmptyShell Empty); llvm::APInt getValue() const { return Num.getValue(); } @@ -1555,9 +1568,9 @@ public: TSInfo = tsi; } - const OffsetOfNode &getComponent(unsigned Idx) { + const OffsetOfNode &getComponent(unsigned Idx) const { assert(Idx < NumComps && "Subscript out of range"); - return reinterpret_cast (this + 1)[Idx]; + return reinterpret_cast (this + 1)[Idx]; } void setComponent(unsigned Idx, OffsetOfNode ON) { @@ -1574,6 +1587,9 @@ public: return reinterpret_cast( reinterpret_cast(this+1) + NumComps)[Idx]; } + const Expr *getIndexExpr(unsigned Idx) const { + return const_cast(this)->getIndexExpr(Idx); + } void setIndexExpr(unsigned Idx, Expr* E) { assert(Idx < NumComps && "Subscript out of range"); @@ -3299,6 +3315,9 @@ public: Expr *getArrayFiller() { return ArrayFillerOrUnionFieldInit.dyn_cast(); } + const Expr *getArrayFiller() const { + return const_cast(this)->getArrayFiller(); + } void setArrayFiller(Expr *filler); /// \brief If this initializes a union, specifies which field in the @@ -3310,6 +3329,9 @@ public: FieldDecl *getInitializedFieldInUnion() { return ArrayFillerOrUnionFieldInit.dyn_cast(); } + const FieldDecl *getInitializedFieldInUnion() const { + return const_cast(this)->getInitializedFieldInUnion(); + } void setInitializedFieldInUnion(FieldDecl *FD) { ArrayFillerOrUnionFieldInit = FD; } @@ -4012,6 +4034,42 @@ public: child_range children() { return child_range(); } }; +/// AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] +/// This AST node provides support for reinterpreting a type to another +/// type of the same size. +class AsTypeExpr : public Expr { +private: + Expr* SrcExpr; + QualType DstType; + SourceLocation BuiltinLoc, RParenLoc; + +public: + AsTypeExpr(Expr* SrcExpr, QualType DstType, + ExprValueKind VK, ExprObjectKind OK, + SourceLocation BuiltinLoc, SourceLocation RParenLoc) + : Expr(AsTypeExprClass, DstType, VK, OK, false, false, false), + SrcExpr(SrcExpr), DstType(DstType), + BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {} + + /// \brief Build an empty __builtin_astype + explicit AsTypeExpr(EmptyShell Empty) : Expr(AsTypeExprClass, Empty) {} + + /// getSrcExpr - Return the Expr to be converted. + Expr *getSrcExpr() const { return SrcExpr; } + QualType getDstType() const { return DstType; } + + SourceRange getSourceRange() const { + return SourceRange(BuiltinLoc, RParenLoc); + } + + static bool classof(const Stmt *T) { + return T->getStmtClass() == AsTypeExprClass; + } + static bool classof(const AsTypeExpr *) { return true; } + + // Iterators + child_range children() { return child_range(); } +}; } // end namespace clang #endif diff --git a/include/clang/AST/ExternalASTSource.h b/include/clang/AST/ExternalASTSource.h index 6db233641220..846813adf7c3 100644 --- a/include/clang/AST/ExternalASTSource.h +++ b/include/clang/AST/ExternalASTSource.h @@ -211,7 +211,7 @@ public: return sizes; } - virtual void getMemoryBufferSizes(MemoryBufferSizes &sizes) const = 0; + virtual void getMemoryBufferSizes(MemoryBufferSizes &sizes) const; protected: static DeclContextLookupResult diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index 930d19373cdc..a8f182a5bc92 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -750,6 +750,11 @@ DEF_TRAVERSE_TYPE(DecltypeType, { TRY_TO(TraverseStmt(T->getUnderlyingExpr())); }) +DEF_TRAVERSE_TYPE(UnaryTransformType, { + TRY_TO(TraverseType(T->getBaseType())); + TRY_TO(TraverseType(T->getUnderlyingType())); + }) + DEF_TRAVERSE_TYPE(AutoType, { TRY_TO(TraverseType(T->getDeducedType())); }) @@ -966,6 +971,10 @@ DEF_TRAVERSE_TYPELOC(DecltypeType, { TRY_TO(TraverseStmt(TL.getTypePtr()->getUnderlyingExpr())); }) +DEF_TRAVERSE_TYPELOC(UnaryTransformType, { + TRY_TO(TraverseTypeLoc(TL.getUnderlyingTInfo()->getTypeLoc())); + }) + DEF_TRAVERSE_TYPELOC(AutoType, { TRY_TO(TraverseType(TL.getTypePtr()->getDeducedType())); }) @@ -1368,6 +1377,11 @@ DEF_TRAVERSE_DECL(TypeAliasDecl, { // source. }) +DEF_TRAVERSE_DECL(TypeAliasTemplateDecl, { + TRY_TO(TraverseDecl(D->getTemplatedDecl())); + TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters())); + }) + DEF_TRAVERSE_DECL(UnresolvedUsingTypenameDecl, { // A dependent using declaration which was marked with 'typename'. // template class A : public B { using typename B::foo; }; @@ -1967,6 +1981,9 @@ DEF_TRAVERSE_STMT(FloatingLiteral, { }) DEF_TRAVERSE_STMT(ImaginaryLiteral, { }) DEF_TRAVERSE_STMT(StringLiteral, { }) DEF_TRAVERSE_STMT(ObjCStringLiteral, { }) + +// Traverse OpenCL: AsType, Convert. +DEF_TRAVERSE_STMT(AsTypeExpr, { }) // FIXME: look at the following tricky-seeming exprs to see if we // need to recurse on anything. These are ones that have methods diff --git a/include/clang/AST/StmtVisitor.h b/include/clang/AST/StmtVisitor.h index b8c141d7ef8e..29d234754645 100644 --- a/include/clang/AST/StmtVisitor.h +++ b/include/clang/AST/StmtVisitor.h @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file defines the StmtVisitor interface. +// This file defines the StmtVisitor and ConstStmtVisitor interfaces. // //===----------------------------------------------------------------------===// @@ -21,20 +21,26 @@ namespace clang { -#define DISPATCH(NAME, CLASS) \ - return static_cast(this)->Visit ## NAME(static_cast(S)) +template struct make_ptr { typedef T *type; }; +template struct make_const_ptr { typedef const T *type; }; -/// StmtVisitor - This class implements a simple visitor for Stmt subclasses. -/// Since Expr derives from Stmt, this also includes support for visiting Exprs. -template -class StmtVisitor { +/// StmtVisitorBase - This class implements a simple visitor for Stmt +/// subclasses. Since Expr derives from Stmt, this also includes support for +/// visiting Exprs. +template