aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2009-10-14 18:03:49 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2009-10-14 18:03:49 +0000
commit4c8b24812ddcd1dedaca343a6d4e76f91f398981 (patch)
tree137ebebcae16fb0ce7ab4af456992bbd8d22fced
parent5362a71c02e7d448a8ce98cf00c47e353fba5d04 (diff)
downloadsrc-4c8b24812ddcd1dedaca343a6d4e76f91f398981.tar.gz
src-4c8b24812ddcd1dedaca343a6d4e76f91f398981.zip
Update clang to r84119.vendor/clang/clang-r84119
Notes
Notes: svn path=/vendor/clang/dist/; revision=198092 svn path=/vendor/clang/clang-84119/; revision=198093; tag=vendor/clang/clang-r84119
-rw-r--r--CMakeLists.txt47
-rw-r--r--INPUTS/all-std-headers.cpp51
-rw-r--r--INSTALL.txt49
-rw-r--r--LICENSE.TXT2
-rw-r--r--Makefile29
-rw-r--r--NOTES.txt4
-rw-r--r--README.txt186
-rw-r--r--VER1
-rw-r--r--clang.xcodeproj/project.pbxproj268
-rw-r--r--docs/DriverInternals.html18
-rw-r--r--docs/InternalsManual.html7
-rw-r--r--docs/LanguageExtensions.html44
-rw-r--r--docs/UsersManual.html109
-rw-r--r--docs/libIndex.html267
-rw-r--r--docs/tools/Makefile5
-rw-r--r--docs/tools/clang.pod48
-rw-r--r--include/clang-c/Index.h220
-rw-r--r--include/clang/AST/APValue.h97
-rw-r--r--include/clang/AST/ASTConsumer.h12
-rw-r--r--include/clang/AST/ASTContext.h575
-rw-r--r--include/clang/AST/ASTDiagnostic.h2
-rw-r--r--include/clang/AST/Attr.h130
-rw-r--r--include/clang/AST/CXXInheritance.h212
-rw-r--r--include/clang/AST/CanonicalType.h721
-rw-r--r--include/clang/AST/Decl.h765
-rw-r--r--include/clang/AST/DeclBase.h272
-rw-r--r--include/clang/AST/DeclCXX.h1089
-rw-r--r--include/clang/AST/DeclContextInternals.h30
-rw-r--r--include/clang/AST/DeclGroup.h38
-rw-r--r--include/clang/AST/DeclNodes.def43
-rw-r--r--include/clang/AST/DeclObjC.h570
-rw-r--r--include/clang/AST/DeclTemplate.h724
-rw-r--r--include/clang/AST/DeclarationName.h58
-rw-r--r--include/clang/AST/Expr.h1021
-rw-r--r--include/clang/AST/ExprCXX.h625
-rw-r--r--include/clang/AST/ExprObjC.h286
-rw-r--r--include/clang/AST/ExternalASTSource.h8
-rw-r--r--include/clang/AST/NestedNameSpecifier.h46
-rw-r--r--include/clang/AST/ParentMap.h10
-rw-r--r--include/clang/AST/PrettyPrinter.h26
-rw-r--r--include/clang/AST/RecordLayout.h180
-rw-r--r--include/clang/AST/Redeclarable.h162
-rw-r--r--include/clang/AST/Stmt.h484
-rw-r--r--include/clang/AST/StmtCXX.h5
-rw-r--r--include/clang/AST/StmtGraphTraits.h28
-rw-r--r--include/clang/AST/StmtIterator.h64
-rw-r--r--include/clang/AST/StmtNodes.def14
-rw-r--r--include/clang/AST/StmtObjC.h190
-rw-r--r--include/clang/AST/StmtVisitor.h20
-rw-r--r--include/clang/AST/TemplateName.h70
-rw-r--r--include/clang/AST/Type.h1871
-rw-r--r--include/clang/AST/TypeLoc.h538
-rw-r--r--include/clang/AST/TypeLocNodes.def55
-rw-r--r--include/clang/AST/TypeLocVisitor.h58
-rw-r--r--include/clang/AST/TypeNodes.def23
-rw-r--r--include/clang/AST/TypeOrdering.h6
-rw-r--r--include/clang/AST/TypeVisitor.h12
-rw-r--r--include/clang/Analysis/Analyses/LiveVariables.h42
-rw-r--r--include/clang/Analysis/Analyses/UninitializedValues.h24
-rw-r--r--include/clang/Analysis/AnalysisDiagnostic.h2
-rw-r--r--include/clang/Analysis/CFG.h451
-rw-r--r--include/clang/Analysis/CallGraph.h147
-rw-r--r--include/clang/Analysis/FlowSensitive/DataflowSolver.h129
-rw-r--r--include/clang/Analysis/FlowSensitive/DataflowValues.h58
-rw-r--r--include/clang/Analysis/LocalCheckers.h32
-rw-r--r--include/clang/Analysis/PathDiagnostic.h232
-rw-r--r--include/clang/Analysis/PathSensitive/AnalysisContext.h167
-rw-r--r--include/clang/Analysis/PathSensitive/AnalysisManager.h140
-rw-r--r--include/clang/Analysis/PathSensitive/BasicValueFactory.h91
-rw-r--r--include/clang/Analysis/PathSensitive/BugReporter.h287
-rw-r--r--include/clang/Analysis/PathSensitive/Checker.h122
-rw-r--r--include/clang/Analysis/PathSensitive/CheckerVisitor.def18
-rw-r--r--include/clang/Analysis/PathSensitive/CheckerVisitor.h59
-rw-r--r--include/clang/Analysis/PathSensitive/ConstraintManager.h18
-rw-r--r--include/clang/Analysis/PathSensitive/Environment.h111
-rw-r--r--include/clang/Analysis/PathSensitive/ExplodedGraph.h594
-rw-r--r--include/clang/Analysis/PathSensitive/GRAuditor.h20
-rw-r--r--include/clang/Analysis/PathSensitive/GRBlockCounter.h16
-rw-r--r--include/clang/Analysis/PathSensitive/GRCoreEngine.h770
-rw-r--r--include/clang/Analysis/PathSensitive/GRExprEngine.h567
-rw-r--r--include/clang/Analysis/PathSensitive/GRExprEngineBuilders.h55
-rw-r--r--include/clang/Analysis/PathSensitive/GRSimpleAPICheck.h10
-rw-r--r--include/clang/Analysis/PathSensitive/GRState.h450
-rw-r--r--include/clang/Analysis/PathSensitive/GRStateTrait.h82
-rw-r--r--include/clang/Analysis/PathSensitive/GRSubEngine.h68
-rw-r--r--include/clang/Analysis/PathSensitive/GRTransferFuncs.h60
-rw-r--r--include/clang/Analysis/PathSensitive/GRWorkList.h36
-rw-r--r--include/clang/Analysis/PathSensitive/MemRegion.h496
-rw-r--r--include/clang/Analysis/PathSensitive/SVals.h259
-rw-r--r--include/clang/Analysis/PathSensitive/SValuator.h54
-rw-r--r--include/clang/Analysis/PathSensitive/Store.h122
-rw-r--r--include/clang/Analysis/PathSensitive/SymbolManager.h179
-rw-r--r--include/clang/Analysis/PathSensitive/ValueManager.h108
-rw-r--r--include/clang/Analysis/ProgramPoint.h321
-rw-r--r--include/clang/Analysis/Support/BlkExprDeclBitVector.h128
-rw-r--r--include/clang/Analysis/Support/BumpVector.h215
-rw-r--r--include/clang/Analysis/Support/Optional.h55
-rw-r--r--include/clang/Analysis/Support/SaveAndRestore.h44
-rw-r--r--include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h14
-rw-r--r--include/clang/Analysis/Visitors/CFGRecStmtVisitor.h4
-rw-r--r--include/clang/Analysis/Visitors/CFGStmtVisitor.h62
-rw-r--r--include/clang/Analysis/Visitors/CFGVarDeclVisitor.h21
-rw-r--r--include/clang/Basic/Builtins.def173
-rw-r--r--include/clang/Basic/Builtins.h23
-rw-r--r--include/clang/Basic/ConvertUTF.h82
-rw-r--r--include/clang/Basic/Diagnostic.h194
-rw-r--r--include/clang/Basic/DiagnosticCommonKinds.td3
-rw-r--r--include/clang/Basic/DiagnosticDriverKinds.td10
-rw-r--r--include/clang/Basic/DiagnosticFrontendKinds.td22
-rw-r--r--include/clang/Basic/DiagnosticGroups.td21
-rw-r--r--include/clang/Basic/DiagnosticLexKinds.td12
-rw-r--r--include/clang/Basic/DiagnosticParseKinds.td17
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td483
-rw-r--r--include/clang/Basic/FileManager.h46
-rw-r--r--include/clang/Basic/IdentifierTable.h127
-rw-r--r--include/clang/Basic/LangOptions.h46
-rw-r--r--include/clang/Basic/Makefile4
-rw-r--r--include/clang/Basic/OnDiskHashTable.h88
-rw-r--r--include/clang/Basic/PartialDiagnostic.h155
-rw-r--r--include/clang/Basic/SourceLocation.h90
-rw-r--r--include/clang/Basic/SourceManager.h242
-rw-r--r--include/clang/Basic/SourceManagerInternals.h24
-rw-r--r--include/clang/Basic/TargetInfo.h176
-rw-r--r--include/clang/Basic/TokenKinds.def1
-rw-r--r--include/clang/Basic/TokenKinds.h2
-rw-r--r--include/clang/Basic/Version.h30
-rw-r--r--include/clang/CodeGen/ModuleBuilder.h6
-rw-r--r--include/clang/Driver/Action.h38
-rw-r--r--include/clang/Driver/Arg.h46
-rw-r--r--include/clang/Driver/ArgList.h55
-rw-r--r--include/clang/Driver/Compilation.h18
-rw-r--r--include/clang/Driver/Driver.h37
-rw-r--r--include/clang/Driver/DriverDiagnostic.h2
-rw-r--r--include/clang/Driver/HostInfo.h55
-rw-r--r--include/clang/Driver/Job.h22
-rw-r--r--include/clang/Driver/Option.h88
-rw-r--r--include/clang/Driver/Options.def23
-rw-r--r--include/clang/Driver/Options.h4
-rw-r--r--include/clang/Driver/Tool.h8
-rw-r--r--include/clang/Driver/ToolChain.h15
-rw-r--r--include/clang/Driver/Types.def5
-rw-r--r--include/clang/Frontend/ASTConsumers.h24
-rw-r--r--include/clang/Frontend/ASTUnit.h39
-rw-r--r--include/clang/Frontend/Analyses.def9
-rw-r--r--include/clang/Frontend/CommandLineSourceLoc.h29
-rw-r--r--include/clang/Frontend/CompileOptions.h2
-rw-r--r--include/clang/Frontend/DeclXML.def8
-rw-r--r--include/clang/Frontend/DocumentXML.h60
-rw-r--r--include/clang/Frontend/FixItRewriter.h4
-rw-r--r--include/clang/Frontend/FrontendDiagnostic.h2
-rw-r--r--include/clang/Frontend/InitHeaderSearch.h22
-rw-r--r--include/clang/Frontend/ManagerRegistry.h2
-rw-r--r--include/clang/Frontend/PCHBitCodes.h93
-rw-r--r--include/clang/Frontend/PCHReader.h155
-rw-r--r--include/clang/Frontend/PCHWriter.h69
-rw-r--r--include/clang/Frontend/PathDiagnosticClients.h36
-rw-r--r--include/clang/Frontend/StmtXML.def3
-rw-r--r--include/clang/Frontend/TextDiagnosticPrinter.h8
-rw-r--r--include/clang/Frontend/TypeXML.def21
-rw-r--r--include/clang/Frontend/Utils.h31
-rw-r--r--include/clang/Index/ASTLocation.h174
-rw-r--r--include/clang/Index/Analyzer.h56
-rw-r--r--include/clang/Index/DeclReferenceMap.h50
-rw-r--r--include/clang/Index/Entity.h143
-rw-r--r--include/clang/Index/GlobalSelector.h99
-rw-r--r--include/clang/Index/Handlers.h81
-rw-r--r--include/clang/Index/IndexProvider.h38
-rw-r--r--include/clang/Index/Indexer.h75
-rw-r--r--include/clang/Index/Program.h45
-rw-r--r--include/clang/Index/STLExtras.h63
-rw-r--r--include/clang/Index/SelectorMap.h57
-rw-r--r--include/clang/Index/TranslationUnit.h37
-rw-r--r--include/clang/Index/Utils.h35
-rw-r--r--include/clang/Lex/DirectoryLookup.h40
-rw-r--r--include/clang/Lex/HeaderMap.h14
-rw-r--r--include/clang/Lex/HeaderSearch.h50
-rw-r--r--include/clang/Lex/LexDiagnostic.h2
-rw-r--r--include/clang/Lex/Lexer.h100
-rw-r--r--include/clang/Lex/LiteralSupport.h46
-rw-r--r--include/clang/Lex/MacroInfo.h54
-rw-r--r--include/clang/Lex/MultipleIncludeOpt.h22
-rw-r--r--include/clang/Lex/PPCallbacks.h28
-rw-r--r--include/clang/Lex/PTHLexer.h32
-rw-r--r--include/clang/Lex/PTHManager.h44
-rw-r--r--include/clang/Lex/Pragma.h14
-rw-r--r--include/clang/Lex/Preprocessor.h201
-rw-r--r--include/clang/Lex/PreprocessorLexer.h58
-rw-r--r--include/clang/Lex/ScratchBuffer.h4
-rw-r--r--include/clang/Lex/Token.h70
-rw-r--r--include/clang/Lex/TokenConcatenation.h16
-rw-r--r--include/clang/Lex/TokenLexer.h40
-rw-r--r--include/clang/Parse/Action.h909
-rw-r--r--include/clang/Parse/AttributeList.h55
-rw-r--r--include/clang/Parse/DeclSpec.h338
-rw-r--r--include/clang/Parse/Designator.h44
-rw-r--r--include/clang/Parse/Ownership.h68
-rw-r--r--include/clang/Parse/ParseDiagnostic.h2
-rw-r--r--include/clang/Parse/Parser.h290
-rw-r--r--include/clang/Parse/Scope.h46
-rw-r--r--include/clang/Rewrite/DeltaTree.h8
-rw-r--r--include/clang/Rewrite/HTMLRewrite.h20
-rw-r--r--include/clang/Rewrite/RewriteRope.h62
-rw-r--r--include/clang/Rewrite/Rewriter.h111
-rw-r--r--include/clang/Rewrite/TokenRewriter.h24
-rw-r--r--include/clang/Sema/CodeCompleteConsumer.h332
-rw-r--r--include/clang/Sema/ExternalSemaSource.h8
-rw-r--r--include/clang/Sema/ParseAST.h10
-rw-r--r--include/clang/Sema/SemaConsumer.h4
-rw-r--r--include/clang/Sema/SemaDiagnostic.h2
-rw-r--r--lib/AST/APValue.cpp16
-rw-r--r--lib/AST/ASTContext.cpp2766
-rw-r--r--lib/AST/CMakeLists.txt11
-rw-r--r--lib/AST/CXXInheritance.cpp244
-rw-r--r--lib/AST/Decl.cpp509
-rw-r--r--lib/AST/DeclBase.cpp164
-rw-r--r--lib/AST/DeclCXX.cpp610
-rw-r--r--lib/AST/DeclObjC.cpp440
-rw-r--r--lib/AST/DeclPrinter.cpp244
-rw-r--r--lib/AST/DeclTemplate.cpp206
-rw-r--r--lib/AST/DeclarationName.cpp44
-rw-r--r--lib/AST/Expr.cpp797
-rw-r--r--lib/AST/ExprCXX.cpp274
-rw-r--r--lib/AST/ExprConstant.cpp284
-rw-r--r--lib/AST/InheritViz.cpp10
-rw-r--r--lib/AST/NestedNameSpecifier.cpp61
-rw-r--r--lib/AST/ParentMap.cpp10
-rw-r--r--lib/AST/RecordLayoutBuilder.cpp674
-rw-r--r--lib/AST/RecordLayoutBuilder.h146
-rw-r--r--lib/AST/Stmt.cpp80
-rw-r--r--lib/AST/StmtDumper.cpp143
-rw-r--r--lib/AST/StmtIterator.cpp40
-rw-r--r--lib/AST/StmtPrinter.cpp191
-rw-r--r--lib/AST/StmtProfile.cpp720
-rw-r--r--lib/AST/StmtViz.cpp17
-rw-r--r--lib/AST/TemplateName.cpp42
-rw-r--r--lib/AST/Type.cpp987
-rw-r--r--lib/AST/TypeLoc.cpp370
-rw-r--r--lib/Analysis/AnalysisContext.cpp138
-rw-r--r--lib/Analysis/AnalysisManager.cpp35
-rw-r--r--lib/Analysis/BasicConstraintManager.cpp62
-rw-r--r--lib/Analysis/BasicObjCFoundationChecks.cpp329
-rw-r--r--lib/Analysis/BasicObjCFoundationChecks.h21
-rw-r--r--lib/Analysis/BasicStore.cpp380
-rw-r--r--lib/Analysis/BasicValueFactory.cpp138
-rw-r--r--lib/Analysis/BugReporter.cpp994
-rw-r--r--lib/Analysis/BugReporterVisitors.cpp349
-rw-r--r--lib/Analysis/CFG.cpp2084
-rw-r--r--lib/Analysis/CFRefCount.cpp1882
-rw-r--r--lib/Analysis/CMakeLists.txt10
-rw-r--r--lib/Analysis/CallGraph.cpp150
-rw-r--r--lib/Analysis/CallInliner.cpp75
-rw-r--r--lib/Analysis/CheckDeadStores.cpp99
-rw-r--r--lib/Analysis/CheckNSError.cpp166
-rw-r--r--lib/Analysis/CheckObjCDealloc.cpp134
-rw-r--r--lib/Analysis/CheckObjCInstMethSignature.cpp47
-rw-r--r--lib/Analysis/CheckObjCUnusedIVars.cpp64
-rw-r--r--lib/Analysis/CheckSecuritySyntaxOnly.cpp409
-rw-r--r--lib/Analysis/Environment.cpp141
-rw-r--r--lib/Analysis/ExplodedGraph.cpp200
-rw-r--r--lib/Analysis/GRBlockCounter.cpp2
-rw-r--r--lib/Analysis/GRCoreEngine.cpp439
-rw-r--r--lib/Analysis/GRExprEngine.cpp2541
-rw-r--r--lib/Analysis/GRExprEngineInternalChecks.cpp844
-rw-r--r--lib/Analysis/GRState.cpp158
-rw-r--r--lib/Analysis/LiveVariables.cpp122
-rw-r--r--lib/Analysis/MemRegion.cpp212
-rw-r--r--lib/Analysis/PathDiagnostic.cpp96
-rw-r--r--lib/Analysis/RangeConstraintManager.cpp60
-rw-r--r--lib/Analysis/RegionStore.cpp1809
-rw-r--r--lib/Analysis/SVals.cpp163
-rw-r--r--lib/Analysis/SValuator.cpp160
-rw-r--r--lib/Analysis/SimpleConstraintManager.cpp64
-rw-r--r--lib/Analysis/SimpleConstraintManager.h24
-rw-r--r--lib/Analysis/SimpleSValuator.cpp158
-rw-r--r--lib/Analysis/Store.cpp246
-rw-r--r--lib/Analysis/SymbolManager.cpp139
-rw-r--r--lib/Analysis/UninitializedValues.cpp84
-rw-r--r--lib/Analysis/ValueManager.cpp114
-rw-r--r--lib/Basic/Builtins.cpp18
-rw-r--r--lib/Basic/CMakeLists.txt11
-rw-r--r--lib/Basic/ConvertUTF.c606
-rw-r--r--lib/Basic/Diagnostic.cpp121
-rw-r--r--lib/Basic/FileManager.cpp88
-rw-r--r--lib/Basic/IdentifierTable.cpp58
-rw-r--r--lib/Basic/Makefile11
-rw-r--r--lib/Basic/SourceLocation.cpp4
-rw-r--r--lib/Basic/SourceManager.cpp302
-rw-r--r--lib/Basic/TargetInfo.cpp57
-rw-r--r--lib/Basic/Targets.cpp1092
-rw-r--r--lib/Basic/Version.cpp49
-rw-r--r--lib/CMakeLists.txt1
-rw-r--r--lib/CodeGen/ABIInfo.h22
-rw-r--r--lib/CodeGen/CGBlocks.cpp196
-rw-r--r--lib/CodeGen/CGBlocks.h40
-rw-r--r--lib/CodeGen/CGBuiltin.cpp255
-rw-r--r--lib/CodeGen/CGCXX.cpp1639
-rw-r--r--lib/CodeGen/CGCXX.h2
-rw-r--r--lib/CodeGen/CGCXXClass.cpp176
-rw-r--r--lib/CodeGen/CGCXXExpr.cpp304
-rw-r--r--lib/CodeGen/CGCXXTemp.cpp102
-rw-r--r--lib/CodeGen/CGCall.cpp268
-rw-r--r--lib/CodeGen/CGCall.h33
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp686
-rw-r--r--lib/CodeGen/CGDebugInfo.h56
-rw-r--r--lib/CodeGen/CGDecl.cpp291
-rw-r--r--lib/CodeGen/CGExpr.cpp889
-rw-r--r--lib/CodeGen/CGExprAgg.cpp251
-rw-r--r--lib/CodeGen/CGExprComplex.cpp177
-rw-r--r--lib/CodeGen/CGExprConstant.cpp868
-rw-r--r--lib/CodeGen/CGExprScalar.cpp684
-rw-r--r--lib/CodeGen/CGObjC.cpp259
-rw-r--r--lib/CodeGen/CGObjCGNU.cpp999
-rw-r--r--lib/CodeGen/CGObjCMac.cpp2817
-rw-r--r--lib/CodeGen/CGObjCRuntime.h49
-rw-r--r--lib/CodeGen/CGRecordLayoutBuilder.cpp386
-rw-r--r--lib/CodeGen/CGRecordLayoutBuilder.h134
-rw-r--r--lib/CodeGen/CGRtti.cpp47
-rw-r--r--lib/CodeGen/CGStmt.cpp330
-rw-r--r--lib/CodeGen/CGValue.h124
-rw-r--r--lib/CodeGen/CGVtable.cpp557
-rw-r--r--lib/CodeGen/CGVtable.h61
-rw-r--r--lib/CodeGen/CMakeLists.txt11
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp437
-rw-r--r--lib/CodeGen/CodeGenFunction.h291
-rw-r--r--lib/CodeGen/CodeGenModule.cpp846
-rw-r--r--lib/CodeGen/CodeGenModule.h132
-rw-r--r--lib/CodeGen/CodeGenTypes.cpp376
-rw-r--r--lib/CodeGen/CodeGenTypes.h124
-rw-r--r--lib/CodeGen/Makefile3
-rw-r--r--lib/CodeGen/Mangle.cpp1098
-rw-r--r--lib/CodeGen/Mangle.h48
-rw-r--r--lib/CodeGen/ModuleBuilder.cpp16
-rw-r--r--lib/CodeGen/README.txt18
-rw-r--r--lib/CodeGen/TargetABIInfo.cpp647
-rw-r--r--lib/Driver/Action.cpp12
-rw-r--r--lib/Driver/Arg.cpp23
-rw-r--r--lib/Driver/ArgList.cpp54
-rw-r--r--lib/Driver/Compilation.cpp46
-rw-r--r--lib/Driver/Driver.cpp580
-rw-r--r--lib/Driver/HostInfo.cpp257
-rw-r--r--lib/Driver/Job.cpp6
-rw-r--r--lib/Driver/Makefile16
-rw-r--r--lib/Driver/OptTable.cpp18
-rw-r--r--lib/Driver/Option.cpp57
-rw-r--r--lib/Driver/Tool.cpp2
-rw-r--r--lib/Driver/ToolChain.cpp12
-rw-r--r--lib/Driver/ToolChains.cpp392
-rw-r--r--lib/Driver/ToolChains.h138
-rw-r--r--lib/Driver/Tools.cpp1082
-rw-r--r--lib/Driver/Tools.h174
-rw-r--r--lib/Driver/Types.cpp48
-rw-r--r--lib/Frontend/ASTConsumers.cpp209
-rw-r--r--lib/Frontend/ASTUnit.cpp63
-rw-r--r--lib/Frontend/AnalysisConsumer.cpp536
-rw-r--r--lib/Frontend/Backend.cpp85
-rw-r--r--lib/Frontend/CMakeLists.txt11
-rw-r--r--lib/Frontend/CacheTokens.cpp189
-rw-r--r--lib/Frontend/DeclXML.cpp74
-rw-r--r--lib/Frontend/DependencyFile.cpp16
-rw-r--r--lib/Frontend/DiagChecker.cpp32
-rw-r--r--lib/Frontend/DocumentXML.cpp157
-rw-r--r--lib/Frontend/FixItRewriter.cpp44
-rw-r--r--lib/Frontend/GeneratePCH.cpp21
-rw-r--r--lib/Frontend/HTMLDiagnostics.cpp371
-rw-r--r--lib/Frontend/HTMLPrint.cpp10
-rw-r--r--lib/Frontend/InitHeaderSearch.cpp459
-rw-r--r--lib/Frontend/InitPreprocessor.cpp111
-rw-r--r--lib/Frontend/PCHReader.cpp612
-rw-r--r--lib/Frontend/PCHReaderDecl.cpp174
-rw-r--r--lib/Frontend/PCHReaderStmt.cpp127
-rw-r--r--lib/Frontend/PCHWriter.cpp547
-rw-r--r--lib/Frontend/PCHWriterDecl.cpp221
-rw-r--r--lib/Frontend/PCHWriterStmt.cpp101
-rw-r--r--lib/Frontend/PlistDiagnostics.cpp148
-rw-r--r--lib/Frontend/PrintParserCallbacks.cpp85
-rw-r--r--lib/Frontend/PrintPreprocessedOutput.cpp96
-rw-r--r--lib/Frontend/RewriteBlocks.cpp311
-rw-r--r--lib/Frontend/RewriteMacros.cpp49
-rw-r--r--lib/Frontend/RewriteObjC.cpp1306
-rw-r--r--lib/Frontend/RewriteTest.cpp4
-rw-r--r--lib/Frontend/StmtXML.cpp78
-rw-r--r--lib/Frontend/TextDiagnosticBuffer.cpp2
-rw-r--r--lib/Frontend/TextDiagnosticPrinter.cpp138
-rw-r--r--lib/Frontend/TypeXML.cpp72
-rw-r--r--lib/Frontend/Warnings.cpp16
-rw-r--r--lib/Headers/CMakeLists.txt7
-rw-r--r--lib/Headers/Makefile8
-rw-r--r--lib/Headers/emmintrin.h34
-rw-r--r--lib/Headers/mmintrin.h12
-rw-r--r--lib/Headers/stdarg.h2
-rw-r--r--lib/Index/ASTLocation.cpp117
-rw-r--r--lib/Index/ASTVisitor.h144
-rw-r--r--lib/Index/Analyzer.cpp438
-rw-r--r--lib/Index/CMakeLists.txt15
-rw-r--r--lib/Index/DeclReferenceMap.cpp91
-rw-r--r--lib/Index/Entity.cpp225
-rw-r--r--lib/Index/EntityImpl.h70
-rw-r--r--lib/Index/GlobalSelector.cpp73
-rw-r--r--lib/Index/Handlers.cpp22
-rw-r--r--lib/Index/IndexProvider.cpp20
-rw-r--r--lib/Index/Indexer.cpp104
-rw-r--r--lib/Index/Makefile28
-rw-r--r--lib/Index/Program.cpp50
-rw-r--r--lib/Index/ProgramImpl.h56
-rw-r--r--lib/Index/ResolveLocation.cpp505
-rw-r--r--lib/Index/SelectorMap.cpp85
-rw-r--r--lib/Lex/CMakeLists.txt4
-rw-r--r--lib/Lex/HeaderMap.cpp44
-rw-r--r--lib/Lex/HeaderSearch.cpp112
-rw-r--r--lib/Lex/Lexer.cpp436
-rw-r--r--lib/Lex/LiteralSupport.cpp267
-rw-r--r--lib/Lex/MacroArgs.cpp34
-rw-r--r--lib/Lex/MacroArgs.h26
-rw-r--r--lib/Lex/MacroInfo.cpp12
-rw-r--r--lib/Lex/PPCaching.cpp5
-rw-r--r--lib/Lex/PPDirectives.cpp352
-rw-r--r--lib/Lex/PPExpressions.cpp100
-rw-r--r--lib/Lex/PPLexerChange.cpp68
-rw-r--r--lib/Lex/PPMacroExpansion.cpp169
-rw-r--r--lib/Lex/PTHLexer.cpp220
-rw-r--r--lib/Lex/Pragma.cpp170
-rw-r--r--lib/Lex/Preprocessor.cpp134
-rw-r--r--lib/Lex/PreprocessorLexer.cpp4
-rw-r--r--lib/Lex/ScratchBuffer.cpp10
-rw-r--r--lib/Lex/TokenConcatenation.cpp42
-rw-r--r--lib/Lex/TokenLexer.cpp120
-rwxr-xr-xlib/Makefile2
-rw-r--r--lib/Parse/AttributeList.cpp20
-rw-r--r--lib/Parse/CMakeLists.txt4
-rw-r--r--lib/Parse/DeclSpec.cpp186
-rw-r--r--lib/Parse/ExtensionRAIIObject.h2
-rw-r--r--lib/Parse/MinimalAction.cpp70
-rw-r--r--lib/Parse/ParseCXXInlineMethods.cpp44
-rw-r--r--lib/Parse/ParseDecl.cpp858
-rw-r--r--lib/Parse/ParseDeclCXX.cpp533
-rw-r--r--lib/Parse/ParseExpr.cpp255
-rw-r--r--lib/Parse/ParseExprCXX.cpp220
-rw-r--r--lib/Parse/ParseInit.cpp40
-rw-r--r--lib/Parse/ParseObjc.cpp301
-rw-r--r--lib/Parse/ParsePragma.cpp65
-rw-r--r--lib/Parse/ParsePragma.h18
-rw-r--r--lib/Parse/ParseStmt.cpp109
-rw-r--r--lib/Parse/ParseTemplate.cpp221
-rw-r--r--lib/Parse/ParseTentative.cpp24
-rw-r--r--lib/Parse/Parser.cpp137
-rw-r--r--lib/Rewrite/CMakeLists.txt2
-rw-r--r--lib/Rewrite/DeltaTree.cpp106
-rw-r--r--lib/Rewrite/HTMLRewrite.cpp227
-rw-r--r--lib/Rewrite/RewriteRope.cpp184
-rw-r--r--lib/Rewrite/Rewriter.cpp74
-rw-r--r--lib/Rewrite/TokenRewriter.cpp20
-rw-r--r--lib/Sema/CMakeLists.txt12
-rw-r--r--lib/Sema/CodeCompleteConsumer.cpp184
-rw-r--r--lib/Sema/IdentifierResolver.cpp18
-rw-r--r--lib/Sema/IdentifierResolver.h10
-rw-r--r--lib/Sema/JumpDiagnostics.cpp62
-rw-r--r--lib/Sema/ParseAST.cpp37
-rw-r--r--lib/Sema/Sema.cpp329
-rw-r--r--lib/Sema/Sema.h1874
-rw-r--r--lib/Sema/SemaAccess.cpp89
-rw-r--r--lib/Sema/SemaAttr.cpp84
-rw-r--r--lib/Sema/SemaCXXCast.cpp1128
-rw-r--r--lib/Sema/SemaCXXScopeSpec.cpp381
-rw-r--r--lib/Sema/SemaChecking.cpp530
-rw-r--r--lib/Sema/SemaCodeComplete.cpp1432
-rw-r--r--lib/Sema/SemaDecl.cpp2571
-rw-r--r--lib/Sema/SemaDeclAttr.cpp544
-rw-r--r--lib/Sema/SemaDeclCXX.cpp2665
-rw-r--r--lib/Sema/SemaDeclObjC.cpp832
-rw-r--r--lib/Sema/SemaExceptionSpec.cpp320
-rw-r--r--lib/Sema/SemaExpr.cpp2800
-rw-r--r--lib/Sema/SemaExprCXX.cpp1129
-rw-r--r--lib/Sema/SemaExprObjC.cpp446
-rw-r--r--lib/Sema/SemaInit.cpp462
-rw-r--r--lib/Sema/SemaLookup.cpp1482
-rw-r--r--lib/Sema/SemaOverload.cpp2271
-rw-r--r--lib/Sema/SemaOverload.h37
-rw-r--r--lib/Sema/SemaStmt.cpp405
-rw-r--r--lib/Sema/SemaTemplate.cpp2545
-rw-r--r--lib/Sema/SemaTemplate.h104
-rw-r--r--lib/Sema/SemaTemplateDeduction.cpp1857
-rw-r--r--lib/Sema/SemaTemplateInstantiate.cpp1238
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp1342
-rw-r--r--lib/Sema/SemaType.cpp797
-rw-r--r--lib/Sema/TreeTransform.h4829
-rw-r--r--test/Analysis/CFDateGC.m8
-rw-r--r--test/Analysis/CheckNSError.m4
-rw-r--r--test/Analysis/NSPanel.m2
-rw-r--r--test/Analysis/NSString.m15
-rw-r--r--test/Analysis/PR2978.m1
-rw-r--r--test/Analysis/PR3991.m1
-rw-r--r--test/Analysis/array-struct.c6
-rw-r--r--test/Analysis/casts.c19
-rw-r--r--test/Analysis/cfref_rdar6080742.c18
-rw-r--r--test/Analysis/complex.c2
-rw-r--r--test/Analysis/dead-stores.c171
-rw-r--r--test/Analysis/dead-stores.cpp19
-rw-r--r--test/Analysis/exercise-ps.c2
-rw-r--r--test/Analysis/misc-ps-basic-store.m14
-rw-r--r--test/Analysis/misc-ps-region-store-i386.m14
-rw-r--r--test/Analysis/misc-ps-region-store-x86_64.m14
-rw-r--r--test/Analysis/misc-ps-region-store.m243
-rw-r--r--test/Analysis/misc-ps.m410
-rw-r--r--test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m3
-rw-r--r--test/Analysis/no-outofbounds.c12
-rw-r--r--test/Analysis/null-deref-ps.c39
-rw-r--r--test/Analysis/outofbound.c1
-rw-r--r--test/Analysis/pr4209.m3
-rw-r--r--test/Analysis/rdar-6442306-1.m1
-rw-r--r--test/Analysis/rdar-6540084.m1
-rw-r--r--test/Analysis/rdar-6541136-region.c7
-rw-r--r--test/Analysis/rdar-6562655.m6
-rw-r--r--test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m3
-rw-r--r--test/Analysis/rdar-7168531.m19
-rw-r--r--test/Analysis/region-1.m1
-rw-r--r--test/Analysis/region-only-test.c2
-rw-r--r--test/Analysis/retain-release-gc-only.m186
-rw-r--r--test/Analysis/retain-release-region-store.m24
-rw-r--r--test/Analysis/retain-release.m439
-rw-r--r--test/Analysis/security-syntax-checks.m91
-rw-r--r--test/Analysis/uninit-vals-ps-region.c18
-rw-r--r--test/Analysis/uninit-vals-ps.c50
-rw-r--r--test/Analysis/uninit-vals.c2
-rw-r--r--test/Analysis/unions-region.m41
-rw-r--r--test/Analysis/unused-ivars.m45
-rw-r--r--test/CMakeLists.txt73
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.argdep/p2-template-id.cpp27
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.argdep/p2.cpp73
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp42
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.elab/templateid.cpp18
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p2.cpp65
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p3.cpp41
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p4.cpp25
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p5.cpp35
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.unqual/p3.cpp4
-rw-r--r--test/CXX/basic/basic.start/basic.start.main/p2a.cpp8
-rw-r--r--test/CXX/basic/basic.start/basic.start.main/p2b.cpp8
-rw-r--r--test/CXX/basic/basic.start/basic.start.main/p2c.cpp4
-rw-r--r--test/CXX/basic/basic.start/basic.start.main/p2d.cpp4
-rw-r--r--test/CXX/basic/basic.start/basic.start.main/p2e.cpp4
-rw-r--r--test/CXX/basic/basic.start/basic.start.main/p2f.cpp7
-rw-r--r--test/CXX/basic/basic.start/basic.start.main/p2g.cpp4
-rw-r--r--test/CXX/basic/basic.stc/basic.stc.dynamic/p2-nodef.cpp7
-rw-r--r--test/CXX/basic/basic.stc/basic.stc.dynamic/p2.cpp25
-rw-r--r--test/CXX/class.derived/class.virtual/p12.cpp19
-rw-r--r--test/CXX/class/class.friend/p1-ambiguous.cpp37
-rw-r--r--test/CXX/class/class.friend/p1.cpp76
-rw-r--r--test/CXX/class/class.friend/p2.cpp10
-rw-r--r--test/CXX/class/class.friend/p6.cpp10
-rw-r--r--test/CXX/class/class.local/p3.cpp2
-rw-r--r--test/CXX/class/class.local/p4.cpp2
-rw-r--r--test/CXX/class/class.nest/p1.cpp14
-rw-r--r--test/CXX/class/class.nested.type/p1.cpp4
-rw-r--r--test/CXX/class/class.union/p1.cpp105
-rw-r--r--test/CXX/dcl.dcl/basic.namespace/namespace.def/namespace.memdef/p3.cpp15
-rw-r--r--test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p3-cxx0x.cpp20
-rw-r--r--test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p5-cxx0x.cpp12
-rw-r--r--test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p6-cxx0x.cpp8
-rw-r--r--test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8-cxx0x.cpp15
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.stc/p9.cpp4
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp10
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p5.cpp13
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp60
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p10.cpp16
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p2.cpp9
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p3.cpp13
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p4.cpp55
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p5.cpp18
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p6.cpp32
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p7.cpp7
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p8.cpp4
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct/p3.cpp3
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.mptr/p3.cpp26
-rw-r--r--test/CXX/expr/p3.cpp15
-rw-r--r--test/CXX/expr/p8.cpp18
-rw-r--r--test/CXX/expr/p9.cpp50
-rw-r--r--test/CXX/lex/lex.trigraph/p1.cpp19
-rw-r--r--test/CXX/lex/lex.trigraph/p2.cpp3
-rw-r--r--test/CXX/lex/lex.trigraph/p3.cpp8
-rw-r--r--test/CXX/over/over.match/over.match.best/p1.cpp16
-rw-r--r--test/CXX/over/over.over/p1.cpp94
-rw-r--r--test/CXX/over/over.over/p2.cpp10
-rw-r--r--test/CXX/over/over.over/p4.cpp23
-rw-r--r--test/CXX/temp/temp.decls/temp.class.spec/p6.cpp20
-rw-r--r--test/CXX/temp/temp.decls/temp.class.spec/temp.class.order/p2.cpp16
-rw-r--r--test/CXX/temp/temp.decls/temp.class.spec/temp.class.spec.mfunc/p1-neg.cpp25
-rw-r--r--test/CXX/temp/temp.decls/temp.class.spec/temp.class.spec.mfunc/p1.cpp26
-rw-r--r--test/CXX/temp/temp.decls/temp.class/temp.mem.class/p1.cpp27
-rw-r--r--test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1-retmem.cpp28
-rw-r--r--test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp68
-rw-r--r--test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp17
-rw-r--r--test/CXX/temp/temp.decls/temp.class/temp.mem.func/pr5056.cpp17
-rw-r--r--test/CXX/temp/temp.decls/temp.class/temp.static/p1-inst.cpp28
-rw-r--r--test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp26
-rw-r--r--test/CXX/temp/temp.decls/temp.fct/temp.func.order/p4.cpp23
-rw-r--r--test/CXX/temp/temp.decls/temp.fct/temp.func.order/p5.cpp12
-rw-r--r--test/CXX/temp/temp.decls/temp.fct/temp.over.link/p4-neg.cpp6
-rw-r--r--test/CXX/temp/temp.decls/temp.fct/temp.over.link/p6.cpp16
-rw-r--r--test/CXX/temp/temp.decls/temp.friend/p1.cpp56
-rw-r--r--test/CXX/temp/temp.decls/temp.friend/p3.cpp13
-rw-r--r--test/CXX/temp/temp.decls/temp.friend/p5.cpp11
-rw-r--r--test/CXX/temp/temp.decls/temp.mem/p1.cpp16
-rw-r--r--test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp2
-rw-r--r--test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp32
-rw-r--r--test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.conv/p2.cpp36
-rw-r--r--test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.conv/p3.cpp30
-rw-r--r--test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.conv/p4.cpp44
-rw-r--r--test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.funcaddr/p1.cpp22
-rw-r--r--test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp22
-rw-r--r--test/CXX/temp/temp.param/p1.cpp3
-rw-r--r--test/CXX/temp/temp.res/temp.dep/p3.cpp43
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p1.cpp99
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p10.cpp7
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p11.cpp8
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p13.cpp6
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p14.cpp42
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p15.cpp22
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p16.cpp26
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p17.cpp12
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p18.cpp20
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p19.cpp30
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp239
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p20.cpp14
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p21.cpp30
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p3.cpp14
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp59
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p5.cpp61
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p6.cpp56
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p9.cpp14
-rw-r--r--test/CodeCompletion/call.cpp28
-rw-r--r--test/CodeCompletion/enum-switch-case-qualified.cpp33
-rw-r--r--test/CodeCompletion/enum-switch-case.c29
-rw-r--r--test/CodeCompletion/enum-switch-case.cpp29
-rw-r--r--test/CodeCompletion/function-templates.cpp15
-rw-r--r--test/CodeCompletion/functions.cpp9
-rw-r--r--test/CodeCompletion/member-access.c13
-rw-r--r--test/CodeCompletion/member-access.cpp43
-rw-r--r--test/CodeCompletion/namespace-alias.cpp21
-rw-r--r--test/CodeCompletion/namespace.cpp15
-rw-r--r--test/CodeCompletion/nested-name-specifier.cpp18
-rw-r--r--test/CodeCompletion/operator.cpp18
-rw-r--r--test/CodeCompletion/ordinary-name.c12
-rw-r--r--test/CodeCompletion/property.m29
-rw-r--r--test/CodeCompletion/tag.c13
-rw-r--r--test/CodeCompletion/tag.cpp26
-rw-r--r--test/CodeCompletion/templates.cpp17
-rw-r--r--test/CodeCompletion/truncation.c12
-rw-r--r--test/CodeCompletion/truncation.c.h5
-rw-r--r--test/CodeCompletion/using-namespace.cpp21
-rw-r--r--test/CodeCompletion/using.cpp25
-rw-r--r--test/CodeGen/2008-07-17-no-emit-on-error.c4
-rw-r--r--test/CodeGen/2008-07-22-bitfield-init-after-zero-len-array.c5
-rw-r--r--test/CodeGen/2008-07-29-override-alias-decl.c2
-rw-r--r--test/CodeGen/2009-01-21-invalid-debug-info.m2
-rw-r--r--test/CodeGen/2009-04-23-dbg.c2
-rw-r--r--test/CodeGen/2009-06-01-addrofknr.c12
-rw-r--r--test/CodeGen/2009-07-31-DbgDeclare.c5
-rw-r--r--test/CodeGen/2009-08-14-vararray-crash.c11
-rw-r--r--test/CodeGen/PR3613-static-decl.c2
-rw-r--r--test/CodeGen/PR4611-bitfield-layout.c6
-rw-r--r--test/CodeGen/PR5060-align.c13
-rw-r--r--test/CodeGen/address-space-compound-literal.c5
-rw-r--r--test/CodeGen/address-space-field1.c39
-rw-r--r--test/CodeGen/address-space-field2.c50
-rw-r--r--test/CodeGen/address-space-field3.c46
-rw-r--r--test/CodeGen/address-space-field4.c61
-rw-r--r--test/CodeGen/arm-arguments.c94
-rw-r--r--test/CodeGen/arm_asm_clobber.c21
-rw-r--r--test/CodeGen/array.c4
-rw-r--r--test/CodeGen/asm-inout.c18
-rw-r--r--test/CodeGen/asm.c13
-rw-r--r--test/CodeGen/attr-cleanup.c2
-rw-r--r--test/CodeGen/attributes.c100
-rw-r--r--test/CodeGen/blocks-2.c3
-rw-r--r--test/CodeGen/blocks-aligned-byref-variable.c19
-rw-r--r--test/CodeGen/blocks-seq.c20
-rw-r--r--test/CodeGen/boolassign.c5
-rw-r--r--test/CodeGen/builtin-attributes.c12
-rw-r--r--test/CodeGen/builtins-ffs_parity_popcount.c4
-rw-r--r--test/CodeGen/builtins-powi.c4
-rw-r--r--test/CodeGen/builtins.c2
-rw-r--r--test/CodeGen/cast-to-union.c8
-rw-r--r--test/CodeGen/conditional.c21
-rw-r--r--test/CodeGen/const-init.c61
-rw-r--r--test/CodeGen/darwin-string-literals.c16
-rw-r--r--test/CodeGen/debug-info.c6
-rw-r--r--test/CodeGen/designated-initializers.c5
-rw-r--r--test/CodeGen/exprs.c8
-rw-r--r--test/CodeGen/ext-vector-shuffle.c4
-rw-r--r--test/CodeGen/ext-vector.c19
-rw-r--r--test/CodeGen/function-attributes.c2
-rw-r--r--test/CodeGen/functions.c5
-rw-r--r--test/CodeGen/global-decls.c2
-rw-r--r--test/CodeGen/global-init.c25
-rw-r--r--test/CodeGen/global-with-initialiser.c6
-rw-r--r--test/CodeGen/globalinit.c2
-rw-r--r--test/CodeGen/init-with-member-expr.c2
-rw-r--r--test/CodeGen/inline.c16
-rw-r--r--test/CodeGen/inline2.c62
-rw-r--r--test/CodeGen/packed-union.c16
-rw-r--r--test/CodeGen/parameter-passing.c2
-rw-r--r--test/CodeGen/pragma-pack-1.c7
-rw-r--r--test/CodeGen/pragma-pack-2.c23
-rw-r--r--test/CodeGen/pragma-pack-3.c19
-rw-r--r--test/CodeGen/pragma-weak.c165
-rw-r--r--test/CodeGen/predefined-expr.c45
-rw-r--r--test/CodeGen/regparm.c5
-rw-r--r--test/CodeGen/stack-protector.c3
-rw-r--r--test/CodeGen/statements.c22
-rw-r--r--test/CodeGen/staticinit.c6
-rw-r--r--test/CodeGen/stdcall-fastcall.c2
-rw-r--r--test/CodeGen/string-init.c2
-rw-r--r--test/CodeGen/struct-init.c4
-rw-r--r--test/CodeGen/struct-x86-darwin.c20
-rw-r--r--test/CodeGen/struct.c43
-rw-r--r--test/CodeGen/union-init.c28
-rw-r--r--test/CodeGen/union-init2.c4
-rw-r--r--test/CodeGen/unreachable.c37
-rw-r--r--test/CodeGen/unwind-attr.c1
-rw-r--r--test/CodeGen/vector.c10
-rw-r--r--test/CodeGen/visibility.c2
-rw-r--r--test/CodeGen/volatile.c2
-rw-r--r--test/CodeGen/x86.c2
-rw-r--r--test/CodeGen/x86_32-arguments.c127
-rw-r--r--test/CodeGen/x86_64-arguments.c28
-rw-r--r--test/CodeGenCXX/PR4827-cast.cpp5
-rw-r--r--test/CodeGenCXX/PR4890-debug-info-dtor.cpp6
-rw-r--r--test/CodeGenCXX/PR4983-constructor-conversion.cpp16
-rw-r--r--test/CodeGenCXX/PR5050-constructor-conversion.cpp19
-rw-r--r--test/CodeGenCXX/PR5093-static-member-function.cpp9
-rw-r--r--test/CodeGenCXX/anonymous-namespaces.cpp22
-rw-r--r--test/CodeGenCXX/anonymous-union-member-initializer.cpp12
-rw-r--r--test/CodeGenCXX/array-pointer-decay.cpp7
-rw-r--r--test/CodeGenCXX/attr.cpp36
-rw-r--r--test/CodeGenCXX/cast-conversion.cpp33
-rw-r--r--test/CodeGenCXX/class-layout.cpp5
-rw-r--r--test/CodeGenCXX/conditional-expr-lvalue.cpp7
-rw-r--r--test/CodeGenCXX/constructor-conversion.cpp55
-rw-r--r--test/CodeGenCXX/constructor-default-arg.cpp40
-rw-r--r--test/CodeGenCXX/constructor-for-array-members.cpp44
-rw-r--r--test/CodeGenCXX/constructor-init-reference.cpp9
-rw-r--r--test/CodeGenCXX/constructor-init.cpp61
-rw-r--r--test/CodeGenCXX/constructor-template.cpp56
-rw-r--r--test/CodeGenCXX/conversion-function.cpp115
-rw-r--r--test/CodeGenCXX/convert-to-fptr.cpp47
-rw-r--r--test/CodeGenCXX/copy-assign-synthesis-1.cpp109
-rw-r--r--test/CodeGenCXX/copy-assign-synthesis.cpp79
-rw-r--r--test/CodeGenCXX/copy-constructor-elim.cpp43
-rw-r--r--test/CodeGenCXX/copy-constructor-synthesis.cpp110
-rw-r--r--test/CodeGenCXX/decl-ref-init.cpp31
-rw-r--r--test/CodeGenCXX/default-arg-temps.cpp14
-rw-r--r--test/CodeGenCXX/default-constructor-for-members.cpp24
-rw-r--r--test/CodeGenCXX/default-destructor-synthesis.cpp60
-rw-r--r--test/CodeGenCXX/delete.cpp37
-rw-r--r--test/CodeGenCXX/derived-to-base.cpp16
-rw-r--r--test/CodeGenCXX/destructor-calls.cpp41
-rw-r--r--test/CodeGenCXX/destructors.cpp30
-rw-r--r--test/CodeGenCXX/devirtualize-virtual-function-calls.cpp47
-rw-r--r--test/CodeGenCXX/explicit-instantiation.cpp13
-rw-r--r--test/CodeGenCXX/function-template-specialization.cpp15
-rw-r--r--test/CodeGenCXX/global-init.cpp16
-rw-r--r--test/CodeGenCXX/mangle-extreme.cpp47
-rw-r--r--test/CodeGenCXX/mangle-subst-std.cpp39
-rw-r--r--test/CodeGenCXX/mangle-subst.cpp56
-rw-r--r--test/CodeGenCXX/mangle.cpp190
-rw-r--r--test/CodeGenCXX/member-function-pointers.cpp73
-rw-r--r--test/CodeGenCXX/member-functions.cpp2
-rw-r--r--test/CodeGenCXX/member-pointers-zero-init.cpp34
-rw-r--r--test/CodeGenCXX/namespace-aliases.cpp3
-rw-r--r--test/CodeGenCXX/nested-base-member-access.cpp52
-rw-r--r--test/CodeGenCXX/new.cpp23
-rw-r--r--test/CodeGenCXX/nullptr.cpp7
-rw-r--r--test/CodeGenCXX/overload-binop-implicitconvert.cpp22
-rw-r--r--test/CodeGenCXX/predefined-expr-sizeof.cpp30
-rw-r--r--test/CodeGenCXX/predefined-expr.cpp226
-rw-r--r--test/CodeGenCXX/references.cpp13
-rw-r--r--test/CodeGenCXX/reinterpret-cast.cpp12
-rw-r--r--test/CodeGenCXX/static-data-member.cpp8
-rw-r--r--test/CodeGenCXX/static-init.cpp13
-rw-r--r--test/CodeGenCXX/temp-1.cpp83
-rw-r--r--test/CodeGenCXX/template-anonymous-union-member-initializer.cpp10
-rw-r--r--test/CodeGenCXX/trivial-constructor-init.cpp21
-rw-r--r--test/CodeGenCXX/virt.cpp1024
-rw-r--r--test/CodeGenCXX/virtual-base-cast.cpp9
-rw-r--r--test/CodeGenCXX/virtual-function-calls.cpp11
-rw-r--r--test/CodeGenCXX/vtable-cast-crash.cpp21
-rw-r--r--test/CodeGenCXX/x86_64-arguments.cpp10
-rw-r--r--test/CodeGenObjC/PR4541.m19
-rw-r--r--test/CodeGenObjC/PR4894-recursive-debug-crash.m40
-rw-r--r--test/CodeGenObjC/constant-strings.m4
-rw-r--r--test/CodeGenObjC/debug-info-linkagename.m17
-rw-r--r--test/CodeGenObjC/for-in.m44
-rw-r--r--test/CodeGenObjC/ivar-layout-64-bitfields.m40
-rw-r--r--test/CodeGenObjC/ivar-layout-no-optimize.m18
-rw-r--r--test/CodeGenObjC/messages.m4
-rw-r--r--test/CodeGenObjC/objc-assign-ivar.m53
-rw-r--r--test/CodeGenObjC/objc-gc-aggr-assign.m46
-rw-r--r--test/CodeGenObjC/objc-read-weak-byref.m26
-rw-r--r--test/CodeGenObjC/objc2-assign-global.m83
-rw-r--r--test/CodeGenObjC/objc2-ivar-assign.m41
-rw-r--r--test/CodeGenObjC/objc2-new-gc-api-strongcast.m26
-rw-r--r--test/CodeGenObjC/objc2-weak-assign.m4
-rw-r--r--test/CodeGenObjC/objc2-weak-ivar-debug.m15
-rw-r--r--test/CodeGenObjC/objc2-write-barrier-2.m80
-rw-r--r--test/CodeGenObjC/objc2-write-barrier-3.m47
-rw-r--r--test/CodeGenObjC/objc2-write-barrier-4.m28
-rw-r--r--test/CodeGenObjC/objc2-write-barrier-5.m27
-rw-r--r--test/CodeGenObjC/objc2-write-barrier.m114
-rw-r--r--test/CodeGenObjC/object-incr-decr-1.m19
-rw-r--r--test/CodeGenObjC/overloadable.m4
-rw-r--r--test/CodeGenObjC/predefined-expr.m90
-rw-r--r--test/CodeGenObjC/property-agrr-getter.m23
-rw-r--r--test/CodeGenObjC/property-setter-attr.m2
-rw-r--r--test/CodeGenObjC/protocol-in-extended-class.m29
-rw-r--r--test/CodeGenObjC/protocols-lazy.m4
-rw-r--r--test/CodeGenObjC/protocols.m50
-rw-r--r--test/CodeGenObjC/variadic-sends.m41
-rw-r--r--test/Coverage/targets.c27
-rw-r--r--test/Driver/arm-darwin-builtin.c14
-rw-r--r--test/Driver/ast.c26
-rw-r--r--test/Driver/bindings.c6
-rw-r--r--test/Driver/clang-translation.c8
-rw-r--r--test/Driver/darwin-arm.c4
-rw-r--r--test/Driver/darwin-as.c10
-rw-r--r--test/Driver/darwin-cc.c1
-rw-r--r--test/Driver/darwin-ld.c7
-rw-r--r--test/Driver/default-toolchain.c6
-rw-r--r--test/Driver/dragonfly.c10
-rw-r--r--test/Driver/freebsd.c10
-rw-r--r--test/Driver/openbsd.c8
-rw-r--r--test/Driver/pth.c8
-rw-r--r--test/Driver/qa_override.c3
-rw-r--r--test/Driver/redzone.c6
-rw-r--r--test/Frontend/ast-codegen.c12
-rw-r--r--test/Frontend/ast-main.c8
-rw-r--r--test/Frontend/dependency-gen.c2
-rw-r--r--test/Frontend/stdin.c2
-rw-r--r--test/Index/c-index-api-test.m224
-rw-r--r--test/Index/comments.c30
-rw-r--r--test/Index/cxx-operator-overload.cpp28
-rw-r--r--test/Index/find-decls.c25
-rw-r--r--test/Index/find-defs.c18
-rw-r--r--test/Index/find-refs.c47
-rw-r--r--test/Index/foo.h8
-rw-r--r--test/Index/multiple-redecls.c12
-rw-r--r--test/Index/objc-decls.m16
-rw-r--r--test/Index/objc-message.m38
-rw-r--r--test/Index/objc.h11
-rw-r--r--test/Index/resolve-loc.c39
-rw-r--r--test/Index/t1.c31
-rw-r--r--test/Index/t1.m23
-rw-r--r--test/Index/t2.c14
-rw-r--r--test/Index/t2.m16
-rw-r--r--test/Lexer/11-27-2007-FloatLiterals.c8
-rw-r--r--test/Lexer/comment-escape.c2
-rw-r--r--test/Lexer/dollar-idents.c2
-rw-r--r--test/Makefile32
-rw-r--r--test/Misc/diag-mapping2.c5
-rw-r--r--test/PCH/cxx-method.cpp7
-rw-r--r--test/PCH/libroot/usr/include/reloc.h15
-rw-r--r--test/PCH/libroot/usr/include/reloc2.h15
-rw-r--r--test/PCH/method_pool.h3
-rw-r--r--test/PCH/objc_exprs.m5
-rw-r--r--test/PCH/pr4489.c22
-rw-r--r--test/PCH/reloc.c14
-rw-r--r--test/Parser/CompoundStmtScope.c2
-rw-r--r--test/Parser/MicrosoftExtensions.c18
-rw-r--r--test/Parser/argument_redef.c2
-rw-r--r--test/Parser/bad-control.c4
-rw-r--r--test/Parser/cxx-ambig-paren-expr.cpp6
-rw-r--r--test/Parser/cxx-friend.cpp21
-rw-r--r--test/Parser/cxx-member-initializers.cpp10
-rw-r--r--test/Parser/cxx-template-decl.cpp21
-rw-r--r--test/Parser/cxx-using-declaration.cpp92
-rw-r--r--test/Parser/declarators.c10
-rw-r--r--test/Parser/implicit-casts.c1
-rw-r--r--test/Parser/objc-messaging-neg-1.m9
-rw-r--r--test/Parser/pointer_promotion.c3
-rw-r--r--test/Parser/pragma-weak.c2
-rw-r--r--test/Parser/recovery.c12
-rw-r--r--test/Parser/statements.c14
-rw-r--r--test/Parser/top-level-semi-cxx0x.cpp15
-rw-r--r--test/Preprocessor/assembler-with-cpp.c2
-rw-r--r--test/Preprocessor/macro-multiline.c2
-rw-r--r--test/Preprocessor/macro_fn_comma_swallow.c2
-rw-r--r--test/Preprocessor/macro_paste_mscomment.c4
-rw-r--r--test/Preprocessor/non_fragile_feature.m8
-rw-r--r--test/Preprocessor/non_fragile_feature1.m8
-rw-r--r--test/Preprocessor/pushable-diagnostics.c17
-rw-r--r--test/Rewriter/id-test-3.m2
-rw-r--r--test/Rewriter/method-encoding-1.m4
-rw-r--r--test/Rewriter/rewrite-foreach-4.m2
-rw-r--r--test/Rewriter/rewrite-foreach-5.m2
-rw-r--r--test/Sema/address_spaces.c16
-rw-r--r--test/Sema/align-arm-apcs.c4
-rw-r--r--test/Sema/altivec-init.c16
-rw-r--r--test/Sema/arg-scope-c99.c2
-rw-r--r--test/Sema/arg-scope.c2
-rw-r--r--test/Sema/array-constraint.c2
-rw-r--r--test/Sema/array-init.c23
-rw-r--r--test/Sema/attr-decl-after-definition.c19
-rw-r--r--test/Sema/attr-deprecated.c2
-rw-r--r--test/Sema/attr-format_arg.c2
-rw-r--r--test/Sema/attr-malloc.c25
-rw-r--r--test/Sema/attr-noreturn.c10
-rw-r--r--test/Sema/attr-section.c10
-rw-r--r--test/Sema/attr-weak.c4
-rw-r--r--test/Sema/bitfield-promote-int-16bit.c25
-rw-r--r--test/Sema/bitfield-promote.c34
-rw-r--r--test/Sema/bitfield.c2
-rw-r--r--test/Sema/block-args.c2
-rw-r--r--test/Sema/block-call.c52
-rw-r--r--test/Sema/block-literal.c82
-rw-r--r--test/Sema/block-misc.c39
-rw-r--r--test/Sema/block-printf-attribute-1.c17
-rw-r--r--test/Sema/block-return-1.c6
-rw-r--r--test/Sema/block-return-2.c5
-rw-r--r--test/Sema/block-return-3.c5
-rw-r--r--test/Sema/block-return.c6
-rw-r--r--test/Sema/block-sentinel-attribute.c25
-rw-r--r--test/Sema/builtin-prefetch.c2
-rw-r--r--test/Sema/builtin-unary-fp.c12
-rw-r--r--test/Sema/builtins.c32
-rw-r--r--test/Sema/c89-2.c6
-rw-r--r--test/Sema/c89.c4
-rw-r--r--test/Sema/compare.c23
-rw-r--r--test/Sema/complex-int.c5
-rw-r--r--test/Sema/conditional.c10
-rw-r--r--test/Sema/darwin-align-cast.c5
-rw-r--r--test/Sema/decl-type-merging.c10
-rw-r--r--test/Sema/enum.c2
-rw-r--r--test/Sema/exprs.c11
-rw-r--r--test/Sema/floating-point-compare.c4
-rw-r--r--test/Sema/format-attr-pr4470.c1
-rw-r--r--test/Sema/format-attribute-printf0.c26
-rw-r--r--test/Sema/freemain.c9
-rw-r--r--test/Sema/function-pointer-sentinel-attribute.c23
-rw-r--r--test/Sema/function-sentinel-attr.c2
-rw-r--r--test/Sema/function.c2
-rw-r--r--test/Sema/heinous-extensions-on.c13
-rw-r--r--test/Sema/implicit-builtin-redecl.c12
-rw-r--r--test/Sema/implicit-int.c9
-rw-r--r--test/Sema/incomplete-call.c4
-rw-r--r--test/Sema/incomplete-decl.c5
-rw-r--r--test/Sema/pragma-pack-4.c19
-rw-r--r--test/Sema/pragma-unused.c9
-rw-r--r--test/Sema/predefined-function.c17
-rw-r--r--test/Sema/promote-int-16bit.c6
-rw-r--r--test/Sema/redefinition.c4
-rw-r--r--test/Sema/return-noreturn.c29
-rw-r--r--test/Sema/return.c210
-rw-r--r--test/Sema/shift.c38
-rw-r--r--test/Sema/static-init.c4
-rw-r--r--test/Sema/struct-decl.c20
-rw-r--r--test/Sema/tentative-decls.c2
-rw-r--r--test/Sema/transparent-union-pointer.c8
-rw-r--r--test/Sema/type-spec-struct-union.c2
-rw-r--r--test/Sema/unused-expr.c54
-rw-r--r--test/Sema/va_arg_x86_64.c9
-rw-r--r--test/Sema/vector-cast.c2
-rw-r--r--test/Sema/warn-char-subscripts.c64
-rw-r--r--test/Sema/warn-unused-variables.c19
-rw-r--r--test/Sema/x86-intrinsics-headers.c24
-rw-r--r--test/SemaCXX/PR5086-ambig-resolution-enum.cpp13
-rw-r--r--test/SemaCXX/abstract.cpp57
-rw-r--r--test/SemaCXX/access-control-check.cpp16
-rw-r--r--test/SemaCXX/addr-of-overloaded-function.cpp27
-rw-r--r--test/SemaCXX/ambig-user-defined-conversions.cpp52
-rw-r--r--test/SemaCXX/ambiguous-builtin-unary-operator.cpp18
-rw-r--r--test/SemaCXX/arrow-operator.cpp22
-rw-r--r--test/SemaCXX/attr-after-definition.cpp9
-rw-r--r--test/SemaCXX/attr-deprecated.cpp66
-rw-r--r--test/SemaCXX/attr-format.cpp8
-rw-r--r--test/SemaCXX/auto-cxx0x.cpp2
-rw-r--r--test/SemaCXX/builtin-ptrtomember-ambig.cpp24
-rw-r--r--test/SemaCXX/builtin-ptrtomember-overload-1.cpp46
-rw-r--r--test/SemaCXX/builtin-ptrtomember-overload.cpp18
-rw-r--r--test/SemaCXX/c99.cpp8
-rw-r--r--test/SemaCXX/cast-conversion.cpp21
-rw-r--r--test/SemaCXX/cast-explicit-ctor.cpp6
-rw-r--r--test/SemaCXX/class-base-member-init.cpp6
-rw-r--r--test/SemaCXX/class-layout.cpp49
-rw-r--r--test/SemaCXX/class-names.cpp4
-rw-r--r--test/SemaCXX/composite-pointer-type.cpp8
-rw-r--r--test/SemaCXX/conditional-expr.cpp6
-rw-r--r--test/SemaCXX/constructor-initializer.cpp41
-rw-r--r--test/SemaCXX/constructor.cpp26
-rw-r--r--test/SemaCXX/conversion-delete-expr.cpp109
-rw-r--r--test/SemaCXX/conversion-function.cpp29
-rw-r--r--test/SemaCXX/copy-assignment.cpp2
-rw-r--r--test/SemaCXX/copy-constructor-error.cpp13
-rw-r--r--test/SemaCXX/cstyle-cast.cpp231
-rw-r--r--test/SemaCXX/dcl_ambig_res.cpp9
-rw-r--r--test/SemaCXX/dcl_init_aggr.cpp6
-rw-r--r--test/SemaCXX/decl-expr-ambiguity.cpp4
-rw-r--r--test/SemaCXX/decl-init-ref.cpp26
-rw-r--r--test/SemaCXX/decltype-crash.cpp7
-rw-r--r--test/SemaCXX/decltype-this.cpp15
-rw-r--r--test/SemaCXX/default-argument-temporaries.cpp11
-rw-r--r--test/SemaCXX/default-assignment-operator.cpp28
-rw-r--r--test/SemaCXX/default-constructor-initializers.cpp18
-rw-r--r--test/SemaCXX/default2.cpp22
-rw-r--r--test/SemaCXX/deleted-function.cpp2
-rw-r--r--test/SemaCXX/destructor.cpp11
-rw-r--r--test/SemaCXX/direct-initializer.cpp14
-rw-r--r--test/SemaCXX/empty-class-layout.cpp68
-rw-r--r--test/SemaCXX/enum.cpp13
-rw-r--r--test/SemaCXX/exception-spec.cpp126
-rw-r--r--test/SemaCXX/friend-class-nodecl.cpp10
-rw-r--r--test/SemaCXX/function-overloaded-redecl.cpp10
-rw-r--r--test/SemaCXX/functional-cast.cpp294
-rw-r--r--test/SemaCXX/i-c-e-cxx.cpp10
-rw-r--r--test/SemaCXX/illegal-member-initialization.cpp22
-rw-r--r--test/SemaCXX/incomplete-call.cpp38
-rw-r--r--test/SemaCXX/inherit.cpp2
-rw-r--r--test/SemaCXX/invalid-member-expr.cpp21
-rw-r--r--test/SemaCXX/invalid-template-specifier.cpp12
-rw-r--r--test/SemaCXX/libstdcxx_is_pod_hack.cpp7
-rw-r--r--test/SemaCXX/linkage-spec.cpp8
-rw-r--r--test/SemaCXX/member-expr-static.cpp18
-rw-r--r--test/SemaCXX/member-name-lookup.cpp10
-rw-r--r--test/SemaCXX/member-operator-expr.cpp29
-rw-r--r--test/SemaCXX/member-pointer.cpp10
-rw-r--r--test/SemaCXX/missing-members.cpp36
-rw-r--r--test/SemaCXX/namespace.cpp5
-rw-r--r--test/SemaCXX/nested-name-spec.cpp23
-rw-r--r--test/SemaCXX/new-delete.cpp45
-rw-r--r--test/SemaCXX/overload-value-dep-arg.cpp13
-rw-r--r--test/SemaCXX/overloaded-builtin-operators.cpp36
-rw-r--r--test/SemaCXX/overloaded-operator.cpp37
-rw-r--r--test/SemaCXX/primary-base.cpp11
-rw-r--r--test/SemaCXX/pseudo-destructors.cpp40
-rw-r--r--test/SemaCXX/qual-id-test.cpp140
-rw-r--r--test/SemaCXX/ref-init-ambiguous.cpp28
-rw-r--r--test/SemaCXX/references.cpp15
-rw-r--r--test/SemaCXX/return.cpp18
-rw-r--r--test/SemaCXX/static-array-member.cpp18
-rw-r--r--test/SemaCXX/static-cast-complete-type.cpp13
-rw-r--r--test/SemaCXX/static-cast.cpp22
-rw-r--r--test/SemaCXX/static-initializers.cpp10
-rw-r--r--test/SemaCXX/type-traits-incomplete.cpp7
-rw-r--r--test/SemaCXX/type-traits.cpp149
-rw-r--r--test/SemaCXX/unknown-type-name.cpp29
-rw-r--r--test/SemaCXX/unreachable-catch-clauses.cpp14
-rw-r--r--test/SemaCXX/using-decl-1.cpp11
-rw-r--r--test/SemaCXX/using-decl-templates.cpp36
-rw-r--r--test/SemaCXX/value-dependent-exprs.cpp47
-rw-r--r--test/SemaCXX/vararg-non-pod.cpp14
-rw-r--r--test/SemaCXX/vector-casts.cpp40
-rw-r--r--test/SemaCXX/warn-assignment-condition.cpp65
-rw-r--r--test/SemaCXX/warn-char-subscripts.cpp21
-rw-r--r--test/SemaCXX/warn-for-var-in-else.cpp1
-rw-r--r--test/SemaCXX/warn-reorder-ctor-initialization.cpp89
-rw-r--r--test/SemaCXX/warn-unused-variables.cpp6
-rw-r--r--test/SemaCXX/wchar_t.cpp4
-rw-r--r--test/SemaObjC/access-property-getter.m1
-rw-r--r--test/SemaObjC/attr-malloc.m16
-rw-r--r--test/SemaObjC/block-explicit-return-type.m77
-rw-r--r--test/SemaObjC/blocks.m11
-rw-r--r--test/SemaObjC/call-super-2.m4
-rw-r--r--test/SemaObjC/category-1.m19
-rw-r--r--test/SemaObjC/category-method-lookup-2.m1
-rw-r--r--test/SemaObjC/class-bitfield.m6
-rw-r--r--test/SemaObjC/class-getter-using-dotsyntax.m39
-rw-r--r--test/SemaObjC/class-impl-1.m2
-rw-r--r--test/SemaObjC/compatible-protocol-qualified-types.m1
-rw-r--r--test/SemaObjC/comptypes-1.m4
-rw-r--r--test/SemaObjC/comptypes-3.m12
-rw-r--r--test/SemaObjC/comptypes-5.m4
-rw-r--r--test/SemaObjC/comptypes-7.m4
-rw-r--r--test/SemaObjC/comptypes-a.m1
-rw-r--r--test/SemaObjC/conditional-expr-3.m6
-rw-r--r--test/SemaObjC/conditional-expr-4.m20
-rw-r--r--test/SemaObjC/conditional-expr-5.m27
-rw-r--r--test/SemaObjC/conditional-expr.m83
-rw-r--r--test/SemaObjC/crash-label.m9
-rw-r--r--test/SemaObjC/deref-interface.m12
-rw-r--r--test/SemaObjC/format-arg-attribute.m3
-rw-r--r--test/SemaObjC/id-isa-ref.m37
-rw-r--r--test/SemaObjC/id.m2
-rw-r--r--test/SemaObjC/interface-scope-2.m2
-rw-r--r--test/SemaObjC/invalid-objc-decls-1.m8
-rw-r--r--test/SemaObjC/message.m2
-rw-r--r--test/SemaObjC/method-arg-decay.m1
-rw-r--r--test/SemaObjC/method-conflict.m4
-rw-r--r--test/SemaObjC/method-encoding-2.m4
-rw-r--r--test/SemaObjC/method-lookup-2.m5
-rw-r--r--test/SemaObjC/method-lookup.m1
-rw-r--r--test/SemaObjC/method-typecheck-1.m11
-rw-r--r--test/SemaObjC/no-warn-unimpl-method.m2
-rw-r--r--test/SemaObjC/nonnull.m42
-rw-r--r--test/SemaObjC/nsobject-attribute.m2
-rw-r--r--test/SemaObjC/objc2-merge-gc-attribue-decl.m5
-rw-r--r--test/SemaObjC/property-11.m1
-rw-r--r--test/SemaObjC/property-9-impl-method.m3
-rw-r--r--test/SemaObjC/property-error-readonly-assign.m23
-rw-r--r--test/SemaObjC/property-expression-error.m18
-rw-r--r--test/SemaObjC/property-method-lookup-impl.m4
-rw-r--r--test/SemaObjC/property-missing.m2
-rw-r--r--test/SemaObjC/protocol-archane.m3
-rw-r--r--test/SemaObjC/protocol-attribute.m4
-rw-r--r--test/SemaObjC/protocol-implementation-inherited.m2
-rw-r--r--test/SemaObjC/protocol-lookup.m1
-rw-r--r--test/SemaObjC/protocol-qualified-class-unsupported.m2
-rw-r--r--test/SemaObjC/rdr-6211479-array-property.m3
-rw-r--r--test/SemaObjC/return.m6
-rw-r--r--test/SemaObjC/selector-1.m13
-rw-r--r--test/SemaObjC/sizeof-interface.m11
-rw-r--r--test/SemaObjC/static-ivar-ref-1.m3
-rw-r--r--test/SemaObjC/super-cat-prot.m4
-rw-r--r--test/SemaObjC/super.m1
-rw-r--r--test/SemaObjC/synchronized.m2
-rw-r--r--test/SemaObjC/undef-superclass-1.m7
-rw-r--r--test/SemaObjC/unused.m33
-rw-r--r--test/SemaObjC/warn-assign-property-nscopying.m15
-rw-r--r--test/SemaObjC/warn-superclass-method-mismatch.m50
-rw-r--r--test/SemaObjC/weak-attr-ivar.m5
-rw-r--r--test/SemaObjCXX/overload.mm1
-rw-r--r--test/SemaObjCXX/protocol-lookup.mm1
-rw-r--r--test/SemaObjCXX/references.mm4
-rw-r--r--test/SemaTemplate/ackermann.cpp7
-rw-r--r--test/SemaTemplate/ambiguous-ovl-print.cpp9
-rw-r--r--test/SemaTemplate/canonical-expr-type-0x.cpp16
-rw-r--r--test/SemaTemplate/canonical-expr-type.cpp53
-rw-r--r--test/SemaTemplate/class-template-spec.cpp34
-rw-r--r--test/SemaTemplate/constructor-template.cpp53
-rw-r--r--test/SemaTemplate/copy-ctor-assign.cpp36
-rw-r--r--test/SemaTemplate/current-instantiation.cpp73
-rw-r--r--test/SemaTemplate/default-arguments.cpp20
-rw-r--r--test/SemaTemplate/default-expr-arguments.cpp86
-rw-r--r--test/SemaTemplate/dependent-base-member-init.cpp36
-rw-r--r--test/SemaTemplate/dependent-type-identity.cpp2
-rw-r--r--test/SemaTemplate/destructor-template.cpp12
-rw-r--r--test/SemaTemplate/example-dynarray.cpp63
-rw-r--r--test/SemaTemplate/explicit-instantiation.cpp75
-rw-r--r--test/SemaTemplate/explicit-specialization-member.cpp11
-rw-r--r--test/SemaTemplate/ext-vector-type.cpp2
-rw-r--r--test/SemaTemplate/extern-templates.cpp66
-rw-r--r--test/SemaTemplate/friend-template.cpp64
-rw-r--r--test/SemaTemplate/friend.cpp14
-rw-r--r--test/SemaTemplate/fun-template-def.cpp7
-rw-r--r--test/SemaTemplate/function-template-specialization.cpp35
-rw-r--r--test/SemaTemplate/implicit-instantiation-1.cpp2
-rw-r--r--test/SemaTemplate/injected-class-name.cpp10
-rw-r--r--test/SemaTemplate/instantiate-anonymous-union.cpp31
-rw-r--r--test/SemaTemplate/instantiate-cast.cpp8
-rw-r--r--test/SemaTemplate/instantiate-deeply.cpp22
-rw-r--r--test/SemaTemplate/instantiate-expr-2.cpp48
-rw-r--r--test/SemaTemplate/instantiate-expr-5.cpp4
-rw-r--r--test/SemaTemplate/instantiate-friend-class.cpp9
-rw-r--r--test/SemaTemplate/instantiate-function-1.cpp2
-rw-r--r--test/SemaTemplate/instantiate-function-1.mm3
-rw-r--r--test/SemaTemplate/instantiate-init.cpp28
-rw-r--r--test/SemaTemplate/instantiate-member-initializers.cpp26
-rw-r--r--test/SemaTemplate/instantiate-member-template.cpp105
-rw-r--r--test/SemaTemplate/instantiate-method.cpp9
-rw-r--r--test/SemaTemplate/instantiate-static-var.cpp22
-rw-r--r--test/SemaTemplate/instantiate-typedef.cpp2
-rw-r--r--test/SemaTemplate/instantiate-using-decl.cpp17
-rw-r--r--test/SemaTemplate/member-access-expr.cpp77
-rw-r--r--test/SemaTemplate/member-function-template.cpp51
-rw-r--r--test/SemaTemplate/member-initializers.cpp13
-rw-r--r--test/SemaTemplate/member-template-access-expr.cpp30
-rw-r--r--test/SemaTemplate/metafun-apply.cpp3
-rw-r--r--test/SemaTemplate/nested-linkage.cpp3
-rw-r--r--test/SemaTemplate/nested-template.cpp89
-rw-r--r--test/SemaTemplate/partial-spec-instantiate.cpp20
-rw-r--r--test/SemaTemplate/qualified-id.cpp9
-rw-r--r--test/SemaTemplate/qualified-names-diag.cpp2
-rw-r--r--test/SemaTemplate/temp_class_order.cpp42
-rw-r--r--test/SemaTemplate/temp_class_spec.cpp75
-rw-r--r--test/SemaTemplate/temp_class_spec_neg.cpp4
-rw-r--r--test/SemaTemplate/temp_func_order.cpp95
-rw-r--r--test/SemaTemplate/typename-specifier-4.cpp70
-rw-r--r--test/SemaTemplate/typename-specifier.cpp15
-rw-r--r--test/SemaTemplate/value-dependent-null-pointer-constant.cpp29
-rwxr-xr-xtest/TestRunner.sh137
-rw-r--r--test/lit.cfg152
-rw-r--r--test/lit.site.cfg.in10
-rw-r--r--tools/CIndex/CIndex.cpp745
-rw-r--r--tools/CIndex/CIndex.exports29
-rw-r--r--tools/CIndex/CMakeLists.txt27
-rw-r--r--tools/CIndex/Makefile54
-rw-r--r--tools/CMakeLists.txt9
-rw-r--r--tools/Makefile2
-rw-r--r--tools/c-index-test/CMakeLists.txt25
-rw-r--r--tools/c-index-test/Makefile24
-rw-r--r--tools/c-index-test/c-index-test.c106
-rw-r--r--tools/clang-cc/CMakeLists.txt3
-rw-r--r--tools/clang-cc/clang-cc.cpp907
-rw-r--r--tools/driver/CMakeLists.txt2
-rw-r--r--tools/driver/Makefile6
-rw-r--r--tools/driver/driver.cpp126
-rw-r--r--tools/index-test/CMakeLists.txt2
-rw-r--r--tools/index-test/Makefile5
-rw-r--r--tools/index-test/index-test.cpp271
-rw-r--r--tools/wpa/CMakeLists.txt20
-rw-r--r--tools/wpa/Makefile16
-rw-r--r--tools/wpa/clang-wpa.cpp62
-rwxr-xr-xutils/ABITest/ABITestGen.py2
-rw-r--r--utils/C++Tests/LLVM-Syntax/lit.local.cfg22
-rw-r--r--utils/C++Tests/lit.cfg18
-rw-r--r--utils/C++Tests/stdc++-Syntax/lit.local.cfg17
-rwxr-xr-xutils/CaptureCmd2
-rwxr-xr-xutils/CmpDriver92
-rwxr-xr-xutils/FindSpecRefs2
-rwxr-xr-xutils/SummarizeErrors2
-rwxr-xr-xutils/analyzer/CmpRuns230
-rwxr-xr-xutils/ccc-analyzer139
-rw-r--r--utils/clang-completion-mode.el257
-rwxr-xr-xutils/scan-build67
-rw-r--r--utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp23
-rw-r--r--www/OpenProjects.html10
-rw-r--r--www/analyzer/annotations.html12
-rw-r--r--www/analyzer/content.css2
-rw-r--r--www/analyzer/latest_checker.html.incl2
-rw-r--r--www/analyzer/menu.css4
-rw-r--r--www/analyzer/menu.html.incl7
-rw-r--r--www/comparison.html3
-rw-r--r--www/content.css2
-rw-r--r--www/cxx_status.html587
-rw-r--r--www/diagnostics.html71
-rw-r--r--www/features.html1
-rw-r--r--www/get_started.html107
-rw-r--r--www/hacking.html104
-rw-r--r--www/menu.html.incl20
1226 files changed, 105925 insertions, 41032 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb128d68f2bd..0cd52d0d946b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,3 +1,26 @@
+# Clang version information
+
+# Make sure that CMake reconfigures when the version changes.
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/VER
+ ${CMAKE_CURRENT_BINARY_DIR}/VER)
+
+set(CLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(CLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+
+# Compute the Clang version from the contents of VER
+file(READ ${CMAKE_CURRENT_SOURCE_DIR}/VER CLANG_VERSION_DATA)
+string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
+ ${CLANG_VERSION_DATA})
+message(STATUS "Clang version: ${CLANG_VERSION}")
+
+# Add appropriate flags for GCC
+if (CMAKE_COMPILER_IS_GNUCXX)
+ # FIXME: Turn off exceptions, RTTI:
+ # -fno-exceptions -fno-rtti
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings")
+endif ()
+
macro(add_clang_library name)
set(srcs ${ARGN})
if(MSVC_IDE OR XCODE)
@@ -11,10 +34,27 @@ macro(add_clang_library name)
../../include/clang${dir}/*.def)
set(srcs ${srcs} ${headers})
endif(MSVC_IDE OR XCODE)
- add_library( ${name} ${srcs} )
+ if (SHARED_LIBRARY)
+ set(libkind SHARED)
+ else()
+ set(libkind)
+ endif()
+ add_library( ${name} ${libkind} ${srcs} )
if( LLVM_COMMON_DEPENDS )
add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
endif( LLVM_COMMON_DEPENDS )
+ if( LLVM_USED_LIBS )
+ foreach(lib ${LLVM_USED_LIBS})
+ target_link_libraries( ${name} ${lib} )
+ endforeach(lib)
+ endif( LLVM_USED_LIBS )
+ if( LLVM_LINK_COMPONENTS )
+ llvm_config(${name} ${LLVM_LINK_COMPONENTS})
+ endif( LLVM_LINK_COMPONENTS )
+ get_system_libs(llvm_system_libs)
+ if( llvm_system_libs )
+ target_link_libraries(${name} ${llvm_system_libs})
+ endif( llvm_system_libs )
add_dependencies(${name} ClangDiagnosticCommon)
if(MSVC)
get_target_property(cflag ${name} COMPILE_FLAGS)
@@ -36,8 +76,6 @@ macro(add_clang_executable name)
set(srcs ${srcs} ${headers})
endif(MSVC_IDE)
add_llvm_executable( ${name} ${srcs} )
- install(TARGETS ${name}
- RUNTIME DESTINATION bin)
endmacro(add_clang_executable)
include_directories(
@@ -57,4 +95,5 @@ add_subdirectory(lib)
add_subdirectory(tools)
# TODO: docs.
-add_subdirectory(test) \ No newline at end of file
+add_subdirectory(test)
+
diff --git a/INPUTS/all-std-headers.cpp b/INPUTS/all-std-headers.cpp
new file mode 100644
index 000000000000..bddf4ec163c4
--- /dev/null
+++ b/INPUTS/all-std-headers.cpp
@@ -0,0 +1,51 @@
+#include <algorithm>
+#include <bitset>
+#include <cassert>
+#include <cctype>
+#include <cerrno>
+#include <cfloat>
+#include <ciso646>
+#include <climits>
+#include <clocale>
+#include <cmath>
+#include <complex>
+#include <csetjmp>
+#include <csignal>
+#include <cstdarg>
+#include <cstddef>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+#include <cwchar>
+#include <cwctype>
+#include <deque>
+#include <exception>
+#include <fstream>
+#include <functional>
+#include <iomanip>
+#include <ios>
+#include <iosfwd>
+#include <iostream>
+#include <istream>
+#include <iterator>
+#include <limits>
+#include <list>
+#include <locale>
+#include <map>
+#include <memory>
+#include <new>
+#include <numeric>
+#include <ostream>
+#include <queue>
+#include <set>
+#include <sstream>
+#include <stack>
+#include <stdexcept>
+#include <streambuf>
+#include <string>
+#include <strstream>
+#include <typeinfo>
+#include <utility>
+#include <valarray>
+#include <vector>
diff --git a/INSTALL.txt b/INSTALL.txt
new file mode 100644
index 000000000000..e8e320962bb4
--- /dev/null
+++ b/INSTALL.txt
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+// Clang Installation Instructions
+//===----------------------------------------------------------------------===//
+
+These instructions describe how to build and install Clang.
+
+//===----------------------------------------------------------------------===//
+// Step 1: Organization
+//===----------------------------------------------------------------------===//
+
+Clang is designed to be built as part of an LLVM build. Assuming that the LLVM
+source code is located at $LLVM_SRC_ROOT, then the clang source code should be
+installed as:
+
+ $LLVM_SRC_ROOT/tools/clang
+
+The directory is not required to be called clang, but doing so will allow the
+LLVM build system to automatically recognize it and build it along with LLVM.
+
+//===----------------------------------------------------------------------===//
+// Step 2: Configure and Build LLVM
+//===----------------------------------------------------------------------===//
+
+Configure and build your copy of LLVM (see $LLVM_SRC_ROOT/GettingStarted.html
+for more information).
+
+Assuming you installed clang at $LLVM_SRC_ROOT/tools/clang then Clang will
+automatically be built with LLVM. Otherwise, run 'make' in the Clang source
+directory to build Clang.
+
+//===----------------------------------------------------------------------===//
+// Step 3: (Optional) Verify Your Build
+//===----------------------------------------------------------------------===//
+
+It is a good idea to run the Clang tests to make sure your build works
+correctly. From inside the Clang build directory, run 'make test' to run the
+tests.
+
+//===----------------------------------------------------------------------===//
+// Step 4: Install Clang
+//===----------------------------------------------------------------------===//
+
+From inside the Clang build directory, run 'make install' to install the Clang
+compiler and header files into the prefix directory selected when LLVM was
+configured.
+
+The Clang compiler is available as 'clang' and supports a gcc like command line
+interface. See the man page for clang (installed into $prefix/share/man/man1)
+for more information.
diff --git a/LICENSE.TXT b/LICENSE.TXT
index 21cb5c7ac589..72faf418f287 100644
--- a/LICENSE.TXT
+++ b/LICENSE.TXT
@@ -4,7 +4,7 @@ LLVM Release License
University of Illinois/NCSA
Open Source License
-Copyright (c) 2007 University of Illinois at Urbana-Champaign.
+Copyright (c) 2007-2009 University of Illinois at Urbana-Champaign.
All rights reserved.
Developed by:
diff --git a/Makefile b/Makefile
index 00e38d26de46..22fe214705cd 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ DIRS := include lib tools docs
include $(LEVEL)/Makefile.common
ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
-test::
+all::
$(Verb) if [ ! -f test/Makefile ]; then \
$(MKDIR) test; \
$(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \
@@ -30,3 +30,30 @@ cscope.files:
-or -name '*.h' > cscope.files
.PHONY: test report clean cscope.files
+
+install-local::
+ $(Echo) Installing include files
+ $(Verb) $(MKDIR) $(PROJ_includedir)
+ $(Verb) if test -d "$(PROJ_SRC_ROOT)/tools/clang/include" ; then \
+ cd $(PROJ_SRC_ROOT)/tools/clang/include && \
+ for hdr in `find . -type f '!' '(' -name '*~' \
+ -o -name '.#*' -o -name '*.in' -o -name '*.txt' \
+ -o -name 'Makefile' -o -name '*.td' ')' -print \
+ | grep -v CVS | grep -v .svn` ; do \
+ instdir=`dirname "$(PROJ_includedir)/$$hdr"` ; \
+ if test \! -d "$$instdir" ; then \
+ $(EchoCmd) Making install directory $$instdir ; \
+ $(MKDIR) $$instdir ;\
+ fi ; \
+ $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
+ done ; \
+ fi
+ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
+ $(Verb) if test -d "$(PROJ_OBJ_ROOT)/tools/clang/include" ; then \
+ cd $(PROJ_OBJ_ROOT)/tools/clang/include && \
+ for hdr in `find . -type f '!' '(' -name 'Makefile' ')' -print \
+ | grep -v CVS | grep -v .tmp` ; do \
+ $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
+ done ; \
+ fi
+endif
diff --git a/NOTES.txt b/NOTES.txt
index 3b5ad16e3e10..c658fe96bdfb 100644
--- a/NOTES.txt
+++ b/NOTES.txt
@@ -16,8 +16,8 @@ This is similar to -Eonly.
Creating and using a PTH file for performance measurement (use a release-asserts
build).
-$ clang -x objective-c-header INPUTS/Cocoa_h.m -o /tmp/tokencache
-$ clang -token-cache /tmp/tokencache INPUTS/Cocoa_h.m
+$ clang -ccc-pch-is-pth -x objective-c-header INPUTS/Cocoa_h.m -o /tmp/tokencache
+$ clang-cc -token-cache /tmp/tokencache INPUTS/Cocoa_h.m
//===---------------------------------------------------------------------===//
diff --git a/README.txt b/README.txt
index 611dc9d2c01c..924ecc416c3a 100644
--- a/README.txt
+++ b/README.txt
@@ -1,178 +1,26 @@
//===----------------------------------------------------------------------===//
// C Language Family Front-end
//===----------------------------------------------------------------------===//
- Chris Lattner
-I. Introduction:
-
- clang: noun
- 1. A loud, resonant, metallic sound.
- 2. The strident call of a crane or goose.
- 3. C-language family front-end toolkit.
+Welcome to Clang. This is a compiler front-end for the C family of languages
+(C, C++, Objective-C, and Objective-C++) which is built as part of the LLVM
+compiler intrastructure project.
- The world needs better compiler tools, tools which are built as libraries. This
- design point allows reuse of the tools in new and novel ways. However, building
- the tools as libraries isn't enough: they must have clean APIs, be as
- decoupled from each other as possible, and be easy to modify/extend. This
- requires clean layering, decent design, and avoiding tying the libraries to a
- specific use. Oh yeah, did I mention that we want the resultant libraries to
- be as fast as possible? :)
+Unlike many other compiler frontends, Clang is useful for a number of things
+beyond just compiling code: we intend for Clang to be host to a number of
+different source level tools. One example of this is the Clang Static Analyzer.
- This front-end is built as a component of the LLVM toolkit that can be used
- with the LLVM backend or independently of it. In this spirit, the API has been
- carefully designed as the following components:
-
- libsupport - Basic support library, reused from LLVM.
+If you're interested in more (including how to build Clang) it is best to read
+the relevant web sites. Here are some pointers:
- libsystem - System abstraction library, reused from LLVM.
-
- libbasic - Diagnostics, SourceLocations, SourceBuffer abstraction,
- file system caching for input source files. This depends on
- libsupport and libsystem.
+Information on Clang: http://clang.llvm.org/
+Building and using Clang: http://clang.llvm.org/get_started.html
+Clang Static Analyzer: http://clang-analyzer.llvm.org/
+Information on the LLVM project: http://llvm.org/
- libast - Provides classes to represent the C AST, the C type system,
- builtin functions, and various helpers for analyzing and
- manipulating the AST (visitors, pretty printers, etc). This
- library depends on libbasic.
-
-
- liblex - C/C++/ObjC lexing and preprocessing, identifier hash table,
- pragma handling, tokens, and macros. This depends on libbasic.
-
- libparse - C (for now) parsing and local semantic analysis. This library
- invokes coarse-grained 'Actions' provided by the client to do
- stuff (e.g. libsema builds ASTs). This depends on liblex.
-
- libsema - Provides a set of parser actions to build a standardized AST
- for programs. AST's are 'streamed' out a top-level declaration
- at a time, allowing clients to use decl-at-a-time processing,
- build up entire translation units, or even build 'whole
- program' ASTs depending on how they use the APIs. This depends
- on libast and libparse.
-
- librewrite - Fast, scalable rewriting of source code. This operates on
- the raw syntactic text of source code, allowing a client
- to insert and delete text in very large source files using
- the same source location information embedded in ASTs. This
- is intended to be a low-level API that is useful for
- higher-level clients and libraries such as code refactoring.
-
- libanalysis - Source-level dataflow analysis useful for performing analyses
- such as computing live variables. It also includes a
- path-sensitive "graph-reachability" engine for writing
- analyses that reason about different possible paths of
- execution through source code. This is currently being
- employed to write a set of checks for finding bugs in software.
-
- libcodegen - Lower the AST to LLVM IR for optimization & codegen. Depends
- on libast.
-
- clang - An example driver, client of the libraries at various levels.
- This depends on all these libraries, and on LLVM VMCore.
-
- This front-end has been intentionally built as a DAG of libraries, making it
- easy to reuse individual parts or replace pieces if desired. For example, to
- build a preprocessor, you take the Basic and Lexer libraries. If you want an
- indexer, you take those plus the Parser library and provide some actions for
- indexing. If you want a refactoring, static analysis, or source-to-source
- compiler tool, it makes sense to take those plus the AST building and semantic
- analyzer library. Finally, if you want to use this with the LLVM backend,
- you'd take these components plus the AST to LLVM lowering code.
-
- In the future I hope this toolkit will grow to include new and interesting
- components, including a C++ front-end, ObjC support, and a whole lot of other
- things.
-
- Finally, it should be pointed out that the goal here is to build something that
- is high-quality and industrial-strength: all the obnoxious features of the C
- family must be correctly supported (trigraphs, preprocessor arcana, K&R-style
- prototypes, GCC/MS extensions, etc). It cannot be used if it is not 'real'.
-
-
-II. Usage of clang driver:
-
- * Basic Command-Line Options:
- - Help: clang --help
- - Standard GCC options accepted: -E, -I*, -i*, -pedantic, -std=c90, etc.
- - To make diagnostics more gcc-like: -fno-caret-diagnostics -fno-show-column
- - Enable metric printing: -stats
-
- * -fsyntax-only is currently the default mode.
-
- * -E mode works the same way as GCC.
-
- * -Eonly mode does all preprocessing, but does not print the output,
- useful for timing the preprocessor.
-
- * -fsyntax-only is currently partially implemented, lacking some
- semantic analysis (some errors and warnings are not produced).
-
- * -parse-noop parses code without building an AST. This is useful
- for timing the cost of the parser without including AST building
- time.
-
- * -parse-ast builds ASTs, but doesn't print them. This is most
- useful for timing AST building vs -parse-noop.
-
- * -parse-ast-print pretty prints most expression and statements nodes.
-
- * -parse-ast-check checks that diagnostic messages that are expected
- are reported and that those which are reported are expected.
-
- * -dump-cfg builds ASTs and then CFGs. CFGs are then pretty-printed.
-
- * -view-cfg builds ASTs and then CFGs. CFGs are then visualized by
- invoking Graphviz.
-
- For more information on getting Graphviz to work with clang/LLVM,
- see: http://llvm.org/docs/ProgrammersManual.html#ViewGraph
-
-
-III. Current advantages over GCC:
-
- * Column numbers are fully tracked (no 256 col limit, no GCC-style pruning).
- * All diagnostics have column numbers, includes 'caret diagnostics', and they
- highlight regions of interesting code (e.g. the LHS and RHS of a binop).
- * Full diagnostic customization by client (can format diagnostics however they
- like, e.g. in an IDE or refactoring tool) through DiagnosticClient interface.
- * Built as a framework, can be reused by multiple tools.
- * All languages supported linked into same library (no cc1,cc1obj, ...).
- * mmap's code in read-only, does not dirty the pages like GCC (mem footprint).
- * LLVM License, can be linked into non-GPL projects.
- * Full diagnostic control, per diagnostic. Diagnostics are identified by ID.
- * Significantly faster than GCC at semantic analysis, parsing, preprocessing
- and lexing.
- * Defers exposing platform-specific stuff to as late as possible, tracks use of
- platform-specific features (e.g. #ifdef PPC) to allow 'portable bytecodes'.
- * The lexer doesn't rely on the "lexer hack": it has no notion of scope and
- does not categorize identifiers as types or variables -- this is up to the
- parser to decide.
-
-Potential Future Features:
-
- * Fine grained diag control within the source (#pragma enable/disable warning).
- * Better token tracking within macros? (Token came from this line, which is
- a macro argument instantiated here, recursively instantiated here).
- * Fast #import with a module system.
- * Dependency tracking: change to header file doesn't recompile every function
- that texually depends on it: recompile only those functions that need it.
- This is aka 'incremental parsing'.
-
-
-IV. Missing Functionality / Improvements
-
-Lexer:
- * Source character mapping. GCC supports ASCII and UTF-8.
- See GCC options: -ftarget-charset and -ftarget-wide-charset.
- * Universal character support. Experimental in GCC, enabled with
- -fextended-identifiers.
- * -fpreprocessed mode.
-
-Preprocessor:
- * #assert/#unassert
- * MSExtension: "L#param" stringizes to a wide string literal.
- * Add support for -M*
-
-Traditional Preprocessor:
- * Currently, we have none. :)
+If you have questions or comments about Clang, a great place to discuss them is
+on the Clang development mailing list:
+ http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
+If you find a bug in Clang, please file it in the LLVM bug tracker:
+ http://llvm.org/bugs/
diff --git a/VER b/VER
new file mode 100644
index 000000000000..9459d4ba2a0d
--- /dev/null
+++ b/VER
@@ -0,0 +1 @@
+1.1
diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj
index 26be7bb0b719..24e1ac360f72 100644
--- a/clang.xcodeproj/project.pbxproj
+++ b/clang.xcodeproj/project.pbxproj
@@ -30,18 +30,27 @@
1A30A9E90B93A4C800201A91 /* ExprCXX.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1A30A9E80B93A4C800201A91 /* ExprCXX.h */; };
1A32C17F0E1C87AD00A6B483 /* ExprConstant.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A32C17E0E1C87AD00A6B483 /* ExprConstant.cpp */; };
1A376A2D0D4AED9B002A1C52 /* CGExprConstant.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A376A2C0D4AED9B002A1C52 /* CGExprConstant.cpp */; };
- 1A410F850FBCE51100351440 /* SemaTemplateInstantiateExpr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A410F840FBCE51100351440 /* SemaTemplateInstantiateExpr.cpp */; };
1A471AB50F437BC500753CE8 /* CGBlocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A471AB40F437BC500753CE8 /* CGBlocks.cpp */; };
- 1A5119C40FBDF71000A1FF22 /* SemaTemplateInstantiateStmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5119C30FBDF71000A1FF22 /* SemaTemplateInstantiateStmt.cpp */; };
+ 1A4C41BF105B4C0B0047B5E7 /* CGCXXClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A4C41BE105B4C0B0047B5E7 /* CGCXXClass.cpp */; };
+ 1A535ED9107BC45E000C3AE7 /* CXXInheritance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A535ED8107BC45E000C3AE7 /* CXXInheritance.cpp */; };
1A5D5E580E5E81010023C059 /* CGCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5D5E570E5E81010023C059 /* CGCXX.cpp */; };
+ 1A6B6CD410693FC900BB4A8F /* CodeCompleteConsumer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6B6CD110693FC900BB4A8F /* CodeCompleteConsumer.cpp */; };
+ 1A6B6CD510693FC900BB4A8F /* SemaCodeComplete.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6B6CD210693FC900BB4A8F /* SemaCodeComplete.cpp */; };
+ 1A6B6E9A1069833600BB4A8F /* CGCXXExpr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6B6E991069833600BB4A8F /* CGCXXExpr.cpp */; };
+ 1A6C01F7108128710072DEE4 /* CGRtti.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6C01F6108128710072DEE4 /* CGRtti.cpp */; };
1A6FE7090FD6F85800E00CA9 /* CGCXXTemp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FE7080FD6F85800E00CA9 /* CGCXXTemp.cpp */; };
1A701B640F7C8FE400FEC4D1 /* SemaAccess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A701B630F7C8FE400FEC4D1 /* SemaAccess.cpp */; };
1A7342480C7B57D500122F56 /* CGObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7342470C7B57D500122F56 /* CGObjC.cpp */; };
+ 1A81AA19108144F40094E50B /* CGVtable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A81AA18108144F40094E50B /* CGVtable.cpp */; };
1A869A700BA2164C008DA07A /* LiteralSupport.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1A869A6E0BA2164C008DA07A /* LiteralSupport.h */; };
1A869AA80BA21ABA008DA07A /* LiteralSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A869AA70BA21ABA008DA07A /* LiteralSupport.cpp */; };
+ 1AA1D91810125DE30078DEBC /* RecordLayoutBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AA1D91610125DE30078DEBC /* RecordLayoutBuilder.cpp */; };
1ABC36940C7A4BDC006DB0AB /* CGBuiltin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ABC36930C7A4BDC006DB0AB /* CGBuiltin.cpp */; };
1ADF47AF0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ADF47AE0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp */; };
+ 1AE4EE3E103B89ED00888A23 /* StmtProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE4EE3D103B89ED00888A23 /* StmtProfile.cpp */; };
+ 1AE4EE40103B8A0A00888A23 /* TargetABIInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE4EE3F103B8A0A00888A23 /* TargetABIInfo.cpp */; };
1AFEF4070F8A6B2300476F2B /* clang-cc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFEF4050F8A6B2300476F2B /* clang-cc.cpp */; };
+ 1AFF8AE31012BFC900D248DA /* CGRecordLayoutBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFF8AE11012BFC900D248DA /* CGRecordLayoutBuilder.cpp */; };
3507E4C20E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3507E4C10E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp */; };
352246E70F5C6BE000D0D279 /* HTMLDiagnostics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 352246E10F5C6BE000D0D279 /* HTMLDiagnostics.cpp */; };
352246E80F5C6BE000D0D279 /* InitHeaderSearch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 352246E20F5C6BE000D0D279 /* InitHeaderSearch.cpp */; };
@@ -66,7 +75,6 @@
35544B890F5C7FD700D92AA9 /* SimpleConstraintManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35544B860F5C7FD700D92AA9 /* SimpleConstraintManager.cpp */; };
35544B8C0F5C803200D92AA9 /* SemaTemplateInstantiate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35544B8B0F5C803200D92AA9 /* SemaTemplateInstantiate.cpp */; };
3557D1A90EB136B100C59739 /* InheritViz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3557D1A80EB136B100C59739 /* InheritViz.cpp */; };
- 3557D1F00EB13BB700C59739 /* SemaInherit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3557D1EF0EB13BB700C59739 /* SemaInherit.cpp */; };
35585DC00EAFBC4500D0A97A /* SemaOverload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35585DBE0EAFBC4500D0A97A /* SemaOverload.cpp */; };
3558F76D0E267C8300A5B0DF /* BasicStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3558F76C0E267C8300A5B0DF /* BasicStore.cpp */; };
356EF9B50C8F7DDF006650F5 /* LiveVariables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 356EF9B40C8F7DDF006650F5 /* LiveVariables.cpp */; };
@@ -92,7 +100,7 @@
35D55B270D81D8C60092E734 /* BasicValueFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35D55B240D81D8C60092E734 /* BasicValueFactory.cpp */; };
35D55B280D81D8C60092E734 /* CFRefCount.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35D55B250D81D8C60092E734 /* CFRefCount.cpp */; };
35E194690ECB82FB00F21733 /* SemaCXXScopeSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35E194670ECB82FB00F21733 /* SemaCXXScopeSpec.cpp */; };
- 35E1946A0ECB82FB00F21733 /* SemaNamedCast.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35E194680ECB82FB00F21733 /* SemaNamedCast.cpp */; };
+ 35E1946A0ECB82FB00F21733 /* SemaCXXCast.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35E194680ECB82FB00F21733 /* SemaCXXCast.cpp */; };
35E1946D0ECB83C100F21733 /* PTHLexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35E1946C0ECB83C100F21733 /* PTHLexer.cpp */; };
35EE48B10E0C4CCA00715C54 /* DeclCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35EE48AF0E0C4CCA00715C54 /* DeclCXX.cpp */; };
35EE48B20E0C4CCA00715C54 /* ParentMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35EE48B00E0C4CCA00715C54 /* ParentMap.cpp */; };
@@ -105,7 +113,22 @@
84AF36A10CB17A3B00C820A5 /* DeclObjC.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84AF36A00CB17A3B00C820A5 /* DeclObjC.h */; };
84D9A8880C1A57E100AC7ABC /* AttributeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84D9A8870C1A57E100AC7ABC /* AttributeList.cpp */; };
84D9A88C0C1A581300AC7ABC /* AttributeList.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84D9A88B0C1A581300AC7ABC /* AttributeList.h */; };
+ 9012911D1048068D0083456D /* ASTUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9012911C1048068D0083456D /* ASTUnit.cpp */; };
+ 90129121104812F90083456D /* CIndex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9012911F104812F90083456D /* CIndex.cpp */; };
906BF4B00F83BA2E001071FA /* ConvertUTF.c in Sources */ = {isa = PBXBuildFile; fileRef = 906BF4AF0F83BA2E001071FA /* ConvertUTF.c */; };
+ 90F9EFAA104ABDED00D09A15 /* c-index-test.c in Sources */ = {isa = PBXBuildFile; fileRef = 90F9EFA9104ABDED00D09A15 /* c-index-test.c */; };
+ 90FD6D7B103C3D49005F5B73 /* Analyzer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90FD6D6D103C3D49005F5B73 /* Analyzer.cpp */; };
+ 90FD6D7C103C3D49005F5B73 /* ASTLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90FD6D6E103C3D49005F5B73 /* ASTLocation.cpp */; };
+ 90FD6D7D103C3D49005F5B73 /* DeclReferenceMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90FD6D70103C3D49005F5B73 /* DeclReferenceMap.cpp */; };
+ 90FD6D7E103C3D49005F5B73 /* Entity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90FD6D71103C3D49005F5B73 /* Entity.cpp */; };
+ 90FD6D7F103C3D49005F5B73 /* GlobalSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90FD6D73103C3D49005F5B73 /* GlobalSelector.cpp */; };
+ 90FD6D80103C3D49005F5B73 /* Handlers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90FD6D74103C3D49005F5B73 /* Handlers.cpp */; };
+ 90FD6D81103C3D49005F5B73 /* Indexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90FD6D75103C3D49005F5B73 /* Indexer.cpp */; };
+ 90FD6D82103C3D49005F5B73 /* IndexProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90FD6D76103C3D49005F5B73 /* IndexProvider.cpp */; };
+ 90FD6D83103C3D49005F5B73 /* Program.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90FD6D77103C3D49005F5B73 /* Program.cpp */; };
+ 90FD6D84103C3D49005F5B73 /* ResolveLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90FD6D79103C3D49005F5B73 /* ResolveLocation.cpp */; };
+ 90FD6D85103C3D49005F5B73 /* SelectorMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90FD6D7A103C3D49005F5B73 /* SelectorMap.cpp */; };
+ 90FD6DB6103D977E005F5B73 /* index-test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90FD6DB5103D977E005F5B73 /* index-test.cpp */; };
BDF87CF70FD746F300BBF872 /* SemaTemplateDeduction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BDF87CF60FD746F300BBF872 /* SemaTemplateDeduction.cpp */; };
DE01DA490B12ADA300AC22CE /* PPCallbacks.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE01DA480B12ADA300AC22CE /* PPCallbacks.h */; };
DE06756C0C051CFE00EBBFD8 /* ParseExprCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE06756B0C051CFE00EBBFD8 /* ParseExprCXX.cpp */; };
@@ -188,8 +211,6 @@
DEB076CF0F3A222200F5A2BE /* DeclTemplate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEB076CE0F3A222200F5A2BE /* DeclTemplate.cpp */; };
DEB077990F44F97800F5A2BE /* TokenConcatenation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEB077980F44F97800F5A2BE /* TokenConcatenation.cpp */; };
DEB07AC80F4A427E00F5A2BE /* SemaAttr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEB07AC70F4A427E00F5A2BE /* SemaAttr.cpp */; };
- DEC63B1A0C7B940200DBF169 /* CFG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEC63B190C7B940200DBF169 /* CFG.cpp */; };
- DEC63B1C0C7B940600DBF169 /* CFG.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEC63B1B0C7B940600DBF169 /* CFG.h */; };
DEC8D9910A9433CD00353FCA /* Decl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEC8D9900A9433CD00353FCA /* Decl.h */; };
DEC8D9A40A94346E00353FCA /* AST.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEC8D9A30A94346E00353FCA /* AST.h */; };
DECAB0D00DB3C84200E13CCB /* RewriteRope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECAB0CF0DB3C84200E13CCB /* RewriteRope.cpp */; };
@@ -307,7 +328,6 @@
DE6951C70C4D1F5D00A5826B /* RecordLayout.h in CopyFiles */,
DE6954640C5121BD00A5826B /* Token.h in CopyFiles */,
DEF2E95F0C5FBD74000C4259 /* InternalsManual.html in CopyFiles */,
- DEC63B1C0C7B940600DBF169 /* CFG.h in CopyFiles */,
DEF7D9F70C9C8B1A0001F598 /* Rewriter.h in CopyFiles */,
84AF36A10CB17A3B00C820A5 /* DeclObjC.h in CopyFiles */,
DE3986F00CB8D4B300223765 /* IdentifierTable.h in CopyFiles */,
@@ -324,7 +344,7 @@
1A2193CC0F45EEB700C0713D /* Mangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Mangle.cpp; path = lib/CodeGen/Mangle.cpp; sourceTree = "<group>"; tabWidth = 2; };
1A2193CD0F45EEB700C0713D /* Mangle.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Mangle.h; path = lib/CodeGen/Mangle.h; sourceTree = "<group>"; tabWidth = 2; };
1A2A54A40FD1DD1C00F4CE45 /* AnalysisConsumer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnalysisConsumer.cpp; path = lib/Frontend/AnalysisConsumer.cpp; sourceTree = "<group>"; };
- 1A2A54A50FD1DD1C00F4CE45 /* ASTConsumers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASTConsumers.cpp; path = lib/Frontend/ASTConsumers.cpp; sourceTree = "<group>"; };
+ 1A2A54A50FD1DD1C00F4CE45 /* ASTConsumers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ASTConsumers.cpp; path = lib/Frontend/ASTConsumers.cpp; sourceTree = "<group>"; tabWidth = 2; };
1A2A54A60FD1DD1C00F4CE45 /* Backend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Backend.cpp; path = lib/Frontend/Backend.cpp; sourceTree = "<group>"; };
1A2A54A70FD1DD1C00F4CE45 /* CacheTokens.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CacheTokens.cpp; path = lib/Frontend/CacheTokens.cpp; sourceTree = "<group>"; };
1A2A54A80FD1DD1C00F4CE45 /* DependencyFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DependencyFile.cpp; path = lib/Frontend/DependencyFile.cpp; sourceTree = "<group>"; };
@@ -336,19 +356,25 @@
1A2A54AE0FD1DD1C00F4CE45 /* PrintPreprocessedOutput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PrintPreprocessedOutput.cpp; path = lib/Frontend/PrintPreprocessedOutput.cpp; sourceTree = "<group>"; };
1A2A54AF0FD1DD1C00F4CE45 /* RewriteBlocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteBlocks.cpp; path = lib/Frontend/RewriteBlocks.cpp; sourceTree = "<group>"; };
1A2A54B00FD1DD1C00F4CE45 /* RewriteMacros.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteMacros.cpp; path = lib/Frontend/RewriteMacros.cpp; sourceTree = "<group>"; };
- 1A2A54B10FD1DD1C00F4CE45 /* RewriteObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteObjC.cpp; path = lib/Frontend/RewriteObjC.cpp; sourceTree = "<group>"; };
+ 1A2A54B10FD1DD1C00F4CE45 /* RewriteObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteObjC.cpp; path = lib/Frontend/RewriteObjC.cpp; sourceTree = "<group>"; tabWidth = 2; };
1A2A54B20FD1DD1C00F4CE45 /* RewriteTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteTest.cpp; path = lib/Frontend/RewriteTest.cpp; sourceTree = "<group>"; };
1A2A54B30FD1DD1C00F4CE45 /* StmtXML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StmtXML.cpp; path = lib/Frontend/StmtXML.cpp; sourceTree = "<group>"; };
1A2A54B40FD1DD1C00F4CE45 /* Warnings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Warnings.cpp; path = lib/Frontend/Warnings.cpp; sourceTree = "<group>"; };
1A30A9E80B93A4C800201A91 /* ExprCXX.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ExprCXX.h; path = clang/AST/ExprCXX.h; sourceTree = "<group>"; tabWidth = 2; };
1A32C17E0E1C87AD00A6B483 /* ExprConstant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ExprConstant.cpp; path = lib/AST/ExprConstant.cpp; sourceTree = "<group>"; tabWidth = 2; };
1A376A2C0D4AED9B002A1C52 /* CGExprConstant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprConstant.cpp; path = lib/CodeGen/CGExprConstant.cpp; sourceTree = "<group>"; tabWidth = 2; };
- 1A410F840FBCE51100351440 /* SemaTemplateInstantiateExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiateExpr.cpp; path = lib/Sema/SemaTemplateInstantiateExpr.cpp; sourceTree = "<group>"; tabWidth = 2; };
1A471AB40F437BC500753CE8 /* CGBlocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGBlocks.cpp; path = lib/CodeGen/CGBlocks.cpp; sourceTree = "<group>"; tabWidth = 2; };
- 1A5119C30FBDF71000A1FF22 /* SemaTemplateInstantiateStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiateStmt.cpp; path = lib/Sema/SemaTemplateInstantiateStmt.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A4C41BE105B4C0B0047B5E7 /* CGCXXClass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCXXClass.cpp; path = lib/CodeGen/CGCXXClass.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A535ED8107BC45E000C3AE7 /* CXXInheritance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CXXInheritance.cpp; path = lib/AST/CXXInheritance.cpp; sourceTree = "<group>"; };
+ 1A535EDB107BC47B000C3AE7 /* CanonicalType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CanonicalType.h; path = clang/AST/CanonicalType.h; sourceTree = "<group>"; };
1A5D5E570E5E81010023C059 /* CGCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCXX.cpp; path = lib/CodeGen/CGCXX.cpp; sourceTree = "<group>"; tabWidth = 2; };
1A649E1D0F9599D9005B965E /* CGBlocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CGBlocks.h; path = lib/CodeGen/CGBlocks.h; sourceTree = "<group>"; };
- 1A649E1E0F9599DA005B965E /* CGCXX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CGCXX.h; path = lib/CodeGen/CGCXX.h; sourceTree = "<group>"; };
+ 1A649E1E0F9599DA005B965E /* CGCXX.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGCXX.h; path = lib/CodeGen/CGCXX.h; sourceTree = "<group>"; tabWidth = 2; };
+ 1A6B6CD110693FC900BB4A8F /* CodeCompleteConsumer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CodeCompleteConsumer.cpp; path = lib/Sema/CodeCompleteConsumer.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A6B6CD210693FC900BB4A8F /* SemaCodeComplete.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaCodeComplete.cpp; path = lib/Sema/SemaCodeComplete.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A6B6CD310693FC900BB4A8F /* SemaTemplate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = SemaTemplate.h; path = lib/Sema/SemaTemplate.h; sourceTree = "<group>"; tabWidth = 2; };
+ 1A6B6E991069833600BB4A8F /* CGCXXExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCXXExpr.cpp; path = lib/CodeGen/CGCXXExpr.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A6C01F6108128710072DEE4 /* CGRtti.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGRtti.cpp; path = lib/CodeGen/CGRtti.cpp; sourceTree = "<group>"; tabWidth = 2; };
1A6FE7080FD6F85800E00CA9 /* CGCXXTemp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCXXTemp.cpp; path = lib/CodeGen/CGCXXTemp.cpp; sourceTree = "<group>"; tabWidth = 2; };
1A7019E90F79BC1100FEC4D1 /* DiagnosticAnalysisKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticAnalysisKinds.td; sourceTree = "<group>"; };
1A7019EA0F79BC1100FEC4D1 /* DiagnosticASTKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticASTKinds.td; sourceTree = "<group>"; };
@@ -361,11 +387,21 @@
1A701B630F7C8FE400FEC4D1 /* SemaAccess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaAccess.cpp; path = lib/Sema/SemaAccess.cpp; sourceTree = "<group>"; tabWidth = 2; };
1A72BEAC0D641E9400B085E9 /* Attr.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Attr.h; path = clang/AST/Attr.h; sourceTree = "<group>"; tabWidth = 2; };
1A7342470C7B57D500122F56 /* CGObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGObjC.cpp; path = lib/CodeGen/CGObjC.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A81AA18108144F40094E50B /* CGVtable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGVtable.cpp; path = lib/CodeGen/CGVtable.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A81AA5D108278A20094E50B /* CGVtable.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGVtable.h; path = lib/CodeGen/CGVtable.h; sourceTree = "<group>"; tabWidth = 2; };
1A869A6E0BA2164C008DA07A /* LiteralSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiteralSupport.h; sourceTree = "<group>"; };
1A869AA70BA21ABA008DA07A /* LiteralSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LiteralSupport.cpp; sourceTree = "<group>"; };
+ 1AA1D91610125DE30078DEBC /* RecordLayoutBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = RecordLayoutBuilder.cpp; path = lib/AST/RecordLayoutBuilder.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1AA1D91710125DE30078DEBC /* RecordLayoutBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = RecordLayoutBuilder.h; path = lib/AST/RecordLayoutBuilder.h; sourceTree = "<group>"; tabWidth = 2; };
+ 1AB290021045858B00FE33D8 /* PartialDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = PartialDiagnostic.h; sourceTree = "<group>"; tabWidth = 2; };
1ABC36930C7A4BDC006DB0AB /* CGBuiltin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGBuiltin.cpp; path = lib/CodeGen/CGBuiltin.cpp; sourceTree = "<group>"; tabWidth = 2; };
1ADF47AE0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiateDecl.cpp; path = lib/Sema/SemaTemplateInstantiateDecl.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1AE4EE3B103B89CA00888A23 /* TreeTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = TreeTransform.h; path = lib/Sema/TreeTransform.h; sourceTree = "<group>"; tabWidth = 2; };
+ 1AE4EE3D103B89ED00888A23 /* StmtProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtProfile.cpp; path = lib/AST/StmtProfile.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1AE4EE3F103B8A0A00888A23 /* TargetABIInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = TargetABIInfo.cpp; path = lib/CodeGen/TargetABIInfo.cpp; sourceTree = "<group>"; tabWidth = 2; };
1AFEF4050F8A6B2300476F2B /* clang-cc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = "clang-cc.cpp"; path = "tools/clang-cc/clang-cc.cpp"; sourceTree = "<group>"; tabWidth = 2; };
+ 1AFF8AE11012BFC900D248DA /* CGRecordLayoutBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGRecordLayoutBuilder.cpp; path = lib/CodeGen/CGRecordLayoutBuilder.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1AFF8AE21012BFC900D248DA /* CGRecordLayoutBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGRecordLayoutBuilder.h; path = lib/CodeGen/CGRecordLayoutBuilder.h; sourceTree = "<group>"; tabWidth = 2; };
3507E4C10E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckObjCInstMethSignature.cpp; path = lib/Analysis/CheckObjCInstMethSignature.cpp; sourceTree = "<group>"; };
352246E10F5C6BE000D0D279 /* HTMLDiagnostics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLDiagnostics.cpp; path = lib/Frontend/HTMLDiagnostics.cpp; sourceTree = "<group>"; };
352246E20F5C6BE000D0D279 /* InitHeaderSearch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InitHeaderSearch.cpp; path = lib/Frontend/InitHeaderSearch.cpp; sourceTree = "<group>"; };
@@ -406,7 +442,6 @@
35544B870F5C7FD700D92AA9 /* SimpleConstraintManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SimpleConstraintManager.h; path = lib/Analysis/SimpleConstraintManager.h; sourceTree = "<group>"; };
35544B8B0F5C803200D92AA9 /* SemaTemplateInstantiate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiate.cpp; path = lib/Sema/SemaTemplateInstantiate.cpp; sourceTree = "<group>"; tabWidth = 2; };
3557D1A80EB136B100C59739 /* InheritViz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = InheritViz.cpp; path = lib/AST/InheritViz.cpp; sourceTree = "<group>"; tabWidth = 2; };
- 3557D1EF0EB13BB700C59739 /* SemaInherit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaInherit.cpp; path = lib/Sema/SemaInherit.cpp; sourceTree = "<group>"; tabWidth = 2; };
35585DBD0EAFBC4500D0A97A /* CXXFieldCollector.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CXXFieldCollector.h; path = lib/Sema/CXXFieldCollector.h; sourceTree = "<group>"; tabWidth = 2; };
35585DBE0EAFBC4500D0A97A /* SemaOverload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaOverload.cpp; path = lib/Sema/SemaOverload.cpp; sourceTree = "<group>"; tabWidth = 2; };
35585DBF0EAFBC4500D0A97A /* SemaOverload.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = SemaOverload.h; path = lib/Sema/SemaOverload.h; sourceTree = "<group>"; tabWidth = 2; };
@@ -453,7 +488,7 @@
35D55B250D81D8C60092E734 /* CFRefCount.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFRefCount.cpp; path = lib/Analysis/CFRefCount.cpp; sourceTree = "<group>"; };
35D55B290D81D8E50092E734 /* BasicValueFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BasicValueFactory.h; path = clang/Analysis/PathSensitive/BasicValueFactory.h; sourceTree = "<group>"; };
35E194670ECB82FB00F21733 /* SemaCXXScopeSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaCXXScopeSpec.cpp; path = lib/Sema/SemaCXXScopeSpec.cpp; sourceTree = "<group>"; tabWidth = 2; };
- 35E194680ECB82FB00F21733 /* SemaNamedCast.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaNamedCast.cpp; path = lib/Sema/SemaNamedCast.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 35E194680ECB82FB00F21733 /* SemaCXXCast.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaCXXCast.cpp; path = lib/Sema/SemaCXXCast.cpp; sourceTree = "<group>"; tabWidth = 2; };
35E1946C0ECB83C100F21733 /* PTHLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PTHLexer.cpp; sourceTree = "<group>"; };
35EE48AD0E0C4CB200715C54 /* DeclCXX.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclCXX.h; path = clang/AST/DeclCXX.h; sourceTree = "<group>"; tabWidth = 2; };
35EE48AE0E0C4CB200715C54 /* ParentMap.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ParentMap.h; path = clang/AST/ParentMap.h; sourceTree = "<group>"; tabWidth = 2; };
@@ -471,10 +506,15 @@
35F9B1560D1C6B2E00DDFDAE /* UninitializedValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UninitializedValues.h; path = clang/Analysis/Analyses/UninitializedValues.h; sourceTree = "<group>"; };
35FE6BCE0DF6EE1F00739712 /* DeclBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclBase.cpp; path = lib/AST/DeclBase.cpp; sourceTree = "<group>"; tabWidth = 2; };
72D16C1E0D9975C400E6DA4A /* HTMLRewrite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLRewrite.cpp; path = lib/Rewrite/HTMLRewrite.cpp; sourceTree = "<group>"; };
+ 7F270AFE107A90010031B377 /* CodeCompleteConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CodeCompleteConsumer.h; path = clang/Sema/CodeCompleteConsumer.h; sourceTree = "<group>"; };
84AF36A00CB17A3B00C820A5 /* DeclObjC.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclObjC.h; path = clang/AST/DeclObjC.h; sourceTree = "<group>"; tabWidth = 2; };
84D9A8870C1A57E100AC7ABC /* AttributeList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = AttributeList.cpp; path = lib/Parse/AttributeList.cpp; sourceTree = "<group>"; tabWidth = 2; };
84D9A88B0C1A581300AC7ABC /* AttributeList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = AttributeList.h; path = clang/Parse/AttributeList.h; sourceTree = "<group>"; tabWidth = 2; };
8DD76F6C0486A84900D96B5E /* clang */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = clang; sourceTree = BUILT_PRODUCTS_DIR; };
+ 9012911510470FCE0083456D /* Index.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Index.h; path = "clang-c/Index.h"; sourceTree = "<group>"; };
+ 9012911C1048068D0083456D /* ASTUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASTUnit.cpp; path = lib/Frontend/ASTUnit.cpp; sourceTree = "<group>"; };
+ 9012911F104812F90083456D /* CIndex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CIndex.cpp; path = tools/CIndex/CIndex.cpp; sourceTree = "<group>"; };
+ 90129120104812F90083456D /* CIndex.exports */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CIndex.exports; path = tools/CIndex/CIndex.exports; sourceTree = "<group>"; };
9063F2210F9E8BDF002F7251 /* ExternalSemaSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExternalSemaSource.h; path = clang/Sema/ExternalSemaSource.h; sourceTree = "<group>"; };
9063F2220F9E8BDF002F7251 /* SemaConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SemaConsumer.h; path = clang/Sema/SemaConsumer.h; sourceTree = "<group>"; };
9063F2280F9E911F002F7251 /* OnDiskHashTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnDiskHashTable.h; sourceTree = "<group>"; };
@@ -482,9 +522,50 @@
9063F22A0F9E911F002F7251 /* TemplateKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemplateKinds.h; sourceTree = "<group>"; };
906BF4AE0F83BA16001071FA /* ConvertUTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConvertUTF.h; sourceTree = "<group>"; };
906BF4AF0F83BA2E001071FA /* ConvertUTF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ConvertUTF.c; sourceTree = "<group>"; };
+ 90F9EFA9104ABDED00D09A15 /* c-index-test.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "c-index-test.c"; path = "tools/c-index-test/c-index-test.c"; sourceTree = "<group>"; };
90FB99DE0F98FB1D008F9415 /* DeclContextInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeclContextInternals.h; path = clang/AST/DeclContextInternals.h; sourceTree = "<group>"; };
90FB99DF0F98FB1D008F9415 /* DeclVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeclVisitor.h; path = clang/AST/DeclVisitor.h; sourceTree = "<group>"; };
90FB99E00F98FB1D008F9415 /* ExternalASTSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExternalASTSource.h; path = clang/AST/ExternalASTSource.h; sourceTree = "<group>"; };
+ 90FD6D5F103C3D21005F5B73 /* Analyzer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Analyzer.h; path = clang/Index/Analyzer.h; sourceTree = "<group>"; };
+ 90FD6D60103C3D21005F5B73 /* ASTLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTLocation.h; path = clang/Index/ASTLocation.h; sourceTree = "<group>"; };
+ 90FD6D61103C3D21005F5B73 /* DeclReferenceMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeclReferenceMap.h; path = clang/Index/DeclReferenceMap.h; sourceTree = "<group>"; };
+ 90FD6D62103C3D21005F5B73 /* Entity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Entity.h; path = clang/Index/Entity.h; sourceTree = "<group>"; };
+ 90FD6D63103C3D21005F5B73 /* GlobalSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GlobalSelector.h; path = clang/Index/GlobalSelector.h; sourceTree = "<group>"; };
+ 90FD6D64103C3D21005F5B73 /* Handlers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Handlers.h; path = clang/Index/Handlers.h; sourceTree = "<group>"; };
+ 90FD6D65103C3D21005F5B73 /* Indexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Indexer.h; path = clang/Index/Indexer.h; sourceTree = "<group>"; };
+ 90FD6D66103C3D21005F5B73 /* IndexProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IndexProvider.h; path = clang/Index/IndexProvider.h; sourceTree = "<group>"; };
+ 90FD6D67103C3D21005F5B73 /* Program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Program.h; path = clang/Index/Program.h; sourceTree = "<group>"; };
+ 90FD6D68103C3D21005F5B73 /* SelectorMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SelectorMap.h; path = clang/Index/SelectorMap.h; sourceTree = "<group>"; };
+ 90FD6D69103C3D21005F5B73 /* STLExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STLExtras.h; path = clang/Index/STLExtras.h; sourceTree = "<group>"; };
+ 90FD6D6A103C3D21005F5B73 /* TranslationUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TranslationUnit.h; path = clang/Index/TranslationUnit.h; sourceTree = "<group>"; };
+ 90FD6D6B103C3D21005F5B73 /* Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Utils.h; path = clang/Index/Utils.h; sourceTree = "<group>"; };
+ 90FD6D6D103C3D49005F5B73 /* Analyzer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Analyzer.cpp; path = lib/Index/Analyzer.cpp; sourceTree = "<group>"; };
+ 90FD6D6E103C3D49005F5B73 /* ASTLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASTLocation.cpp; path = lib/Index/ASTLocation.cpp; sourceTree = "<group>"; };
+ 90FD6D6F103C3D49005F5B73 /* ASTVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTVisitor.h; path = lib/Index/ASTVisitor.h; sourceTree = "<group>"; };
+ 90FD6D70103C3D49005F5B73 /* DeclReferenceMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DeclReferenceMap.cpp; path = lib/Index/DeclReferenceMap.cpp; sourceTree = "<group>"; };
+ 90FD6D71103C3D49005F5B73 /* Entity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Entity.cpp; path = lib/Index/Entity.cpp; sourceTree = "<group>"; };
+ 90FD6D72103C3D49005F5B73 /* EntityImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EntityImpl.h; path = lib/Index/EntityImpl.h; sourceTree = "<group>"; };
+ 90FD6D73103C3D49005F5B73 /* GlobalSelector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GlobalSelector.cpp; path = lib/Index/GlobalSelector.cpp; sourceTree = "<group>"; };
+ 90FD6D74103C3D49005F5B73 /* Handlers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Handlers.cpp; path = lib/Index/Handlers.cpp; sourceTree = "<group>"; };
+ 90FD6D75103C3D49005F5B73 /* Indexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Indexer.cpp; path = lib/Index/Indexer.cpp; sourceTree = "<group>"; };
+ 90FD6D76103C3D49005F5B73 /* IndexProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IndexProvider.cpp; path = lib/Index/IndexProvider.cpp; sourceTree = "<group>"; };
+ 90FD6D77103C3D49005F5B73 /* Program.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Program.cpp; path = lib/Index/Program.cpp; sourceTree = "<group>"; };
+ 90FD6D78103C3D49005F5B73 /* ProgramImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProgramImpl.h; path = lib/Index/ProgramImpl.h; sourceTree = "<group>"; };
+ 90FD6D79103C3D49005F5B73 /* ResolveLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ResolveLocation.cpp; path = lib/Index/ResolveLocation.cpp; sourceTree = "<group>"; };
+ 90FD6D7A103C3D49005F5B73 /* SelectorMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SelectorMap.cpp; path = lib/Index/SelectorMap.cpp; sourceTree = "<group>"; };
+ 90FD6D86103C3D80005F5B73 /* Analyses.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Analyses.def; path = clang/Frontend/Analyses.def; sourceTree = "<group>"; };
+ 90FD6D87103C3D80005F5B73 /* AnalysisConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnalysisConsumer.h; path = clang/Frontend/AnalysisConsumer.h; sourceTree = "<group>"; };
+ 90FD6D88103C3D80005F5B73 /* ASTConsumers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTConsumers.h; path = clang/Frontend/ASTConsumers.h; sourceTree = "<group>"; };
+ 90FD6D89103C3D80005F5B73 /* ASTUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTUnit.h; path = clang/Frontend/ASTUnit.h; sourceTree = "<group>"; };
+ 90FD6D8A103C3D80005F5B73 /* CommandLineSourceLoc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandLineSourceLoc.h; path = clang/Frontend/CommandLineSourceLoc.h; sourceTree = "<group>"; };
+ 90FD6D8B103C3D80005F5B73 /* DeclContextXML.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeclContextXML.def; path = clang/Frontend/DeclContextXML.def; sourceTree = "<group>"; };
+ 90FD6D8C103C3D80005F5B73 /* DeclXML.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeclXML.def; path = clang/Frontend/DeclXML.def; sourceTree = "<group>"; };
+ 90FD6D8D103C3D80005F5B73 /* DocumentXML.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DocumentXML.def; path = clang/Frontend/DocumentXML.def; sourceTree = "<group>"; };
+ 90FD6D8E103C3D80005F5B73 /* DocumentXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DocumentXML.h; path = clang/Frontend/DocumentXML.h; sourceTree = "<group>"; };
+ 90FD6D8F103C3D80005F5B73 /* StmtXML.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = StmtXML.def; path = clang/Frontend/StmtXML.def; sourceTree = "<group>"; };
+ 90FD6D90103C3D80005F5B73 /* TypeXML.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = TypeXML.def; path = clang/Frontend/TypeXML.def; sourceTree = "<group>"; };
+ 90FD6D91103C3D80005F5B73 /* Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Utils.h; path = clang/Frontend/Utils.h; sourceTree = "<group>"; };
+ 90FD6DB5103D977E005F5B73 /* index-test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "index-test.cpp"; path = "tools/index-test/index-test.cpp"; sourceTree = "<group>"; };
BDF87CF60FD746F300BBF872 /* SemaTemplateDeduction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateDeduction.cpp; path = lib/Sema/SemaTemplateDeduction.cpp; sourceTree = "<group>"; tabWidth = 2; };
DE01DA480B12ADA300AC22CE /* PPCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PPCallbacks.h; sourceTree = "<group>"; };
DE06756B0C051CFE00EBBFD8 /* ParseExprCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseExprCXX.cpp; path = lib/Parse/ParseExprCXX.cpp; sourceTree = "<group>"; tabWidth = 2; };
@@ -530,7 +611,6 @@
DE3986EF0CB8D4B300223765 /* IdentifierTable.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = IdentifierTable.h; sourceTree = "<group>"; tabWidth = 2; };
DE3986F30CB8D50C00223765 /* IdentifierTable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = IdentifierTable.cpp; sourceTree = "<group>"; tabWidth = 2; };
DE3B90DE0EAC5EF200D01046 /* ExtensionRAIIObject.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ExtensionRAIIObject.h; path = lib/Parse/ExtensionRAIIObject.h; sourceTree = "<group>"; tabWidth = 2; };
- DE3B921C0EB1A81400D01046 /* SemaInherit.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = SemaInherit.h; path = lib/Sema/SemaInherit.h; sourceTree = "<group>"; tabWidth = 2; };
DE3B92230EB5152000D01046 /* Designator.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Designator.h; path = clang/Parse/Designator.h; sourceTree = "<group>"; tabWidth = 2; };
DE41211D0D7F1BBE0080F80A /* GRWorkList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRWorkList.h; path = clang/Analysis/PathSensitive/GRWorkList.h; sourceTree = "<group>"; };
DE41211E0D7F1BBE0080F80A /* SymbolManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SymbolManager.h; path = clang/Analysis/PathSensitive/SymbolManager.h; sourceTree = "<group>"; };
@@ -603,8 +683,6 @@
DEB077980F44F97800F5A2BE /* TokenConcatenation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TokenConcatenation.cpp; sourceTree = "<group>"; };
DEB07AC70F4A427E00F5A2BE /* SemaAttr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaAttr.cpp; path = lib/Sema/SemaAttr.cpp; sourceTree = "<group>"; tabWidth = 2; };
DEB089EE0F12F1D900522C07 /* TypeTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeTraits.h; sourceTree = "<group>"; };
- DEC63B190C7B940200DBF169 /* CFG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CFG.cpp; path = lib/AST/CFG.cpp; sourceTree = "<group>"; tabWidth = 2; };
- DEC63B1B0C7B940600DBF169 /* CFG.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CFG.h; path = clang/AST/CFG.h; sourceTree = "<group>"; tabWidth = 2; };
DEC8D9900A9433CD00353FCA /* Decl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Decl.h; path = clang/AST/Decl.h; sourceTree = "<group>"; tabWidth = 2; };
DEC8D9A30A94346E00353FCA /* AST.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = AST.h; path = clang/AST/AST.h; sourceTree = "<group>"; tabWidth = 2; };
DECAB0CF0DB3C84200E13CCB /* RewriteRope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteRope.cpp; path = lib/Rewrite/RewriteRope.cpp; sourceTree = "<group>"; };
@@ -741,6 +819,7 @@
08FB7795FE84155DC02AAC07 /* Libraries */ = {
isa = PBXGroup;
children = (
+ 90FD6D6C103C3D2D005F5B73 /* Index */,
DED7D7500A5242C7003AD0FB /* Basic */,
DED7D78C0A5242E6003AD0FB /* Lex */,
DE1F22600A7D8C9B00FBF588 /* Parse */,
@@ -817,6 +896,7 @@
352246E00F5C6BC000D0D279 /* Frontend */ = {
isa = PBXGroup;
children = (
+ 9012911C1048068D0083456D /* ASTUnit.cpp */,
1A2A54A40FD1DD1C00F4CE45 /* AnalysisConsumer.cpp */,
1A2A54A50FD1DD1C00F4CE45 /* ASTConsumers.cpp */,
1A2A54A60FD1DD1C00F4CE45 /* Backend.cpp */,
@@ -957,6 +1037,80 @@
name = Analyses;
sourceTree = "<group>";
};
+ 9012911210470FAF0083456D /* clang-c */ = {
+ isa = PBXGroup;
+ children = (
+ 9012911510470FCE0083456D /* Index.h */,
+ );
+ name = "clang-c";
+ sourceTree = "<group>";
+ };
+ 9012911E104812DA0083456D /* CIndex */ = {
+ isa = PBXGroup;
+ children = (
+ 9012911F104812F90083456D /* CIndex.cpp */,
+ 90129120104812F90083456D /* CIndex.exports */,
+ );
+ name = CIndex;
+ sourceTree = "<group>";
+ };
+ 90F9EFA8104ABDC400D09A15 /* c-index-test */ = {
+ isa = PBXGroup;
+ children = (
+ 90F9EFA9104ABDED00D09A15 /* c-index-test.c */,
+ );
+ name = "c-index-test";
+ sourceTree = "<group>";
+ };
+ 90FD6D5E103C3D03005F5B73 /* Index */ = {
+ isa = PBXGroup;
+ children = (
+ 90FD6D5F103C3D21005F5B73 /* Analyzer.h */,
+ 90FD6D60103C3D21005F5B73 /* ASTLocation.h */,
+ 90FD6D61103C3D21005F5B73 /* DeclReferenceMap.h */,
+ 90FD6D62103C3D21005F5B73 /* Entity.h */,
+ 90FD6D63103C3D21005F5B73 /* GlobalSelector.h */,
+ 90FD6D64103C3D21005F5B73 /* Handlers.h */,
+ 90FD6D65103C3D21005F5B73 /* Indexer.h */,
+ 90FD6D66103C3D21005F5B73 /* IndexProvider.h */,
+ 90FD6D67103C3D21005F5B73 /* Program.h */,
+ 90FD6D68103C3D21005F5B73 /* SelectorMap.h */,
+ 90FD6D69103C3D21005F5B73 /* STLExtras.h */,
+ 90FD6D6A103C3D21005F5B73 /* TranslationUnit.h */,
+ 90FD6D6B103C3D21005F5B73 /* Utils.h */,
+ );
+ name = Index;
+ sourceTree = "<group>";
+ };
+ 90FD6D6C103C3D2D005F5B73 /* Index */ = {
+ isa = PBXGroup;
+ children = (
+ 90FD6D6D103C3D49005F5B73 /* Analyzer.cpp */,
+ 90FD6D6E103C3D49005F5B73 /* ASTLocation.cpp */,
+ 90FD6D6F103C3D49005F5B73 /* ASTVisitor.h */,
+ 90FD6D70103C3D49005F5B73 /* DeclReferenceMap.cpp */,
+ 90FD6D71103C3D49005F5B73 /* Entity.cpp */,
+ 90FD6D72103C3D49005F5B73 /* EntityImpl.h */,
+ 90FD6D73103C3D49005F5B73 /* GlobalSelector.cpp */,
+ 90FD6D74103C3D49005F5B73 /* Handlers.cpp */,
+ 90FD6D75103C3D49005F5B73 /* Indexer.cpp */,
+ 90FD6D76103C3D49005F5B73 /* IndexProvider.cpp */,
+ 90FD6D77103C3D49005F5B73 /* Program.cpp */,
+ 90FD6D78103C3D49005F5B73 /* ProgramImpl.h */,
+ 90FD6D79103C3D49005F5B73 /* ResolveLocation.cpp */,
+ 90FD6D7A103C3D49005F5B73 /* SelectorMap.cpp */,
+ );
+ name = Index;
+ sourceTree = "<group>";
+ };
+ 90FD6DB4103D9763005F5B73 /* index-test */ = {
+ isa = PBXGroup;
+ children = (
+ 90FD6DB5103D977E005F5B73 /* index-test.cpp */,
+ );
+ name = "index-test";
+ sourceTree = "<group>";
+ };
C6859E8C029090F304C91782 /* Documentation */ = {
isa = PBXGroup;
children = (
@@ -1037,6 +1191,7 @@
isa = PBXGroup;
children = (
35585DBD0EAFBC4500D0A97A /* CXXFieldCollector.h */,
+ 1A6B6CD110693FC900BB4A8F /* CodeCompleteConsumer.cpp */,
3527124F0DAFE54700C76352 /* IdentifierResolver.h */,
352712500DAFE54700C76352 /* IdentifierResolver.cpp */,
DECB6D640F9AE26600F5FBC7 /* JumpDiagnostics.cpp */,
@@ -1052,23 +1207,22 @@
35EF676F0DAD1D2C00B19414 /* SemaDeclCXX.cpp */,
DE704B250D0FBEBE009C7762 /* SemaDeclObjC.cpp */,
DE67E7100C020ED400F66BC5 /* SemaExpr.cpp */,
- DE67E70E0C020ECF00F66BC5 /* SemaExprCXX.cpp */,
DE47999B0D2EBE1A00706D2D /* SemaExprObjC.cpp */,
- 3557D1EF0EB13BB700C59739 /* SemaInherit.cpp */,
- DE3B921C0EB1A81400D01046 /* SemaInherit.h */,
+ DE67E70E0C020ECF00F66BC5 /* SemaExprCXX.cpp */,
3599299A0DE2425300A8A33E /* SemaInit.cpp */,
357EA27C0F2526F300439B60 /* SemaLookup.cpp */,
- 35E194680ECB82FB00F21733 /* SemaNamedCast.cpp */,
+ 1A6B6CD210693FC900BB4A8F /* SemaCodeComplete.cpp */,
+ 35E194680ECB82FB00F21733 /* SemaCXXCast.cpp */,
35585DBE0EAFBC4500D0A97A /* SemaOverload.cpp */,
35585DBF0EAFBC4500D0A97A /* SemaOverload.h */,
DE67E70C0C020ECA00F66BC5 /* SemaStmt.cpp */,
3591853E0EFB1088000039AF /* SemaTemplate.cpp */,
+ 1A6B6CD310693FC900BB4A8F /* SemaTemplate.h */,
BDF87CF60FD746F300BBF872 /* SemaTemplateDeduction.cpp */,
35544B8B0F5C803200D92AA9 /* SemaTemplateInstantiate.cpp */,
1ADF47AE0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp */,
- 1A410F840FBCE51100351440 /* SemaTemplateInstantiateExpr.cpp */,
- 1A5119C30FBDF71000A1FF22 /* SemaTemplateInstantiateStmt.cpp */,
DE67E70A0C020EC500F66BC5 /* SemaType.cpp */,
+ 1AE4EE3B103B89CA00888A23 /* TreeTransform.h */,
);
name = Sema;
sourceTree = "<group>";
@@ -1076,6 +1230,7 @@
DE67E7260C02108300F66BC5 /* Sema */ = {
isa = PBXGroup;
children = (
+ 7F270AFE107A90010031B377 /* CodeCompleteConsumer.h */,
9063F2210F9E8BDF002F7251 /* ExternalSemaSource.h */,
9063F2220F9E8BDF002F7251 /* SemaConsumer.h */,
DE67E7270C02109800F66BC5 /* ParseAST.h */,
@@ -1096,6 +1251,8 @@
35475B220E7997680000BFE4 /* CGCall.h */,
1A5D5E570E5E81010023C059 /* CGCXX.cpp */,
1A649E1E0F9599DA005B965E /* CGCXX.h */,
+ 1A4C41BE105B4C0B0047B5E7 /* CGCXXClass.cpp */,
+ 1A6B6E991069833600BB4A8F /* CGCXXExpr.cpp */,
1A6FE7080FD6F85800E00CA9 /* CGCXXTemp.cpp */,
35A3E7000DD3874400757F74 /* CGDebugInfo.cpp */,
35A3E7010DD3874400757F74 /* CGDebugInfo.h */,
@@ -1109,8 +1266,13 @@
DE38CD4E0D794CF900A273B6 /* CGObjCRuntime.h */,
DE38CD4F0D794D0100A273B6 /* CGObjCGNU.cpp */,
3552E7580E520DD7003A8CA5 /* CGObjCMac.cpp */,
+ 1AFF8AE11012BFC900D248DA /* CGRecordLayoutBuilder.cpp */,
+ 1AFF8AE21012BFC900D248DA /* CGRecordLayoutBuilder.h */,
+ 1A6C01F6108128710072DEE4 /* CGRtti.cpp */,
DE4772F90C10EAE5002239E8 /* CGStmt.cpp */,
35475B230E7997680000BFE4 /* CGValue.h */,
+ 1A81AA18108144F40094E50B /* CGVtable.cpp */,
+ 1A81AA5D108278A20094E50B /* CGVtable.h */,
DE928B800C0A615B00231DA4 /* CodeGenFunction.h */,
DE928B820C0A616000231DA4 /* CodeGenFunction.cpp */,
DE928B7C0C0A615100231DA4 /* CodeGenModule.h */,
@@ -1120,6 +1282,7 @@
1A2193CC0F45EEB700C0713D /* Mangle.cpp */,
1A2193CD0F45EEB700C0713D /* Mangle.h */,
DE928B120C05659200231DA4 /* ModuleBuilder.cpp */,
+ 1AE4EE3F103B8A0A00888A23 /* TargetABIInfo.cpp */,
);
name = CodeGen;
sourceTree = "<group>";
@@ -1142,10 +1305,10 @@
DE75ED280B044DC90020CF81 /* ASTContext.h */,
DEA09A6E0F31756F000C2258 /* ASTDiagnostic.h */,
1A72BEAC0D641E9400B085E9 /* Attr.h */,
+ 1A535EDB107BC47B000C3AE7 /* CanonicalType.h */,
90FB99DE0F98FB1D008F9415 /* DeclContextInternals.h */,
90FB99DF0F98FB1D008F9415 /* DeclVisitor.h */,
90FB99E00F98FB1D008F9415 /* ExternalASTSource.h */,
- DEC63B1B0C7B940600DBF169 /* CFG.h */,
DEC8D9900A9433CD00353FCA /* Decl.h */,
3538FDB60ED24A2C005EC283 /* DeclarationName.h */,
035611470DA6A45C00D2EF2A /* DeclBase.h */,
@@ -1182,7 +1345,7 @@
DE8823CA0ED0046600CBC30A /* APValue.cpp */,
35BB2D7E0D19954000944DB5 /* ASTConsumer.cpp */,
DE1732FF0B068B700080B521 /* ASTContext.cpp */,
- DEC63B190C7B940200DBF169 /* CFG.cpp */,
+ 1A535ED8107BC45E000C3AE7 /* CXXInheritance.cpp */,
35FE6BCE0DF6EE1F00739712 /* DeclBase.cpp */,
DED62ABA0AE2EDF1001E80A4 /* Decl.cpp */,
3538FDB70ED24A4E005EC283 /* DeclarationName.cpp */,
@@ -1197,10 +1360,13 @@
3557D1A80EB136B100C59739 /* InheritViz.cpp */,
DEDFE5CE0F7206E40035BD10 /* NestedNameSpecifier.cpp */,
35EE48B00E0C4CCA00715C54 /* ParentMap.cpp */,
+ 1AA1D91610125DE30078DEBC /* RecordLayoutBuilder.cpp */,
+ 1AA1D91710125DE30078DEBC /* RecordLayoutBuilder.h */,
DE3452400AEF1A2D00DBC861 /* Stmt.cpp */,
DEF2EDA60C6A4252000C4259 /* StmtDumper.cpp */,
- DE34621C0AFEB19B00DBC861 /* StmtPrinter.cpp */,
35847BE40CC7DBAF00C40FFF /* StmtIterator.cpp */,
+ DE34621C0AFEB19B00DBC861 /* StmtPrinter.cpp */,
+ 1AE4EE3D103B89ED00888A23 /* StmtProfile.cpp */,
35CFFDFF0CA1CBCB00E6F2BE /* StmtViz.cpp */,
DEDFF8870F848CF80035BD10 /* TemplateName.cpp */,
DE75EDF00B06880E0020CF81 /* Type.cpp */,
@@ -1218,9 +1384,11 @@
DE67E7260C02108300F66BC5 /* Sema */,
DE928B140C05659A00231DA4 /* CodeGen */,
356EF9AF0C8F7DA4006650F5 /* Analysis */,
+ 90FD6D5E103C3D03005F5B73 /* Index */,
DEF7D9F40C9C8B020001F598 /* Rewrite */,
DEF1615D0F65C7FC0098507F /* Frontend */,
DEF165020F8D46810098507F /* Driver */,
+ 9012911210470FAF0083456D /* clang-c */,
);
path = include;
sourceTree = "<group>";
@@ -1250,6 +1418,7 @@
9063F2280F9E911F002F7251 /* OnDiskHashTable.h */,
DE8824560ED1244600CBC30A /* OperatorKinds.def */,
DE8824530ED1243E00CBC30A /* OperatorKinds.h */,
+ 1AB290021045858B00FE33D8 /* PartialDiagnostic.h */,
DEAABDF70F5F477C0098928A /* PrettyStackTrace.h */,
DED7D7350A524295003AD0FB /* SourceLocation.h */,
DED7D7360A524295003AD0FB /* SourceManager.h */,
@@ -1339,6 +1508,9 @@
DEDFE61F0F7B3AE10035BD10 /* Tools */ = {
isa = PBXGroup;
children = (
+ 90F9EFA8104ABDC400D09A15 /* c-index-test */,
+ 9012911E104812DA0083456D /* CIndex */,
+ 90FD6DB4103D9763005F5B73 /* index-test */,
DEDFE6200F7B3AE90035BD10 /* clang-cc */,
DEDFE6210F7B3AF10035BD10 /* clang */,
);
@@ -1389,6 +1561,18 @@
DEF1615D0F65C7FC0098507F /* Frontend */ = {
isa = PBXGroup;
children = (
+ 90FD6D86103C3D80005F5B73 /* Analyses.def */,
+ 90FD6D87103C3D80005F5B73 /* AnalysisConsumer.h */,
+ 90FD6D88103C3D80005F5B73 /* ASTConsumers.h */,
+ 90FD6D89103C3D80005F5B73 /* ASTUnit.h */,
+ 90FD6D8A103C3D80005F5B73 /* CommandLineSourceLoc.h */,
+ 90FD6D8B103C3D80005F5B73 /* DeclContextXML.def */,
+ 90FD6D8C103C3D80005F5B73 /* DeclXML.def */,
+ 90FD6D8D103C3D80005F5B73 /* DocumentXML.def */,
+ 90FD6D8E103C3D80005F5B73 /* DocumentXML.h */,
+ 90FD6D8F103C3D80005F5B73 /* StmtXML.def */,
+ 90FD6D90103C3D80005F5B73 /* TypeXML.def */,
+ 90FD6D91103C3D80005F5B73 /* Utils.h */,
DEF161620F65C81C0098507F /* CompileOptions.h */,
DEF168620F9549250098507F /* FixItRewriter.h */,
DEF169220F9645960098507F /* FrontendDiagnostic.h */,
@@ -1545,7 +1729,6 @@
1ABC36940C7A4BDC006DB0AB /* CGBuiltin.cpp in Sources */,
DE224FF80C7AA98800D370A5 /* CGExprComplex.cpp in Sources */,
1A7342480C7B57D500122F56 /* CGObjC.cpp in Sources */,
- DEC63B1A0C7B940200DBF169 /* CFG.cpp in Sources */,
DE2252700C7E82D000D370A5 /* CGExprScalar.cpp in Sources */,
35260CA50C7F75C000D66CE9 /* ExprCXX.cpp in Sources */,
DE2255FC0C8004E600D370A5 /* ParseDeclCXX.cpp in Sources */,
@@ -1617,9 +1800,8 @@
35A057E30EAE2D950069249F /* SVals.cpp in Sources */,
35585DC00EAFBC4500D0A97A /* SemaOverload.cpp in Sources */,
3557D1A90EB136B100C59739 /* InheritViz.cpp in Sources */,
- 3557D1F00EB13BB700C59739 /* SemaInherit.cpp in Sources */,
35E194690ECB82FB00F21733 /* SemaCXXScopeSpec.cpp in Sources */,
- 35E1946A0ECB82FB00F21733 /* SemaNamedCast.cpp in Sources */,
+ 35E1946A0ECB82FB00F21733 /* SemaCXXCast.cpp in Sources */,
35E1946D0ECB83C100F21733 /* PTHLexer.cpp in Sources */,
3537AA0E0ECD08A4008F7CDC /* PreprocessorLexer.cpp in Sources */,
DE8823CB0ED0046600CBC30A /* APValue.cpp in Sources */,
@@ -1672,8 +1854,6 @@
DECB77790FA579B000F5FBC7 /* PCHReaderDecl.cpp in Sources */,
DECB77F70FA5850200F5FBC7 /* PCHWriterDecl.cpp in Sources */,
DECB78170FA5882F00F5FBC7 /* PCHWriterStmt.cpp in Sources */,
- 1A410F850FBCE51100351440 /* SemaTemplateInstantiateExpr.cpp in Sources */,
- 1A5119C40FBDF71000A1FF22 /* SemaTemplateInstantiateStmt.cpp in Sources */,
1A2A54B50FD1DD1C00F4CE45 /* AnalysisConsumer.cpp in Sources */,
1A2A54B60FD1DD1C00F4CE45 /* ASTConsumers.cpp in Sources */,
1A2A54B70FD1DD1C00F4CE45 /* Backend.cpp in Sources */,
@@ -1695,6 +1875,32 @@
BDF87CF70FD746F300BBF872 /* SemaTemplateDeduction.cpp in Sources */,
1A14D3A70FD78A3F00DA2835 /* DeclPrinter.cpp in Sources */,
DE37252E0FE481AD00CF2CC2 /* Builtins.cpp in Sources */,
+ 1AA1D91810125DE30078DEBC /* RecordLayoutBuilder.cpp in Sources */,
+ 1AFF8AE31012BFC900D248DA /* CGRecordLayoutBuilder.cpp in Sources */,
+ 1AE4EE3E103B89ED00888A23 /* StmtProfile.cpp in Sources */,
+ 1AE4EE40103B8A0A00888A23 /* TargetABIInfo.cpp in Sources */,
+ 90FD6D7B103C3D49005F5B73 /* Analyzer.cpp in Sources */,
+ 90FD6D7C103C3D49005F5B73 /* ASTLocation.cpp in Sources */,
+ 90FD6D7D103C3D49005F5B73 /* DeclReferenceMap.cpp in Sources */,
+ 90FD6D7E103C3D49005F5B73 /* Entity.cpp in Sources */,
+ 90FD6D7F103C3D49005F5B73 /* GlobalSelector.cpp in Sources */,
+ 90FD6D80103C3D49005F5B73 /* Handlers.cpp in Sources */,
+ 90FD6D81103C3D49005F5B73 /* Indexer.cpp in Sources */,
+ 90FD6D82103C3D49005F5B73 /* IndexProvider.cpp in Sources */,
+ 90FD6D83103C3D49005F5B73 /* Program.cpp in Sources */,
+ 90FD6D84103C3D49005F5B73 /* ResolveLocation.cpp in Sources */,
+ 90FD6D85103C3D49005F5B73 /* SelectorMap.cpp in Sources */,
+ 90FD6DB6103D977E005F5B73 /* index-test.cpp in Sources */,
+ 9012911D1048068D0083456D /* ASTUnit.cpp in Sources */,
+ 90129121104812F90083456D /* CIndex.cpp in Sources */,
+ 90F9EFAA104ABDED00D09A15 /* c-index-test.c in Sources */,
+ 1A4C41BF105B4C0B0047B5E7 /* CGCXXClass.cpp in Sources */,
+ 1A6B6CD410693FC900BB4A8F /* CodeCompleteConsumer.cpp in Sources */,
+ 1A6B6CD510693FC900BB4A8F /* SemaCodeComplete.cpp in Sources */,
+ 1A6B6E9A1069833600BB4A8F /* CGCXXExpr.cpp in Sources */,
+ 1A535ED9107BC45E000C3AE7 /* CXXInheritance.cpp in Sources */,
+ 1A6C01F7108128710072DEE4 /* CGRtti.cpp in Sources */,
+ 1A81AA19108144F40094E50B /* CGVtable.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/docs/DriverInternals.html b/docs/DriverInternals.html
index a99d72cd4eb2..a7d2da37711e 100644
--- a/docs/DriverInternals.html
+++ b/docs/DriverInternals.html
@@ -240,7 +240,7 @@
<p>Once the arguments are parsed, the tree of subprocess
jobs needed for the desired compilation sequence are
- constructed. This involves determing the input files and
+ constructed. This involves determining the input files and
their types, what work is to be done on them (preprocess,
compile, assemble, link, etc.), and constructing a list of
Action instances for each task. The result is a list of
@@ -312,7 +312,7 @@
to run. Conceptually, the driver performs a top down
matching to assign Action(s) to Tools. The ToolChain is
responsible for selecting the tool to perform a particular
- action; once seleected the driver interacts with the tool
+ action; once selected the driver interacts with the tool
to see if it can match additional actions (for example, by
having an integrated preprocessor).
@@ -397,7 +397,7 @@
<p>The driver constructs a Compilation object for each set of
command line arguments. The Driver itself is intended to be
- invariant during construct of a Compilation; an IDE should be
+ invariant during construction of a Compilation; an IDE should be
able to construct a single long lived driver instance to use
for an entire build, for example.</p>
@@ -409,7 +409,7 @@
<h4 id="int_unified_parsing">Unified Parsing &amp; Pipelining</h4>
- <p>Parsing and pipeling both occur without reference to a
+ <p>Parsing and pipelining both occur without reference to a
Compilation instance. This is by design; the driver expects that
both of these phases are platform neutral, with a few very well
defined exceptions such as whether the platform uses a driver
@@ -425,11 +425,11 @@
stop seeing some arguments the user provided, and see new ones
instead).</p>
- <p>For example, on Darwin <tt>-gfull</tt> gets translated into
- two separate arguments, <tt>-g</tt>
- and <tt>-fno-eliminate-unused-debug-symbols</tt>. Trying to
- write Tool logic to do something with <tt>-gfull</tt> will not
- work, because at Tools run after the arguments have been
+ <p>For example, on Darwin <tt>-gfull</tt> gets translated into two
+ separate arguments, <tt>-g</tt>
+ and <tt>-fno-eliminate-unused-debug-symbols</tt>. Trying to write Tool
+ logic to do something with <tt>-gfull</tt> will not work, because Tool
+ argument translation is done after the arguments have been
translated.</p>
<p>A long term goal is to remove this tool chain specific
diff --git a/docs/InternalsManual.html b/docs/InternalsManual.html
index a4d5a057ebaa..f39224f47dc5 100644
--- a/docs/InternalsManual.html
+++ b/docs/InternalsManual.html
@@ -67,6 +67,7 @@ td {
<li><a href="#Constants">Constant Folding in the Clang AST</a></li>
</ul>
</li>
+<li><a href="libIndex.html">The Index Library</a></li>
</ul>
@@ -528,12 +529,6 @@ describe the location of the characters corresponding to the token and the
location where the token was used (i.e. the macro instantiation point or the
location of the _Pragma itself).</p>
-<p>For efficiency, we only track one level of macro instantiations: if a token was
-produced by multiple instantiations, we only track the source and ultimate
-destination. Though we could track the intermediate instantiation points, this
-would require extra bookkeeping and no known client would benefit substantially
-from this.</p>
-
<p>The Clang front-end inherently depends on the location of a token being
tracked correctly. If it is ever incorrect, the front-end may get confused and
die. The reason for this is that the notion of the 'spelling' of a Token in
diff --git a/docs/LanguageExtensions.html b/docs/LanguageExtensions.html
index c855a5057a62..9ac35e1dc2dc 100644
--- a/docs/LanguageExtensions.html
+++ b/docs/LanguageExtensions.html
@@ -27,6 +27,7 @@ td {
<li><a href="#builtins">Builtin Functions</a>
<ul>
<li><a href="#__builtin_shufflevector">__builtin_shufflevector</a></li>
+ <li><a href="#__builtin_unreachable">__builtin_unreachable</a></li>
</ul>
</li>
<li><a href="#targetspecific">Target-Specific Extensions</a>
@@ -264,7 +265,7 @@ builtins that we need to implement.</p>
<h3 id="__builtin_shufflevector">__builtin_shufflevector</h3>
<!-- ======================================================================= -->
-<p><tt>__builtin_shufflevector</tt> is used to expression generic vector
+<p><tt>__builtin_shufflevector</tt> is used to express generic vector
permutation/shuffle/swizzle operations. This builtin is also very important for
the implementation of various target-specific header files like
<tt>&lt;xmmintrin.h&gt;</tt>.
@@ -310,6 +311,47 @@ with the same element type as vec1/vec2 but that has an element count equal to
the number of indices specified.
</p>
+<p>Query for this feature with __has_builtin(__builtin_shufflevector).</p>
+
+<!-- ======================================================================= -->
+<h3 id="__builtin_unreachable">__builtin_unreachable</h3>
+<!-- ======================================================================= -->
+
+<p><tt>__builtin_unreachable</tt> is used to indicate that a specific point in
+the program cannot be reached, even if the compiler might otherwise think it
+can. This is useful to improve optimization and eliminates certain warnings.
+For example, without the <tt>__builtin_unreachable</tt> in the example below,
+the compiler assumes that the inline asm can fall through and prints a "function
+declared 'noreturn' should not return" warning.
+</p>
+
+<p><b>Syntax:</b></p>
+
+<pre>
+__builtin_unreachable()
+</pre>
+
+<p><b>Example of Use:</b></p>
+
+<pre>
+void myabort(void) __attribute__((noreturn));
+void myabort(void) {
+ asm("int3");
+ __builtin_unreachable();
+}
+</pre>
+
+<p><b>Description:</b></p>
+
+<p>The __builtin_unreachable() builtin has completely undefined behavior. Since
+it has undefined behavior, it is a statement that it is never reached and the
+optimizer can take advantage of this to produce better code. This builtin takes
+no arguments and produces a void result.
+</p>
+
+<p>Query for this feature with __has_builtin(__builtin_unreachable).</p>
+
+
<!-- ======================================================================= -->
<h2 id="targetspecific">Target-Specific Extensions</h2>
<!-- ======================================================================= -->
diff --git a/docs/UsersManual.html b/docs/UsersManual.html
index 65415eea48d5..20fdda72dced 100644
--- a/docs/UsersManual.html
+++ b/docs/UsersManual.html
@@ -33,6 +33,12 @@ td {
<li><a href="#general_features">Language and Target-Independent Features</a>
<ul>
<li><a href="#diagnostics">Controlling Errors and Warnings</a></li>
+ <ul>
+ <li><a href="#diagnostics_display">Controlling How Clang Displays Diagnostics</a></li>
+ <li><a href="#diagnostics_mappings">Diagnostic Mappings</a></li>
+ <li><a href="#diagnostics_commandline">Controlling Diagnostics via Command Line Flags</a></li>
+ <li><a href="#diagnostics_pragmas">Controlling Diagnostics via Pragmas</a></li>
+ </ul>
<li><a href="#precompiledheaders">Precompiled Headers</a></li>
</ul>
</li>
@@ -362,7 +368,7 @@ by commenting them out.</p>
<p>Clang provides a number of ways to control which code constructs cause it to
emit errors and warning messages, and how they are displayed to the console.</p>
-<h4>Controlling How Clang Displays Diagnostics</h4>
+<h4 id="diagnostics_display">Controlling How Clang Displays Diagnostics</h4>
<p>When Clang emits a diagnostic, it includes rich information in the output,
and gives you fine-grain control over which information is printed. Clang has
@@ -394,18 +400,64 @@ it:</p>
<p>For more information please see <a href="#cl_diag_formatting">Formatting of
Diagnostics</a>.</p>
-<h4>Controlling Which Diagnostics Clang Generates</h4>
+<h4 id="diagnostics_mappings">Diagnostic Mappings</h4>
-<p>mappings: ignore, note, warning, error, fatal</p>
+<p>All diagnostics are mapped into one of these 5 classes:</p>
<p>
-The two major classes are control from the command line and control via pragmas
-in your code.</p>
+<ul>
+<li>Ignored</li>
+<li>Note</li>
+<li>Warning</li>
+<li>Error</li>
+<li>Fatal</li>
+</ul></p>
+<h4 id="diagnostics_commandline">Controlling Diagnostics via Command Line Flags</h4>
<p>-W flags, -pedantic, etc</p>
-<p>pragma GCC diagnostic</p>
+<h4 id="diagnostics_pragmas">Controlling Diagnostics via Pragmas</h4>
+
+<p>Clang can also control what diagnostics are enabled through the use of
+pragmas in the source code. This is useful for turning off specific warnings
+in a section of source code. Clang supports GCC's pragma for compatibility
+with existing source code, as well as several extensions. </p>
+
+<p>The pragma may control any warning that can be used from the command line.
+Warnings may be set to ignored, warning, error, or fatal. The following
+example code will tell Clang or GCC to ignore the -Wall warnings:</p>
+
+<pre>
+#pragma GCC diagnostic ignored "-Wall"
+</pre>
+
+<p>In addition to all of the functionality of provided by GCC's pragma, Clang
+also allows you to push and pop the current warning state. This is particularly
+useful when writing a header file that will be compiled by other people, because
+you don't know what warning flags they build with.</p>
+
+<p>In the below example
+-Wmultichar is ignored for only a single line of code, after which the
+diagnostics return to whatever state had previously existed.</p>
+
+<pre>
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wmultichar"
+
+char b = 'df'; // no warning.
+
+#pragma clang diagnostic pop
+</pre>
+
+<p>The push and pop pragmas will save and restore the full diagnostic state of
+the compiler, regardless of how it was set. That means that it is possible to
+use push and pop around GCC compatible diagnostics and Clang will push and pop
+them appropriately, while GCC will ignore the pushes and pops as unknown
+pragmas. It should be noted that while Clang supports the GCC pragma, Clang and
+GCC do not support the exact same set of warnings, so even when using GCC
+compatible #pragmas there is no guarantee that they will have identical behaviour
+on both compilers. </p>
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
<h3 id="precompiledheaders">Precompiled Headers</h3>
@@ -465,6 +517,50 @@ for headers that are directly included within a source file. For example:</p>
<tt>test.h</tt> since <tt>test.h</tt> was included directly in the source file
and not specified on the command line using <tt>-include</tt>.</p>
+<h4>Relocatable PCH Files</h4>
+<p>It is sometimes necessary to build a precompiled header from headers that
+are not yet in their final, installed locations. For example, one might build a
+precompiled header within the build tree that is then meant to be installed
+alongside the headers. Clang permits the creation of "relocatable" precompiled
+headers, which are built with a given path (into the build directory) and can
+later be used from an installed location.</p>
+
+<p>To build a relocatable precompiled header, place your headers into a
+subdirectory whose structure mimics the installed location. For example, if you
+want to build a precompiled header for the header <code>mylib.h</code> that
+will be installed into <code>/usr/include</code>, create a subdirectory
+<code>build/usr/include</code> and place the header <code>mylib.h</code> into
+that subdirectory. If <code>mylib.h</code> depends on other headers, then
+they can be stored within <code>build/usr/include</code> in a way that mimics
+the installed location.</p>
+
+<p>Building a relocatable precompiled header requires two additional arguments.
+First, pass the <code>--relocatable-pch</code> flag to indicate that the
+resulting PCH file should be relocatable. Second, pass
+<code>-isysroot /path/to/build</code>, which makes all includes for your
+library relative to the build directory. For example:</p>
+
+<pre>
+ # clang -x c-header --relocatable-pch -isysroot /path/to/build /path/to/build/mylib.h mylib.h.pch
+</pre>
+
+<p>When loading the relocatable PCH file, the various headers used in the PCH
+file are found from the system header root. For example, <code>mylib.h</code>
+can be found in <code>/usr/include/mylib.h</code>. If the headers are installed
+in some other system root, the <code>-isysroot</code> option can be used provide
+a different system root from which the headers will be based. For example,
+<code>-isysroot /Developer/SDKs/MacOSX10.4u.sdk</code> will look for
+<code>mylib.h</code> in
+<code>/Developer/SDKs/MacOSX10.4u.sdk/usr/include/mylib.h</code>.</p>
+
+<p>Relocatable precompiled headers are intended to be used in a limited number
+of cases where the compilation environment is tightly controlled and the
+precompiled header cannot be generated after headers have been installed.
+Relocatable precompiled headers also have some performance impact, because
+the difference in location between the header locations at PCH build time vs.
+at the time of PCH use requires one of the PCH optimizations,
+<code>stat()</code> caching, to be disabled. However, this change is only
+likely to affect PCH files that reference a large number of headers.</p>
<!-- ======================================================================= -->
<h2 id="c">C Language Features</h2>
@@ -500,7 +596,6 @@ variants "__asm__" and "__typeof__" are recognized in all modes.</li>
<li>The Apple "blocks" extension is recognized by default in gnu* modes
on some platforms; it can be enabled in any mode with the "-fblocks"
option.</li>
-<li>Some warnings are different.</li>
</ul>
<p>Differences between *89 and *99 modes:</p>
diff --git a/docs/libIndex.html b/docs/libIndex.html
new file mode 100644
index 000000000000..5693de80a868
--- /dev/null
+++ b/docs/libIndex.html
@@ -0,0 +1,267 @@
+<html>
+<head>
+ <title>The Index Library</title>
+ <link type="text/css" rel="stylesheet" href="../menu.css" />
+ <link type="text/css" rel="stylesheet" href="../content.css" />
+ <style type="text/css">
+ td {
+ vertical-align: top;
+ }
+ </style>
+</head>
+
+<body>
+
+<!--#include virtual="../menu.html.incl"-->
+
+<div id="content">
+
+<h1>The Index Library</h1>
+
+ <p><b>Table of Contents</b></p>
+ <ul>
+ <li><a href="#philosophy">Design Philosophy</a></li>
+ <li><a href="#classes">Classes</a>
+ <ul>
+ <li><a href="#entity">Entity</a></li>
+ <li><a href="#astlocation">ASTLocation</a></li>
+ <li><a href="#declreferencemap">DeclReferenceMap</a></li>
+ </ul>
+ </li>
+ <li><a href="#functions">Functions</a>
+ <ul>
+ <li><a href="#resolveloc">ResolveLocationInAST</a></li>
+ </ul>
+ </li>
+ <li><a href="#astfiles">AST Files</a></li>
+ <li><a href="#indextest">index-test tool</a>
+ <ul>
+ <li><a href="#indextestusage">Usage</a></li>
+ <li><a href="#indextestexamples">Examples</a></li>
+ </ul>
+ </li>
+</ul>
+
+<h2 id="philosophy">Design Philosophy</h2>
+
+<p> 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.</p>
+
+<p>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.</p>
+
+<h2 id="classes">Classes</h2>
+
+<h3 id="entity">Entity</h3>
+
+<p>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:</p>
+
+<p>
+t1.c:
+<pre class="code_example">
+void foo(void);
+void bar(void);
+</pre>
+</p>
+
+<p>
+t2.c:
+<pre class="code_example">
+void foo(void) {
+}
+</pre>
+</p>
+
+<p>
+Translation unit <code>t1.c</code> contains 2 Entities <code>foo</code> and <code>bar</code>, while <code>t2.c</code> contains 1 Entity <code>foo</code>.
+Entities are uniqued in such a way that the Entity* pointer for <code>t1.c/foo</code> is the same as the Entity* pointer for <code>t2.c/foo</code>.
+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:
+</p>
+<p>
+t3.c:
+<pre class="code_example">
+static void foo(void);
+</pre>
+</p>
+<p>
+there can be no Entity (if you ask for the Entity* of the static function <code>foo</code> you'll get a null pointer).
+This is for 2 reasons:
+<ul>
+<li>To preserve the invariant that the same Entity* pointers refer to the same semantic Decls.
+ In the above example <code>t1.c/foo</code> and <code>t2.c/foo</code> are the same, while <code>t3.c/foo</code> is different.</li>
+<li>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.</li>
+</ul>
+</p>
+
+<h3 id="astlocation">ASTLocation</h3>
+
+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 <code>foo</code> in the form of ASTLocations,
+"pointing" at the expressions that reference <code>foo</code>.
+
+<h3 id="declreferencemap">DeclReferenceMap</h3>
+
+Accepts an ASTContext and creates a mapping from NamedDecls to the ASTLocations that reference them (in the same ASTContext).
+
+<h2 id="functions">Functions</h2>
+
+<h3 id="resolveloc">ResolveLocationInAST</h3>
+
+A function that accepts an ASTContext and a SourceLocation which it resolves into an ASTLocation.
+
+<h2 id="astfiles">AST Files</h2>
+
+The precompiled headers implementation of clang (<a href="http://clang.llvm.org/docs/PCHInternals.html">PCH</a>) 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.
+
+<h2 id="indextest">index-test tool</h2>
+
+<h3 id="indextestusage">Usage</h3>
+
+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:
+
+<p>
+<pre class="code_example">
+ -point-at [file:line:column]
+</pre>
+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.
+</p>
+
+<p>
+<pre class="code_example">
+ -print-refs
+</pre>
+Prints the ASTLocations that reference the declaration that was resolved out of the [file:line:column] triplet
+</p>
+
+<p>
+<pre class="code_example">
+ -print-defs
+</pre>
+Prints the ASTLocations that define the resolved declaration
+</p>
+
+<p>
+<pre class="code_example">
+ -print-decls
+</pre>
+Prints the ASTLocations that declare the resolved declaration
+</p>
+
+<h3 id="indextestexamples">Examples</h3>
+
+<p>
+Here's an example of using index-test:
+</p>
+
+<p>
+We have 3 files,
+</p>
+
+<p>
+foo.h:
+<pre class="code_example">
+extern int global_var;
+
+void foo_func(int param1);
+void bar_func(void);
+</pre>
+
+t1.c:
+<pre class="code_example">
+#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();
+}
+</pre>
+
+t2.c:
+<pre class="code_example">
+#include "foo.h"
+
+int global_var = 10;
+
+void bar_func(void) {
+ global_var += 100;
+ foo_func(global_var);
+}
+</pre>
+</p>
+
+<p>
+You first get AST files out of <code>t1.c</code> and <code>t2.c</code>:
+
+<pre class="code_example">
+$ clang-cc -emit-pch t1.c -o t1.ast
+$ clang-cc -emit-pch t2.c -o t2.ast
+</pre>
+</p>
+
+<p>
+Find the ASTLocation under this position of <code>t1.c</code>:
+<pre class="code_example">
+[...]
+void foo_func(int param1) {
+ int local_var = global_var;
+ ^
+[...]
+</pre>
+
+<pre class="code_example">
+$ index-test t1.ast -point-at t1.c:4:23
+> [Decl: Var local_var | Stmt: DeclRefExpr global_var] &lt;t1.c:4:19, t1.c:4:19>
+</pre>
+</p>
+
+<p>
+Find the declaration:
+
+<pre class="code_example">
+$ index-test t1.ast -point-at t1.c:4:23 -print-decls
+> [Decl: Var global_var] &lt;foo.h:1:12, foo.h:1:12>
+</pre>
+</p>
+
+<p>
+Find the references:
+
+<pre class="code_example">
+$ index-test t1.ast t2.ast -point-at t1.c:4:23 -print-refs
+> [Decl: Var local_var | Stmt: DeclRefExpr global_var] &lt;t1.c:4:19, t1.c:4:19>
+> [Decl: Function bar_func | Stmt: DeclRefExpr global_var] &lt;t2.c:6:3, t2.c:6:3>
+> [Decl: Function bar_func | Stmt: DeclRefExpr global_var] &lt;t2.c:7:12, t2.c:7:12>
+</pre>
+</p>
+
+<p>
+Find definitions:
+
+<pre class="code_example">
+$ index-test t1.ast t2.ast -point-at t1.c:4:23 -print-defs
+> [Decl: Var global_var] &lt;t2.c:3:5, t2.c:3:18>
+</pre>
+</p>
+
+</div>
+
+</body>
+</html>
diff --git a/docs/tools/Makefile b/docs/tools/Makefile
index 90eb7768f531..12696ef0b659 100644
--- a/docs/tools/Makefile
+++ b/docs/tools/Makefile
@@ -21,6 +21,7 @@ SRC_DOC_DIR=
DST_HTML_DIR=html/
DST_MAN_DIR=man/man1/
DST_PS_DIR=ps/
+CLANG_VERSION := trunk
# If we are in BUILD_FOR_WEBSITE mode, default to the all target.
all:: html man ps
@@ -39,6 +40,8 @@ else
LEVEL := ../../../..
include $(LEVEL)/Makefile.common
+CLANG_VERSION := $(shell cat $(PROJ_SRC_DIR)/../../VER)
+
SRC_DOC_DIR=$(PROJ_SRC_DIR)/
DST_HTML_DIR=$(PROJ_OBJ_DIR)/
DST_MAN_DIR=$(PROJ_OBJ_DIR)/
@@ -66,7 +69,7 @@ $(DST_HTML_DIR)%.html: %.pod $(DST_HTML_DIR)/.dir
--podpath=. --infile=$< --outfile=$@ --title=$*
$(DST_MAN_DIR)%.1: %.pod $(DST_MAN_DIR)/.dir
- pod2man --release "clang 1.0" --center="Clang Tools Documentation" $< $@
+ pod2man --release "clang $(CLANG_VERSION)" --center="Clang Tools Documentation" $< $@
$(DST_PS_DIR)%.ps: $(DST_MAN_DIR)%.1 $(DST_PS_DIR)/.dir
groff -Tps -man $< > $@
diff --git a/docs/tools/clang.pod b/docs/tools/clang.pod
index c520f93997e5..daa738798930 100644
--- a/docs/tools/clang.pod
+++ b/docs/tools/clang.pod
@@ -378,8 +378,7 @@ Show commands to run and use verbose output.
=over
-=item
-B<-fshow-column>
+=item B<-fshow-column>
B<-fshow-source-location>
B<-fcaret-diagnostics>
B<-fdiagnostics-fixit-info>
@@ -428,13 +427,14 @@ Do not search the standard system directories for include files.
=cut
## TODO, but do we really want people using this stuff?
-=item B<-idirafter>I<directory>
-=item B<-iquote>I<directory>
-=item B<-isystem>I<directory>
-=item B<-iprefix>I<directory>
-=item B<-iwithprefix>I<directory>
-=item B<-iwithprefixbefore>I<directory>
-=item B<-isysroot>
+#=item B<-idirafter>I<directory>
+#=item B<-iquote>I<directory>
+#=item B<-isystem>I<directory>
+#=item B<-iprefix>I<directory>
+#=item B<-iwithprefix>I<directory>
+#=item B<-iwithprefixbefore>I<directory>
+#=item B<-isysroot>
+
=pod
@@ -445,21 +445,21 @@ Do not search the standard system directories for include files.
=cut
### TODO someday.
-=head2 Warning Control Options
-=over
-=back
-=head2 Code Generation and Optimization Options
-=over
-=back
-=head2 Assembler Options
-=over
-=back
-=head2 Linker Options
-=over
-=back
-=head2 Static Analyzer Options
-=over
-=back
+#=head2 Warning Control Options
+#=over
+#=back
+#=head2 Code Generation and Optimization Options
+#=over
+#=back
+#=head2 Assembler Options
+#=over
+#=back
+#=head2 Linker Options
+#=over
+#=back
+#=head2 Static Analyzer Options
+#=over
+#=back
=pod
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
new file mode 100644
index 000000000000..3178017e45be
--- /dev/null
+++ b/include/clang-c/Index.h
@@ -0,0 +1,220 @@
+/*===-- clang-c/Index.h - Indexing Public C Interface -------------*- C -*-===*\
+|* *|
+|* The LLVM Compiler Infrastructure *|
+|* *|
+|* This file is distributed under the University of Illinois Open Source *|
+|* License. See LICENSE.TXT for details. *|
+|* *|
+|*===----------------------------------------------------------------------===*|
+|* *|
+|* This header provides a public inferface to a Clang library for extracting *|
+|* high-level symbol information from source files without exposing the full *|
+|* Clang C++ API. *|
+|* *|
+\*===----------------------------------------------------------------------===*/
+
+#ifndef CLANG_C_INDEX_H
+#define CLANG_C_INDEX_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ Clang indeX abstractions. The backing store for the following API's will be
+ clangs AST file (currently based on PCH). AST files are created as follows:
+
+ "clang -emit-ast <sourcefile.langsuffix> -o <sourcefile.ast>".
+
+ Naming Conventions: To avoid namespace pollution, data types are prefixed
+ with "CX" and functions are prefixed with "clang_".
+*/
+typedef void *CXIndex; /* An indexing instance. */
+
+typedef void *CXTranslationUnit; /* A translation unit instance. */
+
+typedef void *CXDecl; /* A specific declaration within a translation unit. */
+typedef void *CXStmt; /* A specific statement within a function/method */
+
+/* Cursors represent declarations, definitions, and references. */
+enum CXCursorKind {
+ /* Declarations */
+ CXCursor_FirstDecl = 1,
+ CXCursor_TypedefDecl = 2,
+ CXCursor_StructDecl = 3,
+ CXCursor_UnionDecl = 4,
+ CXCursor_ClassDecl = 5,
+ CXCursor_EnumDecl = 6,
+ CXCursor_FieldDecl = 7,
+ CXCursor_EnumConstantDecl = 8,
+ CXCursor_FunctionDecl = 9,
+ CXCursor_VarDecl = 10,
+ CXCursor_ParmDecl = 11,
+ CXCursor_ObjCInterfaceDecl = 12,
+ CXCursor_ObjCCategoryDecl = 13,
+ CXCursor_ObjCProtocolDecl = 14,
+ CXCursor_ObjCPropertyDecl = 15,
+ CXCursor_ObjCIvarDecl = 16,
+ CXCursor_ObjCInstanceMethodDecl = 17,
+ CXCursor_ObjCClassMethodDecl = 18,
+ CXCursor_LastDecl = 18,
+
+ /* Definitions */
+ CXCursor_FirstDefn = 32,
+ CXCursor_FunctionDefn = 32,
+ CXCursor_ObjCClassDefn = 33,
+ CXCursor_ObjCCategoryDefn = 34,
+ CXCursor_ObjCInstanceMethodDefn = 35,
+ CXCursor_ObjCClassMethodDefn = 36,
+ CXCursor_LastDefn = 36,
+
+ /* References */
+ CXCursor_FirstRef = 40, /* Decl references */
+ CXCursor_ObjCSuperClassRef = 40,
+ CXCursor_ObjCProtocolRef = 41,
+ CXCursor_ObjCClassRef = 42,
+
+ CXCursor_ObjCSelectorRef = 43, /* Expression references */
+ CXCursor_ObjCIvarRef = 44,
+ CXCursor_VarRef = 45,
+ CXCursor_FunctionRef = 46,
+ CXCursor_EnumConstantRef = 47,
+ CXCursor_MemberRef = 48,
+ CXCursor_LastRef = 48,
+
+ /* Error conditions */
+ CXCursor_FirstInvalid = 70,
+ CXCursor_InvalidFile = 70,
+ CXCursor_NoDeclFound = 71,
+ CXCursor_NotImplemented = 72,
+ CXCursor_LastInvalid = 72
+};
+
+/* A cursor into the CXTranslationUnit. */
+
+typedef struct {
+ enum CXCursorKind kind;
+ CXDecl decl;
+ CXStmt stmt; /* expression reference */
+} CXCursor;
+
+/* A unique token for looking up "visible" CXDecls from a CXTranslationUnit. */
+typedef void *CXEntity;
+
+CXIndex clang_createIndex();
+void clang_disposeIndex(CXIndex);
+
+const char *clang_getTranslationUnitSpelling(CXTranslationUnit CTUnit);
+
+CXTranslationUnit clang_createTranslationUnit(
+ CXIndex, const char *ast_filename
+);
+void clang_disposeTranslationUnit(CXTranslationUnit);
+
+/*
+ Usage: clang_loadTranslationUnit(). Will load the toplevel declarations
+ within a translation unit, issuing a 'callback' for each one.
+
+ void printObjCInterfaceNames(CXTranslationUnit X, CXCursor C) {
+ if (clang_getCursorKind(C) == Cursor_Declaration) {
+ CXDecl D = clang_getCursorDecl(C);
+ if (clang_getDeclKind(D) == CXDecl_ObjC_interface)
+ printf("@interface %s in file %s on line %d column %d\n",
+ clang_getDeclSpelling(D), clang_getCursorSource(C),
+ clang_getCursorLine(C), clang_getCursorColumn(C));
+ }
+ }
+ static void usage {
+ clang_loadTranslationUnit(CXTranslationUnit, printObjCInterfaceNames);
+ }
+*/
+typedef void *CXClientData;
+typedef void (*CXTranslationUnitIterator)(CXTranslationUnit, CXCursor,
+ CXClientData);
+void clang_loadTranslationUnit(CXTranslationUnit, CXTranslationUnitIterator,
+ CXClientData);
+
+/*
+ Usage: clang_loadDeclaration(). Will load the declaration, issuing a
+ 'callback' for each declaration/reference within the respective declaration.
+
+ For interface declarations, this will index the super class, protocols,
+ ivars, methods, etc. For structure declarations, this will index the fields.
+ For functions, this will index the parameters (and body, for function
+ definitions), local declarations/references.
+
+ void getInterfaceDetails(CXDecl X, CXCursor C) {
+ switch (clang_getCursorKind(C)) {
+ case Cursor_ObjC_ClassRef:
+ CXDecl SuperClass = clang_getCursorDecl(C);
+ case Cursor_ObjC_ProtocolRef:
+ CXDecl AdoptsProtocol = clang_getCursorDecl(C);
+ case Cursor_Declaration:
+ CXDecl AnIvarOrMethod = clang_getCursorDecl(C);
+ }
+ }
+ static void usage() {
+ if (clang_getDeclKind(D) == CXDecl_ObjC_interface) {
+ clang_loadDeclaration(D, getInterfaceDetails);
+ }
+ }
+*/
+typedef void (*CXDeclIterator)(CXDecl, CXCursor, CXClientData);
+
+void clang_loadDeclaration(CXDecl, CXDeclIterator, CXClientData);
+
+/*
+ * CXEntity Operations.
+ */
+const char *clang_getDeclarationName(CXEntity);
+const char *clang_getURI(CXEntity);
+CXEntity clang_getEntity(const char *URI);
+/*
+ * CXDecl Operations.
+ */
+CXCursor clang_getCursorFromDecl(CXDecl);
+CXEntity clang_getEntityFromDecl(CXDecl);
+const char *clang_getDeclSpelling(CXDecl);
+unsigned clang_getDeclLine(CXDecl);
+unsigned clang_getDeclColumn(CXDecl);
+const char *clang_getDeclSource(CXDecl);
+
+/*
+ * CXCursor Operations.
+ */
+CXCursor clang_getCursor(CXTranslationUnit, const char *source_name,
+ unsigned line, unsigned column);
+
+enum CXCursorKind clang_getCursorKind(CXCursor);
+unsigned clang_isDeclaration(enum CXCursorKind);
+unsigned clang_isReference(enum CXCursorKind);
+unsigned clang_isDefinition(enum CXCursorKind);
+unsigned clang_isInvalid(enum CXCursorKind);
+
+unsigned clang_getCursorLine(CXCursor);
+unsigned clang_getCursorColumn(CXCursor);
+const char *clang_getCursorSource(CXCursor);
+const char *clang_getCursorSpelling(CXCursor);
+
+/* for debug/testing */
+const char *clang_getCursorKindSpelling(enum CXCursorKind Kind);
+void clang_getDefinitionSpellingAndExtent(CXCursor,
+ const char **startBuf,
+ const char **endBuf,
+ unsigned *startLine,
+ unsigned *startColumn,
+ unsigned *endLine,
+ unsigned *endColumn);
+
+/*
+ * If CXCursorKind == Cursor_Reference, then this will return the referenced
+ * declaration.
+ * If CXCursorKind == Cursor_Declaration, then this will return the declaration.
+ */
+CXDecl clang_getCursorDecl(CXCursor);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
diff --git a/include/clang/AST/APValue.h b/include/clang/AST/APValue.h
index 5d5abfe011d4..94d258d9e4e6 100644
--- a/include/clang/AST/APValue.h
+++ b/include/clang/AST/APValue.h
@@ -37,16 +37,16 @@ public:
};
private:
ValueKind Kind;
-
- struct ComplexAPSInt {
- APSInt Real, Imag;
+
+ struct ComplexAPSInt {
+ APSInt Real, Imag;
ComplexAPSInt() : Real(1), Imag(1) {}
};
struct ComplexAPFloat {
APFloat Real, Imag;
ComplexAPFloat() : Real(0.0), Imag(0.0) {}
};
-
+
struct LV {
Expr* Base;
uint64_t Offset;
@@ -57,16 +57,17 @@ private:
Vec() : Elts(0), NumElts(0) {}
~Vec() { delete[] Elts; }
};
-
+
enum {
- MaxSize = (sizeof(ComplexAPSInt) > sizeof(ComplexAPFloat) ?
+ MaxSize = (sizeof(ComplexAPSInt) > sizeof(ComplexAPFloat) ?
sizeof(ComplexAPSInt) : sizeof(ComplexAPFloat))
};
-
- /// Data - space for the largest member in units of void*. This is an effort
- /// to ensure that the APSInt/APFloat values have proper alignment.
- void *Data[(MaxSize+sizeof(void*)-1)/sizeof(void*)];
-
+
+ union {
+ void *Aligner;
+ char Data[MaxSize];
+ };
+
public:
APValue() : Kind(Uninitialized) {}
explicit APValue(const APSInt &I) : Kind(Uninitialized) {
@@ -93,7 +94,7 @@ public:
~APValue() {
MakeUninit();
}
-
+
ValueKind getKind() const { return Kind; }
bool isUninit() const { return Kind == Uninitialized; }
bool isInt() const { return Kind == Int; }
@@ -102,54 +103,54 @@ public:
bool isComplexFloat() const { return Kind == ComplexFloat; }
bool isLValue() const { return Kind == LValue; }
bool isVector() const { return Kind == Vector; }
-
+
void print(llvm::raw_ostream &OS) const;
void dump() const;
-
+
APSInt &getInt() {
assert(isInt() && "Invalid accessor");
- return *(APSInt*)(void*)Data;
+ return *(APSInt*)(char*)Data;
}
const APSInt &getInt() const {
return const_cast<APValue*>(this)->getInt();
}
-
+
APFloat &getFloat() {
assert(isFloat() && "Invalid accessor");
- return *(APFloat*)(void*)Data;
+ return *(APFloat*)(char*)Data;
}
const APFloat &getFloat() const {
return const_cast<APValue*>(this)->getFloat();
}
-
+
APValue &getVectorElt(unsigned i) const {
assert(isVector() && "Invalid accessor");
- return ((Vec*)(void*)Data)->Elts[i];
+ return ((Vec*)(char*)Data)->Elts[i];
}
unsigned getVectorLength() const {
assert(isVector() && "Invalid accessor");
return ((Vec*)(void *)Data)->NumElts;
}
-
+
APSInt &getComplexIntReal() {
assert(isComplexInt() && "Invalid accessor");
- return ((ComplexAPSInt*)(void*)Data)->Real;
+ return ((ComplexAPSInt*)(char*)Data)->Real;
}
const APSInt &getComplexIntReal() const {
return const_cast<APValue*>(this)->getComplexIntReal();
}
-
+
APSInt &getComplexIntImag() {
assert(isComplexInt() && "Invalid accessor");
- return ((ComplexAPSInt*)(void*)Data)->Imag;
+ return ((ComplexAPSInt*)(char*)Data)->Imag;
}
const APSInt &getComplexIntImag() const {
return const_cast<APValue*>(this)->getComplexIntImag();
}
-
+
APFloat &getComplexFloatReal() {
assert(isComplexFloat() && "Invalid accessor");
- return ((ComplexAPFloat*)(void*)Data)->Real;
+ return ((ComplexAPFloat*)(char*)Data)->Real;
}
const APFloat &getComplexFloatReal() const {
return const_cast<APValue*>(this)->getComplexFloatReal();
@@ -157,7 +158,7 @@ public:
APFloat &getComplexFloatImag() {
assert(isComplexFloat() && "Invalid accessor");
- return ((ComplexAPFloat*)(void*)Data)->Imag;
+ return ((ComplexAPFloat*)(char*)Data)->Imag;
}
const APFloat &getComplexFloatImag() const {
return const_cast<APValue*>(this)->getComplexFloatImag();
@@ -171,44 +172,44 @@ public:
assert(isLValue() && "Invalid accessor");
return ((const LV*)(const void*)Data)->Offset;
}
-
+
void setInt(const APSInt &I) {
assert(isInt() && "Invalid accessor");
- *(APSInt*)(void*)Data = I;
+ *(APSInt*)(char*)Data = I;
}
void setFloat(const APFloat &F) {
assert(isFloat() && "Invalid accessor");
- *(APFloat*)(void*)Data = F;
+ *(APFloat*)(char*)Data = F;
}
void setVector(const APValue *E, unsigned N) {
assert(isVector() && "Invalid accessor");
- ((Vec*)(void*)Data)->Elts = new APValue[N];
- ((Vec*)(void*)Data)->NumElts = N;
+ ((Vec*)(char*)Data)->Elts = new APValue[N];
+ ((Vec*)(char*)Data)->NumElts = N;
for (unsigned i = 0; i != N; ++i)
- ((Vec*)(void*)Data)->Elts[i] = E[i];
+ ((Vec*)(char*)Data)->Elts[i] = E[i];
}
void setComplexInt(const APSInt &R, const APSInt &I) {
- assert(R.getBitWidth() == I.getBitWidth() &&
+ assert(R.getBitWidth() == I.getBitWidth() &&
"Invalid complex int (type mismatch).");
assert(isComplexInt() && "Invalid accessor");
- ((ComplexAPSInt*)(void*)Data)->Real = R;
- ((ComplexAPSInt*)(void*)Data)->Imag = I;
+ ((ComplexAPSInt*)(char*)Data)->Real = R;
+ ((ComplexAPSInt*)(char*)Data)->Imag = I;
}
void setComplexFloat(const APFloat &R, const APFloat &I) {
- assert(&R.getSemantics() == &I.getSemantics() &&
+ assert(&R.getSemantics() == &I.getSemantics() &&
"Invalid complex float (type mismatch).");
assert(isComplexFloat() && "Invalid accessor");
- ((ComplexAPFloat*)(void*)Data)->Real = R;
- ((ComplexAPFloat*)(void*)Data)->Imag = I;
+ ((ComplexAPFloat*)(char*)Data)->Real = R;
+ ((ComplexAPFloat*)(char*)Data)->Imag = I;
}
void setLValue(Expr *B, uint64_t O) {
assert(isLValue() && "Invalid accessor");
- ((LV*)(void*)Data)->Base = B;
- ((LV*)(void*)Data)->Offset = O;
+ ((LV*)(char*)Data)->Base = B;
+ ((LV*)(char*)Data)->Offset = O;
}
-
+
const APValue &operator=(const APValue &RHS);
-
+
private:
void MakeUninit();
void MakeInt() {
@@ -218,27 +219,27 @@ private:
}
void MakeFloat() {
assert(isUninit() && "Bad state change");
- new ((APFloat*)(void*)Data) APFloat(0.0);
+ new ((void*)(char*)Data) APFloat(0.0);
Kind = Float;
}
void MakeVector() {
assert(isUninit() && "Bad state change");
- new ((Vec*)(void*)Data) Vec();
+ new ((void*)(char*)Data) Vec();
Kind = Vector;
}
void MakeComplexInt() {
assert(isUninit() && "Bad state change");
- new ((ComplexAPSInt*)(void*)Data) ComplexAPSInt();
+ new ((void*)(char*)Data) ComplexAPSInt();
Kind = ComplexInt;
}
void MakeComplexFloat() {
assert(isUninit() && "Bad state change");
- new ((ComplexAPFloat*)(void*)Data) ComplexAPFloat();
+ new ((void*)(char*)Data) ComplexAPFloat();
Kind = ComplexFloat;
}
void MakeLValue() {
assert(isUninit() && "Bad state change");
- new ((LV*)(void*)Data) LV();
+ new ((void*)(char*)Data) LV();
Kind = LValue;
}
};
@@ -247,7 +248,7 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const APValue &V) {
V.print(OS);
return OS;
}
-
+
} // end namespace clang.
#endif
diff --git a/include/clang/AST/ASTConsumer.h b/include/clang/AST/ASTConsumer.h
index 6dc7e13d8f70..af6bf30b6882 100644
--- a/include/clang/AST/ASTConsumer.h
+++ b/include/clang/AST/ASTConsumer.h
@@ -36,27 +36,27 @@ public:
ASTConsumer() : SemaConsumer(false) { }
virtual ~ASTConsumer() {}
-
+
/// Initialize - This is called to initialize the consumer, providing the
/// ASTContext and the Action.
virtual void Initialize(ASTContext &Context) {}
-
+
/// HandleTopLevelDecl - Handle the specified top-level declaration. This is
/// called by the parser to process every top-level Decl*. Note that D can
/// be the head of a chain of Decls (e.g. for `int a, b` the chain will have
/// two elements). Use Decl::getNextDeclarator() to walk the chain.
virtual void HandleTopLevelDecl(DeclGroupRef D);
-
+
/// HandleTranslationUnit - This method is called when the ASTs for entire
/// translation unit have been parsed.
- virtual void HandleTranslationUnit(ASTContext &Ctx) {}
-
+ virtual void HandleTranslationUnit(ASTContext &Ctx) {}
+
/// HandleTagDeclDefinition - This callback is invoked each time a TagDecl
/// (e.g. struct, union, enum, class) is completed. This allows the client to
/// hack on the type, which can occur at any point in the file (because these
/// can be defined in declspecs).
virtual void HandleTagDeclDefinition(TagDecl *D) {}
-
+
/// \brief Callback invoked at the end of a translation unit to
/// notify the consumer that the given tentative definition should
/// be completed.
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h
index 041a0f33ad4d..63f909146e92 100644
--- a/include/clang/AST/ASTContext.h
+++ b/include/clang/AST/ASTContext.h
@@ -22,6 +22,7 @@
#include "clang/AST/PrettyPrinter.h"
#include "clang/AST/TemplateName.h"
#include "clang/AST/Type.h"
+#include "clang/AST/CanonicalType.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/OwningPtr.h"
@@ -43,24 +44,26 @@ namespace clang {
class TargetInfo;
// Decls
class Decl;
+ class FieldDecl;
+ class ObjCIvarDecl;
+ class ObjCIvarRefExpr;
class ObjCPropertyDecl;
class RecordDecl;
class TagDecl;
+ class TemplateTypeParmDecl;
class TranslationUnitDecl;
class TypeDecl;
class TypedefDecl;
- class TemplateTypeParmDecl;
- class FieldDecl;
- class ObjCIvarRefExpr;
- class ObjCIvarDecl;
-
+ class UnresolvedUsingDecl;
+ class UsingDecl;
+
namespace Builtin { class Context; }
-
+
/// ASTContext - This class holds long-lived AST nodes (such as types and
/// decls) that can be referred to throughout the semantic analysis of a file.
-class ASTContext {
+class ASTContext {
std::vector<Type*> Types;
- llvm::FoldingSet<ExtQualType> ExtQualTypes;
+ llvm::FoldingSet<ExtQuals> ExtQualNodes;
llvm::FoldingSet<ComplexType> ComplexTypes;
llvm::FoldingSet<PointerType> PointerTypes;
llvm::FoldingSet<BlockPointerType> BlockPointerTypes;
@@ -70,17 +73,21 @@ class ASTContext {
llvm::FoldingSet<ConstantArrayType> ConstantArrayTypes;
llvm::FoldingSet<IncompleteArrayType> IncompleteArrayTypes;
std::vector<VariableArrayType*> VariableArrayTypes;
- std::vector<DependentSizedArrayType*> DependentSizedArrayTypes;
- std::vector<DependentSizedExtVectorType*> DependentSizedExtVectorTypes;
+ llvm::FoldingSet<DependentSizedArrayType> DependentSizedArrayTypes;
+ llvm::FoldingSet<DependentSizedExtVectorType> DependentSizedExtVectorTypes;
llvm::FoldingSet<VectorType> VectorTypes;
llvm::FoldingSet<FunctionNoProtoType> FunctionNoProtoTypes;
llvm::FoldingSet<FunctionProtoType> FunctionProtoTypes;
+ llvm::FoldingSet<DependentTypeOfExprType> DependentTypeOfExprTypes;
+ llvm::FoldingSet<DependentDecltypeType> DependentDecltypeTypes;
llvm::FoldingSet<TemplateTypeParmType> TemplateTypeParmTypes;
llvm::FoldingSet<TemplateSpecializationType> TemplateSpecializationTypes;
llvm::FoldingSet<QualifiedNameType> QualifiedNameTypes;
llvm::FoldingSet<TypenameType> TypenameTypes;
- llvm::FoldingSet<ObjCQualifiedInterfaceType> ObjCQualifiedInterfaceTypes;
+ llvm::FoldingSet<ObjCInterfaceType> ObjCInterfaceTypes;
llvm::FoldingSet<ObjCObjectPointerType> ObjCObjectPointerTypes;
+ llvm::FoldingSet<ObjCProtocolListType> ObjCProtocolListTypes;
+ llvm::FoldingSet<ElaboratedType> ElaboratedTypes;
llvm::FoldingSet<QualifiedTemplateName> QualifiedTemplateNames;
llvm::FoldingSet<DependentTemplateName> DependentTemplateNames;
@@ -97,46 +104,109 @@ class ASTContext {
llvm::DenseMap<const RecordDecl*, const ASTRecordLayout*> ASTRecordLayouts;
llvm::DenseMap<const ObjCContainerDecl*, const ASTRecordLayout*> ObjCLayouts;
+ /// \brief Mapping from ObjCContainers to their ObjCImplementations.
+ llvm::DenseMap<ObjCContainerDecl*, ObjCImplDecl*> ObjCImpls;
+
llvm::DenseMap<unsigned, FixedWidthIntType*> SignedFixedWidthIntTypes;
llvm::DenseMap<unsigned, FixedWidthIntType*> UnsignedFixedWidthIntTypes;
-
+
/// BuiltinVaListType - built-in va list type.
/// This is initially null and set by Sema::LazilyCreateBuiltin when
/// a builtin that takes a valist is encountered.
QualType BuiltinVaListType;
/// ObjCIdType - a pseudo built-in typedef type (set by Sema).
- QualType ObjCIdType;
- const RecordType *IdStructType;
-
+ QualType ObjCIdTypedefType;
+
/// ObjCSelType - another pseudo built-in typedef type (set by Sema).
QualType ObjCSelType;
const RecordType *SelStructType;
-
+
/// ObjCProtoType - another pseudo built-in typedef type (set by Sema).
QualType ObjCProtoType;
const RecordType *ProtoStructType;
/// ObjCClassType - another pseudo built-in typedef type (set by Sema).
- QualType ObjCClassType;
- const RecordType *ClassStructType;
-
+ QualType ObjCClassTypedefType;
+
QualType ObjCConstantStringType;
RecordDecl *CFConstantStringTypeDecl;
RecordDecl *ObjCFastEnumerationStateTypeDecl;
-
- /// \brief Keeps track of all declaration attributes.
+
+ /// \brief The type for the C FILE type.
+ TypeDecl *FILEDecl;
+
+ /// \brief The type for the C jmp_buf type.
+ TypeDecl *jmp_bufDecl;
+
+ /// \brief The type for the C sigjmp_buf type.
+ TypeDecl *sigjmp_bufDecl;
+
+ /// \brief Keeps track of all declaration attributes.
///
/// Since so few decls have attrs, we keep them in a hash map instead of
/// wasting space in the Decl class.
llvm::DenseMap<const Decl*, Attr*> DeclAttrs;
-
+
+ /// \brief Keeps track of the static data member templates from which
+ /// static data members of class template specializations were instantiated.
+ ///
+ /// This data structure stores the mapping from instantiations of static
+ /// data members to the static data member representations within the
+ /// class template from which they were instantiated along with the kind
+ /// of instantiation or specialization (a TemplateSpecializationKind - 1).
+ ///
+ /// Given the following example:
+ ///
+ /// \code
+ /// template<typename T>
+ /// struct X {
+ /// static T value;
+ /// };
+ ///
+ /// template<typename T>
+ /// T X<T>::value = T(17);
+ ///
+ /// int *x = &X<int>::value;
+ /// \endcode
+ ///
+ /// This mapping will contain an entry that maps from the VarDecl for
+ /// X<int>::value to the corresponding VarDecl for X<T>::value (within the
+ /// class template X) and will be marked TSK_ImplicitInstantiation.
+ llvm::DenseMap<VarDecl *, MemberSpecializationInfo *>
+ InstantiatedFromStaticDataMember;
+
+ /// \brief Keeps track of the UnresolvedUsingDecls from which UsingDecls
+ /// where created during instantiation.
+ ///
+ /// For example:
+ /// \code
+ /// template<typename T>
+ /// struct A {
+ /// void f();
+ /// };
+ ///
+ /// template<typename T>
+ /// struct B : A<T> {
+ /// using A<T>::f;
+ /// };
+ ///
+ /// template struct B<int>;
+ /// \endcode
+ ///
+ /// This mapping will contain an entry that maps from the UsingDecl in
+ /// B<int> to the UnresolvedUsingDecl in B<T>.
+ llvm::DenseMap<UsingDecl *, UnresolvedUsingDecl *>
+ InstantiatedFromUnresolvedUsingDecl;
+
+ llvm::DenseMap<FieldDecl *, FieldDecl *> InstantiatedFromUnnamedFieldDecl;
+
TranslationUnitDecl *TUDecl;
/// SourceMgr - The associated SourceManager object.
SourceManager &SourceMgr;
-
+
/// LangOpts - The language options used to create the AST associated with
/// this ASTContext object.
LangOptions LangOpts;
@@ -144,17 +214,17 @@ class ASTContext {
/// \brief Whether we have already loaded comment source ranges from an
/// external source.
bool LoadedExternalComments;
-
+
/// MallocAlloc/BumpAlloc - The allocator objects used to create AST objects.
bool FreeMemory;
llvm::MallocAllocator MallocAlloc;
llvm::BumpPtrAllocator BumpAlloc;
-
+
/// \brief Mapping from declarations to their comments, once we have
/// already looked up the comment associated with a given declaration.
llvm::DenseMap<const Decl *, std::string> DeclComments;
-
-public:
+
+public:
TargetInfo &Target;
IdentifierTable &Idents;
SelectorTable &Selectors;
@@ -163,41 +233,73 @@ public:
llvm::OwningPtr<ExternalASTSource> ExternalSource;
clang::PrintingPolicy PrintingPolicy;
+ // Typedefs which may be provided defining the structure of Objective-C
+ // pseudo-builtins
+ QualType ObjCIdRedefinitionType;
+ QualType ObjCClassRedefinitionType;
+
/// \brief Source ranges for all of the comments in the source file,
/// sorted in order of appearance in the translation unit.
std::vector<SourceRange> Comments;
-
+
SourceManager& getSourceManager() { return SourceMgr; }
const SourceManager& getSourceManager() const { return SourceMgr; }
void *Allocate(unsigned Size, unsigned Align = 8) {
return FreeMemory ? MallocAlloc.Allocate(Size, Align) :
BumpAlloc.Allocate(Size, Align);
}
- void Deallocate(void *Ptr) {
+ void Deallocate(void *Ptr) {
if (FreeMemory)
- MallocAlloc.Deallocate(Ptr);
+ MallocAlloc.Deallocate(Ptr);
}
const LangOptions& getLangOptions() const { return LangOpts; }
-
- FullSourceLoc getFullLoc(SourceLocation Loc) const {
+
+ FullSourceLoc getFullLoc(SourceLocation Loc) const {
return FullSourceLoc(Loc,SourceMgr);
}
/// \brief Retrieve the attributes for the given declaration.
Attr*& getDeclAttrs(const Decl *D) { return DeclAttrs[D]; }
-
+
/// \brief Erase the attributes corresponding to the given declaration.
void eraseDeclAttrs(const Decl *D) { DeclAttrs.erase(D); }
-
+
+ /// \brief If this variable is an instantiated static data member of a
+ /// class template specialization, returns the templated static data member
+ /// from which it was instantiated.
+ MemberSpecializationInfo *getInstantiatedFromStaticDataMember(VarDecl *Var);
+
+ /// \brief Note that the static data member \p Inst is an instantiation of
+ /// the static data member template \p Tmpl of a class template.
+ void setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl,
+ TemplateSpecializationKind TSK);
+
+ /// \brief If this using decl is instantiated from an unresolved using decl,
+ /// return it.
+ UnresolvedUsingDecl *getInstantiatedFromUnresolvedUsingDecl(UsingDecl *UUD);
+
+ /// \brief Note that the using decl \p Inst is an instantiation of
+ /// the unresolved using decl \p Tmpl of a class template.
+ void setInstantiatedFromUnresolvedUsingDecl(UsingDecl *Inst,
+ UnresolvedUsingDecl *Tmpl);
+
+
+ FieldDecl *getInstantiatedFromUnnamedFieldDecl(FieldDecl *Field);
+
+ void setInstantiatedFromUnnamedFieldDecl(FieldDecl *Inst, FieldDecl *Tmpl);
+
TranslationUnitDecl *getTranslationUnitDecl() const { return TUDecl; }
+
const char *getCommentForDecl(const Decl *D);
-
+
// Builtin Types.
QualType VoidTy;
QualType BoolTy;
QualType CharTy;
- QualType WCharTy; // [C++ 3.9.1p5], integer type in C99.
+ QualType WCharTy; // [C++ 3.9.1p5], integer type in C99.
+ QualType Char16Ty; // [C++0x 3.9.1p5], integer type in C99.
+ QualType Char32Ty; // [C++0x 3.9.1p5], integer type in C99.
QualType SignedCharTy, ShortTy, IntTy, LongTy, LongLongTy, Int128Ty;
QualType UnsignedCharTy, UnsignedShortTy, UnsignedIntTy, UnsignedLongTy;
QualType UnsignedLongLongTy, UnsignedInt128Ty;
@@ -207,6 +309,7 @@ public:
QualType OverloadTy;
QualType DependentTy;
QualType UndeducedAutoTy;
+ QualType ObjCBuiltinIdTy, ObjCBuiltinClassTy;
ASTContext(const LangOptions& LOpts, SourceManager &SM, TargetInfo &t,
IdentifierTable &idents, SelectorTable &sels,
@@ -232,23 +335,52 @@ public:
//===--------------------------------------------------------------------===//
// Type Constructors
//===--------------------------------------------------------------------===//
-
- /// getAddSpaceQualType - Return the uniqued reference to the type for an
- /// address space qualified type with the specified type and address space.
- /// The resulting type has a union of the qualifiers from T and the address
- /// space. If T already has an address space specifier, it is silently
+
+private:
+ /// getExtQualType - Return a type with extended qualifiers.
+ QualType getExtQualType(const Type *Base, Qualifiers Quals);
+
+public:
+ /// getAddSpaceQualType - Return the uniqued reference to the type for an
+ /// address space qualified type with the specified type and address space.
+ /// The resulting type has a union of the qualifiers from T and the address
+ /// space. If T already has an address space specifier, it is silently
/// replaced.
QualType getAddrSpaceQualType(QualType T, unsigned AddressSpace);
-
+
/// getObjCGCQualType - Returns the uniqued reference to the type for an
/// objc gc qualified type. The retulting type has a union of the qualifiers
/// from T and the gc attribute.
- QualType getObjCGCQualType(QualType T, QualType::GCAttrTypes gcAttr);
-
+ QualType getObjCGCQualType(QualType T, Qualifiers::GC gcAttr);
+
+ /// getRestrictType - Returns the uniqued reference to the type for a
+ /// 'restrict' qualified type. The resulting type has a union of the
+ /// qualifiers from T and 'restrict'.
+ QualType getRestrictType(QualType T) {
+ return T.withFastQualifiers(Qualifiers::Restrict);
+ }
+
+ /// getVolatileType - Returns the uniqued reference to the type for a
+ /// 'volatile' qualified type. The resulting type has a union of the
+ /// qualifiers from T and 'volatile'.
+ QualType getVolatileType(QualType T);
+
+ /// getConstType - Returns the uniqued reference to the type for a
+ /// 'const' qualified type. The resulting type has a union of the
+ /// qualifiers from T and 'const'.
+ ///
+ /// It can be reasonably expected that this will always be
+ /// equivalent to calling T.withConst().
+ QualType getConstType(QualType T) { return T.withConst(); }
+
+ /// getNoReturnType - Add the noreturn attribute to the given type which must
+ /// be a FunctionType or a pointer to an allowable type or a BlockPointer.
+ QualType getNoReturnType(QualType T);
+
/// getComplexType - Return the uniqued reference to the type for a complex
/// number with the specified element type.
QualType getComplexType(QualType T);
-
+
/// getPointerType - Return the uniqued reference to the type for a pointer to
/// the specified type.
QualType getPointerType(QualType T);
@@ -274,15 +406,17 @@ public:
/// variable array of the specified element type.
QualType getVariableArrayType(QualType EltTy, Expr *NumElts,
ArrayType::ArraySizeModifier ASM,
- unsigned EltTypeQuals);
-
+ unsigned EltTypeQuals,
+ SourceRange Brackets);
+
/// getDependentSizedArrayType - Returns a non-unique reference to
/// the type for a dependently-sized array of the specified element
/// type. FIXME: We will need these to be uniqued, or at least
/// comparable, at some point.
QualType getDependentSizedArrayType(QualType EltTy, Expr *NumElts,
ArrayType::ArraySizeModifier ASM,
- unsigned EltTypeQuals);
+ unsigned EltTypeQuals,
+ SourceRange Brackets);
/// getIncompleteArrayType - Returns a unique reference to the type for a
/// incomplete array of the specified element type.
@@ -295,7 +429,23 @@ public:
QualType getConstantArrayType(QualType EltTy, const llvm::APInt &ArySize,
ArrayType::ArraySizeModifier ASM,
unsigned EltTypeQuals);
-
+
+ /// getConstantArrayWithExprType - Return a reference to the type for a
+ /// constant array of the specified element type.
+ QualType getConstantArrayWithExprType(QualType EltTy,
+ const llvm::APInt &ArySize,
+ Expr *ArySizeExpr,
+ ArrayType::ArraySizeModifier ASM,
+ unsigned EltTypeQuals,
+ SourceRange Brackets);
+
+ /// getConstantArrayWithoutExprType - Return a reference to the type
+ /// for a constant array of the specified element type.
+ QualType getConstantArrayWithoutExprType(QualType EltTy,
+ const llvm::APInt &ArySize,
+ ArrayType::ArraySizeModifier ASM,
+ unsigned EltTypeQuals);
+
/// getVectorType - Return the unique reference to a vector type of
/// the specified element type and size. VectorType must be a built-in type.
QualType getVectorType(QualType VectorType, unsigned NumElts);
@@ -309,13 +459,13 @@ public:
/// the type for a dependently-sized vector of the specified element
/// type. FIXME: We will need these to be uniqued, or at least
/// comparable, at some point.
- QualType getDependentSizedExtVectorType(QualType VectorType,
+ QualType getDependentSizedExtVectorType(QualType VectorType,
Expr *SizeExpr,
SourceLocation AttrLoc);
/// getFunctionNoProtoType - Return a K&R style C function type like 'int()'.
///
- QualType getFunctionNoProtoType(QualType ResultTy);
+ QualType getFunctionNoProtoType(QualType ResultTy, bool NoReturn = false);
/// getFunctionType - Return a normal function type with a typed argument
/// list. isVariadic indicates whether the argument list includes '...'.
@@ -323,7 +473,8 @@ public:
unsigned NumArgs, bool isVariadic,
unsigned TypeQuals, bool hasExceptionSpec = false,
bool hasAnyExceptionSpec = false,
- unsigned NumExs = 0, const QualType *ExArray = 0);
+ unsigned NumExs = 0, const QualType *ExArray = 0,
+ bool NoReturn = false);
/// getTypeDeclType - Return the unique reference to the type for
/// the specified type declaration.
@@ -332,9 +483,8 @@ public:
/// getTypedefType - Return the unique reference to the type for the
/// specified typename decl.
QualType getTypedefType(TypedefDecl *Decl);
- QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl);
- QualType getTemplateTypeParmType(unsigned Depth, unsigned Index,
+ QualType getTemplateTypeParmType(unsigned Depth, unsigned Index,
bool ParameterPack,
IdentifierInfo *Name = 0);
@@ -345,37 +495,40 @@ public:
QualType getQualifiedNameType(NestedNameSpecifier *NNS,
QualType NamedType);
- QualType getTypenameType(NestedNameSpecifier *NNS,
+ QualType getTypenameType(NestedNameSpecifier *NNS,
const IdentifierInfo *Name,
QualType Canon = QualType());
- QualType getTypenameType(NestedNameSpecifier *NNS,
+ QualType getTypenameType(NestedNameSpecifier *NNS,
const TemplateSpecializationType *TemplateId,
QualType Canon = QualType());
+ QualType getElaboratedType(QualType UnderlyingType,
+ ElaboratedType::TagKind Tag);
+
+ QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl,
+ ObjCProtocolDecl **Protocols = 0,
+ unsigned NumProtocols = 0);
/// getObjCObjectPointerType - Return a ObjCObjectPointerType type for the
/// given interface decl and the conforming protocol list.
- QualType getObjCObjectPointerType(ObjCInterfaceDecl *Decl,
+ QualType getObjCObjectPointerType(QualType OIT,
ObjCProtocolDecl **ProtocolList = 0,
unsigned NumProtocols = 0);
-
- /// getObjCQualifiedInterfaceType - Return a
- /// ObjCQualifiedInterfaceType type for the given interface decl and
- /// the conforming protocol list.
- QualType getObjCQualifiedInterfaceType(ObjCInterfaceDecl *Decl,
- ObjCProtocolDecl **ProtocolList,
- unsigned NumProtocols);
-
+
+ QualType getObjCProtocolListType(QualType T,
+ ObjCProtocolDecl **Protocols,
+ unsigned NumProtocols);
+
/// getTypeOfType - GCC extension.
QualType getTypeOfExprType(Expr *e);
QualType getTypeOfType(QualType t);
-
+
/// getDecltypeType - C++0x decltype.
QualType getDecltypeType(Expr *e);
-
+
/// getTagDeclType - Return the unique reference to the type for the
/// specified TagDecl (struct/union/class/enum) decl.
- QualType getTagDeclType(TagDecl *Decl);
-
+ QualType getTagDeclType(const TagDecl *Decl);
+
/// getSizeType - Return the unique type for "size_t" (C99 7.17), defined
/// in <stddef.h>. The sizeof operator requires this (C99 6.5.3.4p4).
QualType getSizeType() const;
@@ -392,15 +545,15 @@ public:
/// getUnsignedWCharType - Return the type of "unsigned wchar_t".
/// Used when in C++, as a GCC extension.
QualType getUnsignedWCharType() const;
-
+
/// getPointerDiffType - Return the unique type for "ptrdiff_t" (ref?)
/// defined in <stddef.h>. Pointer - pointer requires this (C99 6.5.6p9).
QualType getPointerDiffType() const;
-
+
// getCFConstantStringType - Return the C structure type used to represent
// constant CFStrings.
- QualType getCFConstantStringType();
-
+ QualType getCFConstantStringType();
+
/// Get the structure type used to representation CFStrings, or NULL
/// if it hasn't yet been built.
QualType getRawCFConstantStringType() {
@@ -412,13 +565,13 @@ public:
// This setter/getter represents the ObjC type for an NSConstantString.
void setObjCConstantStringInterface(ObjCInterfaceDecl *Decl);
- QualType getObjCConstantStringInterface() const {
- return ObjCConstantStringType;
+ QualType getObjCConstantStringInterface() const {
+ return ObjCConstantStringType;
}
//// This gets the struct used to keep track of fast enumerations.
QualType getObjCFastEnumerationStateType();
-
+
/// Get the ObjCFastEnumerationState type, or NULL if it hasn't yet
/// been built.
QualType getRawObjCFastEnumerationStateType() {
@@ -429,109 +582,166 @@ public:
void setObjCFastEnumerationStateType(QualType T);
+ /// \brief Set the type for the C FILE type.
+ void setFILEDecl(TypeDecl *FILEDecl) { this->FILEDecl = FILEDecl; }
+
+ /// \brief Retrieve the C FILE type.
+ QualType getFILEType() {
+ if (FILEDecl)
+ return getTypeDeclType(FILEDecl);
+ return QualType();
+ }
+
+ /// \brief Set the type for the C jmp_buf type.
+ void setjmp_bufDecl(TypeDecl *jmp_bufDecl) {
+ this->jmp_bufDecl = jmp_bufDecl;
+ }
+
+ /// \brief Retrieve the C jmp_buf type.
+ QualType getjmp_bufType() {
+ if (jmp_bufDecl)
+ return getTypeDeclType(jmp_bufDecl);
+ return QualType();
+ }
+
+ /// \brief Set the type for the C sigjmp_buf type.
+ void setsigjmp_bufDecl(TypeDecl *sigjmp_bufDecl) {
+ this->sigjmp_bufDecl = sigjmp_bufDecl;
+ }
+
+ /// \brief Retrieve the C sigjmp_buf type.
+ QualType getsigjmp_bufType() {
+ if (sigjmp_bufDecl)
+ return getTypeDeclType(sigjmp_bufDecl);
+ return QualType();
+ }
+
/// getObjCEncodingForType - Emit the ObjC type encoding for the
/// given type into \arg S. If \arg NameFields is specified then
/// record field names are also encoded.
- void getObjCEncodingForType(QualType t, std::string &S,
+ void getObjCEncodingForType(QualType t, std::string &S,
const FieldDecl *Field=0);
void getLegacyIntegralTypeEncoding(QualType &t) const;
-
+
// Put the string version of type qualifiers into S.
- void getObjCEncodingForTypeQualifier(Decl::ObjCDeclQualifier QT,
+ void getObjCEncodingForTypeQualifier(Decl::ObjCDeclQualifier QT,
std::string &S) const;
-
+
/// getObjCEncodingForMethodDecl - Return the encoded type for this method
/// declaration.
void getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, std::string &S);
-
+
/// getObjCEncodingForPropertyDecl - Return the encoded type for
/// this method declaration. If non-NULL, Container must be either
/// an ObjCCategoryImplDecl or ObjCImplementationDecl; it should
/// only be NULL when getting encodings for protocol properties.
- void getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD,
+ void getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD,
const Decl *Container,
std::string &S);
-
+
+ bool ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto,
+ ObjCProtocolDecl *rProto);
+
/// getObjCEncodingTypeSize returns size of type for objective-c encoding
/// purpose.
int getObjCEncodingTypeSize(QualType t);
/// This setter/getter represents the ObjC 'id' type. It is setup lazily, by
/// Sema. id is always a (typedef for a) pointer type, a pointer to a struct.
- QualType getObjCIdType() const { return ObjCIdType; }
+ QualType getObjCIdType() const { return ObjCIdTypedefType; }
void setObjCIdType(QualType T);
-
+
void setObjCSelType(QualType T);
QualType getObjCSelType() const { return ObjCSelType; }
-
+
void setObjCProtoType(QualType QT);
QualType getObjCProtoType() const { return ObjCProtoType; }
-
+
/// This setter/getter repreents the ObjC 'Class' type. It is setup lazily, by
/// Sema. 'Class' is always a (typedef for a) pointer type, a pointer to a
/// struct.
- QualType getObjCClassType() const { return ObjCClassType; }
+ QualType getObjCClassType() const { return ObjCClassTypedefType; }
void setObjCClassType(QualType T);
-
+
void setBuiltinVaListType(QualType T);
QualType getBuiltinVaListType() const { return BuiltinVaListType; }
QualType getFixedWidthIntType(unsigned Width, bool Signed);
- TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS,
+ /// getCVRQualifiedType - Returns a type with additional const,
+ /// volatile, or restrict qualifiers.
+ QualType getCVRQualifiedType(QualType T, unsigned CVR) {
+ return getQualifiedType(T, Qualifiers::fromCVRMask(CVR));
+ }
+
+ /// getQualifiedType - Returns a type with additional qualifiers.
+ QualType getQualifiedType(QualType T, Qualifiers Qs) {
+ if (!Qs.hasNonFastQualifiers())
+ return T.withFastQualifiers(Qs.getFastQualifiers());
+ QualifierCollector Qc(Qs);
+ const Type *Ptr = Qc.strip(T);
+ return getExtQualType(Ptr, Qc);
+ }
+
+ /// getQualifiedType - Returns a type with additional qualifiers.
+ QualType getQualifiedType(const Type *T, Qualifiers Qs) {
+ if (!Qs.hasNonFastQualifiers())
+ return QualType(T, Qs.getFastQualifiers());
+ return getExtQualType(T, Qs);
+ }
+
+ TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS,
bool TemplateKeyword,
TemplateDecl *Template);
+ TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS,
+ bool TemplateKeyword,
+ OverloadedFunctionDecl *Template);
- TemplateName getDependentTemplateName(NestedNameSpecifier *NNS,
+ TemplateName getDependentTemplateName(NestedNameSpecifier *NNS,
const IdentifierInfo *Name);
enum GetBuiltinTypeError {
- GE_None, //< No error
- GE_Missing_FILE //< Missing the FILE type from <stdio.h>
+ GE_None, //< No error
+ GE_Missing_stdio, //< Missing a type from <stdio.h>
+ GE_Missing_setjmp //< Missing a type from <setjmp.h>
};
-
+
/// GetBuiltinType - Return the type for the specified builtin.
QualType GetBuiltinType(unsigned ID, GetBuiltinTypeError &Error);
-
+
private:
QualType getFromTargetType(unsigned Type) const;
//===--------------------------------------------------------------------===//
// Type Predicates.
//===--------------------------------------------------------------------===//
-
-public:
- /// isObjCObjectPointerType - Returns true if type is an Objective-C pointer
- /// to an object type. This includes "id" and "Class" (two 'special' pointers
- /// to struct), Interface* (pointer to ObjCInterfaceType) and id<P> (qualified
- /// ID type).
- bool isObjCObjectPointerType(QualType Ty) const;
+public:
/// getObjCGCAttr - Returns one of GCNone, Weak or Strong objc's
/// garbage collection attribute.
///
- QualType::GCAttrTypes getObjCGCAttrKind(const QualType &Ty) const;
-
+ Qualifiers::GC getObjCGCAttrKind(const QualType &Ty) const;
+
/// isObjCNSObjectType - Return true if this is an NSObject object with
/// its NSObject attribute set.
bool isObjCNSObjectType(QualType Ty) const;
-
+
//===--------------------------------------------------------------------===//
// Type Sizing and Analysis
//===--------------------------------------------------------------------===//
-
+
/// getFloatTypeSemantics - Return the APFloat 'semantics' for the specified
/// scalar floating point type.
const llvm::fltSemantics &getFloatTypeSemantics(QualType T) const;
-
+
/// getTypeInfo - Get the size and alignment of the specified complete type in
/// bits.
std::pair<uint64_t, unsigned> getTypeInfo(const Type *T);
std::pair<uint64_t, unsigned> getTypeInfo(QualType T) {
return getTypeInfo(T.getTypePtr());
}
-
+
/// getTypeSize - Return the size of the specified type, in bits. This method
/// does not work on incomplete types.
uint64_t getTypeSize(QualType T) {
@@ -540,7 +750,7 @@ public:
uint64_t getTypeSize(const Type *T) {
return getTypeInfo(T).first;
}
-
+
/// getTypeAlign - Return the ABI-specified alignment of a type, in bits.
/// This method does not work on incomplete types.
unsigned getTypeAlign(QualType T) {
@@ -549,23 +759,23 @@ public:
unsigned getTypeAlign(const Type *T) {
return getTypeInfo(T).second;
}
-
+
/// getPreferredTypeAlign - Return the "preferred" alignment of the specified
/// type for the current target in bits. This can be different than the ABI
/// alignment in cases where it is beneficial for performance to overalign
/// a data type.
unsigned getPreferredTypeAlign(const Type *T);
-
+
/// getDeclAlignInBytes - Return the alignment of the specified decl
/// that should be returned by __alignof(). Note that bitfields do
/// not have a valid alignment, so this method will assert on them.
unsigned getDeclAlignInBytes(const Decl *D);
-
+
/// getASTRecordLayout - Get or compute information about the layout of the
/// specified record (struct/union/class), which indicates its size and field
/// position information.
const ASTRecordLayout &getASTRecordLayout(const RecordDecl *D);
-
+
/// getASTObjCInterfaceLayout - Get or compute information about the
/// layout of the specified Objective-C interface.
const ASTRecordLayout &getASTObjCInterfaceLayout(const ObjCInterfaceDecl *D);
@@ -592,14 +802,14 @@ public:
//===--------------------------------------------------------------------===//
// Type Operators
//===--------------------------------------------------------------------===//
-
+
/// getCanonicalType - Return the canonical (structural) type corresponding to
/// the specified potentially non-canonical type. The non-canonical version
/// of a type may have many "decorated" versions of types. Decorators can
/// include typedefs, 'typeof' operators, etc. The returned type is guaranteed
/// to be free of any of these, allowing two canonical types to be compared
/// for exact equality with a simple pointer comparison.
- QualType getCanonicalType(QualType T);
+ CanQualType getCanonicalType(QualType T);
const Type *getCanonicalType(const Type *T) {
return T->getCanonicalTypeInternal().getTypePtr();
}
@@ -608,7 +818,7 @@ public:
bool hasSameType(QualType T1, QualType T2) {
return getCanonicalType(T1) == getCanonicalType(T2);
}
-
+
/// \brief Determine whether the given types are equivalent after
/// cvr-qualifiers have been removed.
bool hasSameUnqualifiedType(QualType T1, QualType T2) {
@@ -617,20 +827,7 @@ public:
return T1.getUnqualifiedType() == T2.getUnqualifiedType();
}
- /// \brief Retrieves the "canonical" declaration of the given declaration.
- Decl *getCanonicalDecl(Decl *D);
-
- /// \brief Retrieves the "canonical" declaration of the given tag
- /// declaration.
- ///
- /// The canonical declaration for the given tag declaration is
- /// either the definition of the tag (if it is a complete type) or
- /// the first declaration of that tag.
- TagDecl *getCanonicalDecl(TagDecl *Tag) {
- return cast<TagDecl>(getCanonicalDecl((Decl *)Tag));
- }
-
- /// \brief Retrieves the "canonical" declaration of
+ /// \brief Retrieves the "canonical" declaration of
/// \brief Retrieves the "canonical" nested name specifier for a
/// given nested name specifier.
@@ -678,6 +875,13 @@ public:
/// types, values, and templates.
TemplateName getCanonicalTemplateName(TemplateName Name);
+ /// \brief Retrieve the "canonical" template argument.
+ ///
+ /// The canonical template argument is the simplest template argument
+ /// (which may be a type, value, expression, or declaration) that
+ /// expresses the value of the argument.
+ TemplateArgument getCanonicalTemplateArgument(const TemplateArgument &Arg);
+
/// Type Query functions. If the type is an instance of the specified class,
/// return the Type pointer for the underlying maximally pretty type. This
/// is a member of ASTContext because this may need to do some amount of
@@ -693,10 +897,17 @@ public:
return dyn_cast_or_null<IncompleteArrayType>(getAsArrayType(T));
}
- /// getBaseElementType - Returns the innermost element type of a variable
- /// length array type. For example, will return "int" for int[m][n]
- QualType getBaseElementType(const VariableArrayType *VAT);
-
+ /// getBaseElementType - Returns the innermost element type of an array type.
+ /// For example, will return "int" for int[m][n]
+ QualType getBaseElementType(const ArrayType *VAT);
+
+ /// getBaseElementType - Returns the innermost element type of a type
+ /// (which needn't actually be an array type).
+ QualType getBaseElementType(QualType QT);
+
+ /// getConstantArrayElementCount - Returns number of constant array elements.
+ uint64_t getConstantArrayElementCount(const ConstantArrayType *CA) const;
+
/// getArrayDecayedType - Return the properly qualified result of decaying the
/// specified array type to a pointer. This operation is non-trivial when
/// handling typedefs etc. The canonical type of "T" must be an array type,
@@ -704,23 +915,35 @@ public:
///
/// See C99 6.7.5.3p7 and C99 6.3.2.1p3.
QualType getArrayDecayedType(QualType T);
-
- /// getIntegerTypeOrder - Returns the highest ranked integer type:
+
+ /// getPromotedIntegerType - Returns the type that Promotable will
+ /// promote to: C99 6.3.1.1p2, assuming that Promotable is a promotable
+ /// integer type.
+ QualType getPromotedIntegerType(QualType PromotableType);
+
+ /// \brief Whether this is a promotable bitfield reference according
+ /// to C99 6.3.1.1p2, bullet 2 (and GCC extensions).
+ ///
+ /// \returns the type this bit-field will promote to, or NULL if no
+ /// promotion occurs.
+ QualType isPromotableBitField(Expr *E);
+
+ /// getIntegerTypeOrder - Returns the highest ranked integer type:
/// C99 6.3.1.8p1. If LHS > RHS, return 1. If LHS == RHS, return 0. If
- /// LHS < RHS, return -1.
+ /// LHS < RHS, return -1.
int getIntegerTypeOrder(QualType LHS, QualType RHS);
-
+
/// getFloatingTypeOrder - Compare the rank of the two specified floating
/// point types, ignoring the domain of the type (i.e. 'double' ==
/// '_Complex double'). If LHS > RHS, return 1. If LHS == RHS, return 0. If
- /// LHS < RHS, return -1.
+ /// LHS < RHS, return -1.
int getFloatingTypeOrder(QualType LHS, QualType RHS);
- /// getFloatingTypeOfSizeWithinDomain - Returns a real floating
- /// point or a complex type (based on typeDomain/typeSize).
+ /// getFloatingTypeOfSizeWithinDomain - Returns a real floating
+ /// point or a complex type (based on typeDomain/typeSize).
/// 'typeDomain' is a real floating point or complex type.
/// 'typeSize' is a real floating point or complex type.
- QualType getFloatingTypeOfSizeWithinDomain(QualType typeSize,
+ QualType getFloatingTypeOfSizeWithinDomain(QualType typeSize,
QualType typeDomain) const;
private:
@@ -732,33 +955,28 @@ public:
//===--------------------------------------------------------------------===//
// Type Compatibility Predicates
//===--------------------------------------------------------------------===//
-
+
/// Compatibility predicates used to check assignment expressions.
bool typesAreCompatible(QualType, QualType); // C99 6.2.7p1
-
+
bool isObjCIdType(QualType T) const {
- return T == ObjCIdType;
- }
- bool isObjCIdStructType(QualType T) const {
- if (!IdStructType) // ObjC isn't enabled
- return false;
- return T->getAsStructureType() == IdStructType;
+ return T == ObjCIdTypedefType;
}
bool isObjCClassType(QualType T) const {
- return T == ObjCClassType;
- }
- bool isObjCClassStructType(QualType T) const {
- if (!ClassStructType) // ObjC isn't enabled
- return false;
- return T->getAsStructureType() == ClassStructType;
+ return T == ObjCClassTypedefType;
}
bool isObjCSelType(QualType T) const {
assert(SelStructType && "isObjCSelType used before 'SEL' type is built");
return T->getAsStructureType() == SelStructType;
}
+ bool QualifiedIdConformsQualifiedId(QualType LHS, QualType RHS);
+ bool ObjCQualifiedIdTypesAreCompatible(QualType LHS, QualType RHS,
+ bool ForCompare);
// Check the safety of assignment from LHS to RHS
- bool canAssignObjCInterfaces(const ObjCInterfaceType *LHS,
+ bool canAssignObjCInterfaces(const ObjCObjectPointerType *LHSOPT,
+ const ObjCObjectPointerType *RHSOPT);
+ bool canAssignObjCInterfaces(const ObjCInterfaceType *LHS,
const ObjCInterfaceType *RHS);
bool areComparableObjCPointerTypes(QualType LHS, QualType RHS);
@@ -766,6 +984,11 @@ public:
QualType mergeTypes(QualType, QualType);
QualType mergeFunctionTypes(QualType, QualType);
+ /// UsualArithmeticConversionsType - handles the various conversions
+ /// that are common to binary operators (C99 6.3.1.8, C++ [expr]p9)
+ /// and returns the result type of that conversion.
+ QualType UsualArithmeticConversionsType(QualType lhs, QualType rhs);
+
//===--------------------------------------------------------------------===//
// Integer Predicates
//===--------------------------------------------------------------------===//
@@ -782,15 +1005,15 @@ public:
//===--------------------------------------------------------------------===//
// Type Iterators.
//===--------------------------------------------------------------------===//
-
+
typedef std::vector<Type*>::iterator type_iterator;
typedef std::vector<Type*>::const_iterator const_type_iterator;
-
+
type_iterator types_begin() { return Types.begin(); }
type_iterator types_end() { return Types.end(); }
const_type_iterator types_begin() const { return Types.begin(); }
- const_type_iterator types_end() const { return Types.end(); }
-
+ const_type_iterator types_end() const { return Types.end(); }
+
//===--------------------------------------------------------------------===//
// Integer Values
//===--------------------------------------------------------------------===//
@@ -803,15 +1026,37 @@ public:
return Res;
}
+ /// \brief Get the implementation of ObjCInterfaceDecl,or NULL if none exists.
+ ObjCImplementationDecl *getObjCImplementation(ObjCInterfaceDecl *D);
+ /// \brief Get the implementation of ObjCCategoryDecl, or NULL if none exists.
+ ObjCCategoryImplDecl *getObjCImplementation(ObjCCategoryDecl *D);
+
+ /// \brief Set the implementation of ObjCInterfaceDecl.
+ void setObjCImplementation(ObjCInterfaceDecl *IFaceD,
+ ObjCImplementationDecl *ImplD);
+ /// \brief Set the implementation of ObjCCategoryDecl.
+ void setObjCImplementation(ObjCCategoryDecl *CatD,
+ ObjCCategoryImplDecl *ImplD);
+
+ /// \brief Allocate an uninitialized DeclaratorInfo.
+ ///
+ /// The caller should initialize the memory held by DeclaratorInfo using
+ /// the TypeLoc wrappers.
+ ///
+ /// \param T the type that will be the basis for type source info. This type
+ /// should refer to how the declarator was written in source code, not to
+ /// what type semantic analysis resolved the declarator to.
+ DeclaratorInfo *CreateDeclaratorInfo(QualType T);
+
private:
ASTContext(const ASTContext&); // DO NOT IMPLEMENT
void operator=(const ASTContext&); // DO NOT IMPLEMENT
-
+
void InitBuiltinTypes();
void InitBuiltinType(QualType &R, BuiltinType::Kind K);
-
+
// Return the ObjC type encoding for a given type.
- void getObjCEncodingForTypeImpl(QualType t, std::string &S,
+ void getObjCEncodingForTypeImpl(QualType t, std::string &S,
bool ExpandPointedToStructures,
bool ExpandStructures,
const FieldDecl *Field,
@@ -819,7 +1064,7 @@ private:
bool EncodingProperty = false);
const ASTRecordLayout &getObjCLayout(const ObjCInterfaceDecl *D,
- const ObjCImplementationDecl *Impl);
+ const ObjCImplementationDecl *Impl);
};
} // end namespace clang
diff --git a/include/clang/AST/ASTDiagnostic.h b/include/clang/AST/ASTDiagnostic.h
index e9f150574b05..abd36f7e5f0f 100644
--- a/include/clang/AST/ASTDiagnostic.h
+++ b/include/clang/AST/ASTDiagnostic.h
@@ -13,7 +13,7 @@
#include "clang/Basic/Diagnostic.h"
namespace clang {
- namespace diag {
+ namespace diag {
enum {
#define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,SFINAE) ENUM,
#define ASTSTART
diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h
index 7d3009b01129..6a5e3666a92c 100644
--- a/include/clang/AST/Attr.h
+++ b/include/clang/AST/Attr.h
@@ -14,6 +14,9 @@
#ifndef LLVM_CLANG_AST_ATTR_H
#define LLVM_CLANG_AST_ATTR_H
+#include "llvm/Support/Casting.h"
+using llvm::dyn_cast;
+
#include <cassert>
#include <cstring>
#include <string>
@@ -54,22 +57,24 @@ public:
DLLImport,
Deprecated,
Destructor,
- FastCall,
+ FastCall,
Format,
FormatArg,
GNUInline,
IBOutletKind, // Clang-specific. Use "Kind" suffix to not conflict with
+ Malloc,
+ NoDebug,
+ NoInline,
+ NonNull,
NoReturn,
NoThrow,
- Nodebug,
- Noinline,
- NonNull,
ObjCException,
ObjCNSObject,
CFReturnsRetained, // Clang/Checker-specific.
NSReturnsRetained, // Clang/Checker-specific.
Overloadable, // Clang-specific
Packed,
+ PragmaPack,
Pure,
Regparm,
ReqdWorkGroupSize, // OpenCL-specific
@@ -78,14 +83,14 @@ public:
StdCall,
TransparentUnion,
Unavailable,
- Unused,
+ Unused,
Used,
Visibility,
WarnUnusedResult,
Weak,
WeakImport
};
-
+
private:
Attr *Next;
Kind AttrKind;
@@ -99,16 +104,16 @@ protected:
void operator delete(void* data) throw() {
assert(0 && "Attrs cannot be released with regular 'delete'.");
}
-
+
protected:
Attr(Kind AK) : Next(0), AttrKind(AK), Inherited(false) {}
virtual ~Attr() {
assert(Next == 0 && "Destroy didn't work");
}
public:
-
+
void Destroy(ASTContext &C);
-
+
/// \brief Whether this attribute should be merged to new
/// declarations.
virtual bool isMerged() const { return true; }
@@ -119,17 +124,24 @@ public:
const Attr *getNext() const { return Next; }
void setNext(Attr *next) { Next = next; }
+ template<typename T> const T *getNext() const {
+ for (const Attr *attr = getNext(); attr; attr = attr->getNext())
+ if (const T *V = dyn_cast<T>(attr))
+ return V;
+ return 0;
+ }
+
bool isInherited() const { return Inherited; }
void setInherited(bool value) { Inherited = value; }
void addAttr(Attr *attr) {
assert((attr != 0) && "addAttr(): attr is null");
-
+
// FIXME: This doesn't preserve the order in any way.
attr->Next = Next;
Next = attr;
}
-
+
// Clone this attribute.
virtual Attr* clone(ASTContext &C) const = 0;
@@ -146,36 +158,39 @@ public: \
static bool classof(const ATTR##Attr *A) { return true; } \
}
-class PackedAttr : public Attr {
+DEF_SIMPLE_ATTR(Packed);
+
+class PragmaPackAttr : public Attr {
unsigned Alignment;
public:
- PackedAttr(unsigned alignment) : Attr(Packed), Alignment(alignment) {}
+ PragmaPackAttr(unsigned alignment) : Attr(PragmaPack), Alignment(alignment) {}
/// getAlignment - The specified alignment in bits.
unsigned getAlignment() const { return Alignment; }
- virtual Attr* clone(ASTContext &C) const {
- return ::new (C) PackedAttr(Alignment);
+ virtual Attr* clone(ASTContext &C) const {
+ return ::new (C) PragmaPackAttr(Alignment);
}
// Implement isa/cast/dyncast/etc.
static bool classof(const Attr *A) {
- return A->getKind() == Packed;
+ return A->getKind() == PragmaPack;
}
- static bool classof(const PackedAttr *A) { return true; }
+ static bool classof(const PragmaPackAttr *A) { return true; }
};
-
+
class AlignedAttr : public Attr {
unsigned Alignment;
public:
AlignedAttr(unsigned alignment) : Attr(Aligned), Alignment(alignment) {}
+ // FIXME: Should use addressable units, not bits, to match llvm
/// getAlignment - The specified alignment in bits.
unsigned getAlignment() const { return Alignment; }
virtual Attr* clone(ASTContext &C) const { return ::new (C) AlignedAttr(Alignment); }
-
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Attr *A) {
return A->getKind() == Aligned;
@@ -187,11 +202,11 @@ class AnnotateAttr : public Attr {
std::string Annotation;
public:
AnnotateAttr(const std::string &ann) : Attr(Annotate), Annotation(ann) {}
-
+
const std::string& getAnnotation() const { return Annotation; }
virtual Attr* clone(ASTContext &C) const { return ::new (C) AnnotateAttr(Annotation); }
-
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Attr *A) {
return A->getKind() == Annotate;
@@ -203,11 +218,11 @@ class AsmLabelAttr : public Attr {
std::string Label;
public:
AsmLabelAttr(const std::string &L) : Attr(AsmLabel), Label(L) {}
-
+
const std::string& getLabel() const { return Label; }
-
+
virtual Attr* clone(ASTContext &C) const { return ::new (C) AsmLabelAttr(Label); }
-
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Attr *A) {
return A->getKind() == AsmLabel;
@@ -237,28 +252,28 @@ public:
ConstructorAttr(int p) : Attr(Constructor), priority(p) {}
int getPriority() const { return priority; }
-
+
virtual Attr *clone(ASTContext &C) const { return ::new (C) ConstructorAttr(priority); }
// Implement isa/cast/dyncast/etc.
- static bool classof(const Attr *A) { return A->getKind() == Constructor; }
+ static bool classof(const Attr *A) { return A->getKind() == Constructor; }
static bool classof(const ConstructorAttr *A) { return true; }
-};
-
+};
+
class DestructorAttr : public Attr {
int priority;
public:
DestructorAttr(int p) : Attr(Destructor), priority(p) {}
int getPriority() const { return priority; }
-
+
virtual Attr *clone(ASTContext &C) const { return ::new (C) DestructorAttr(priority); }
// Implement isa/cast/dyncast/etc.
- static bool classof(const Attr *A) { return A->getKind() == Destructor; }
+ static bool classof(const Attr *A) { return A->getKind() == Destructor; }
static bool classof(const DestructorAttr *A) { return true; }
-};
-
+};
+
class GNUInlineAttr : public Attr {
public:
GNUInlineAttr() : Attr(GNUInline) {}
@@ -285,15 +300,16 @@ public:
static bool classof(const IBOutletAttr *A) { return true; }
};
+DEF_SIMPLE_ATTR(Malloc);
DEF_SIMPLE_ATTR(NoReturn);
-DEF_SIMPLE_ATTR(AnalyzerNoReturn);
+DEF_SIMPLE_ATTR(AnalyzerNoReturn);
DEF_SIMPLE_ATTR(Deprecated);
class SectionAttr : public Attr {
std::string Name;
public:
SectionAttr(const std::string &N) : Attr(Section), Name(N) {}
-
+
const std::string& getName() const { return Name; }
virtual Attr *clone(ASTContext &C) const { return ::new (C) SectionAttr(Name); }
@@ -307,8 +323,8 @@ public:
DEF_SIMPLE_ATTR(Unavailable);
DEF_SIMPLE_ATTR(Unused);
-DEF_SIMPLE_ATTR(Used);
-DEF_SIMPLE_ATTR(Weak);
+DEF_SIMPLE_ATTR(Used);
+DEF_SIMPLE_ATTR(Weak);
DEF_SIMPLE_ATTR(WeakImport);
DEF_SIMPLE_ATTR(NoThrow);
DEF_SIMPLE_ATTR(Const);
@@ -320,14 +336,14 @@ class NonNullAttr : public Attr {
public:
NonNullAttr(unsigned* arg_nums = 0, unsigned size = 0) : Attr(NonNull),
ArgNums(0), Size(0) {
-
+
if (size == 0) return;
assert(arg_nums);
ArgNums = new unsigned[size];
Size = size;
memcpy(ArgNums, arg_nums, sizeof(*ArgNums)*size);
}
-
+
virtual ~NonNullAttr() {
delete [] ArgNums;
}
@@ -339,7 +355,7 @@ public:
bool isNonNull(unsigned arg) const {
return ArgNums ? std::binary_search(ArgNums, ArgNums+Size, arg) : true;
- }
+ }
virtual Attr *clone(ASTContext &C) const { return ::new (C) NonNullAttr(ArgNums, Size); }
@@ -359,8 +375,8 @@ public:
int getFormatIdx() const { return formatIdx; }
int getFirstArg() const { return firstArg; }
- virtual Attr *clone(ASTContext &C) const {
- return ::new (C) FormatAttr(Type, formatIdx, firstArg);
+ virtual Attr *clone(ASTContext &C) const {
+ return ::new (C) FormatAttr(Type, formatIdx, firstArg);
}
// Implement isa/cast/dyncast/etc.
@@ -437,8 +453,8 @@ public:
virtual bool isMerged() const { return false; }
- virtual Attr *clone(ASTContext &C) const {
- return ::new (C) OverloadableAttr;
+ virtual Attr *clone(ASTContext &C) const {
+ return ::new (C) OverloadableAttr;
}
static bool classof(const Attr *A) { return A->getKind() == Overloadable; }
@@ -465,15 +481,15 @@ public:
};
class FunctionDecl;
-
+
class CleanupAttr : public Attr {
FunctionDecl *FD;
-
+
public:
CleanupAttr(FunctionDecl *fd) : Attr(Cleanup), FD(fd) {}
const FunctionDecl *getFunctionDecl() const { return FD; }
-
+
virtual Attr *clone(ASTContext &C) const { return ::new (C) CleanupAttr(FD); }
// Implement isa/cast/dyncast/etc.
@@ -481,9 +497,9 @@ public:
static bool classof(const CleanupAttr *A) { return true; }
};
-DEF_SIMPLE_ATTR(Nodebug);
-DEF_SIMPLE_ATTR(WarnUnusedResult);
-DEF_SIMPLE_ATTR(Noinline);
+DEF_SIMPLE_ATTR(NoDebug);
+DEF_SIMPLE_ATTR(WarnUnusedResult);
+DEF_SIMPLE_ATTR(NoInline);
class RegparmAttr : public Attr {
unsigned NumParams;
@@ -493,11 +509,11 @@ public:
unsigned getNumParams() const { return NumParams; }
- virtual Attr *clone(ASTContext &C) const {
- return ::new (C) RegparmAttr(NumParams);
+ virtual Attr *clone(ASTContext &C) const {
+ return ::new (C) RegparmAttr(NumParams);
}
- // Implement isa/cast/dyncast/etc.
+ // Implement isa/cast/dyncast/etc.
static bool classof(const Attr *A) { return A->getKind() == Regparm; }
static bool classof(const RegparmAttr *A) { return true; }
};
@@ -512,23 +528,23 @@ public:
unsigned getYDim() const { return Y; }
unsigned getZDim() const { return Z; }
- virtual Attr *clone(ASTContext &C) const {
- return ::new (C) ReqdWorkGroupSizeAttr(X, Y, Z);
+ virtual Attr *clone(ASTContext &C) const {
+ return ::new (C) ReqdWorkGroupSizeAttr(X, Y, Z);
}
-
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Attr *A) {
return A->getKind() == ReqdWorkGroupSize;
}
static bool classof(const ReqdWorkGroupSizeAttr *A) { return true; }
};
-
+
// Checker-specific attributes.
DEF_SIMPLE_ATTR(CFReturnsRetained);
DEF_SIMPLE_ATTR(NSReturnsRetained);
#undef DEF_SIMPLE_ATTR
-
+
} // end namespace clang
#endif
diff --git a/include/clang/AST/CXXInheritance.h b/include/clang/AST/CXXInheritance.h
new file mode 100644
index 000000000000..a57bcc184a93
--- /dev/null
+++ b/include/clang/AST/CXXInheritance.h
@@ -0,0 +1,212 @@
+//===------ CXXInheritance.h - C++ Inheritance ------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file provides routines that help analyzing C++ inheritance hierarchies.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_AST_CXXINHERITANCE_H
+#define LLVM_CLANG_AST_CXXINHERITANCE_H
+
+#include "clang/AST/DeclarationName.h"
+#include "clang/AST/DeclBase.h"
+#include "clang/AST/Type.h"
+#include "clang/AST/TypeOrdering.h"
+#include "llvm/ADT/SmallVector.h"
+#include <list>
+#include <map>
+#include <cassert>
+
+namespace clang {
+
+class CXXBaseSpecifier;
+class CXXMethodDecl;
+class CXXRecordDecl;
+class NamedDecl;
+
+/// \brief Represents an element in a path from a derived class to a
+/// base class.
+///
+/// Each step in the path references the link from a
+/// derived class to one of its direct base classes, along with a
+/// base "number" that identifies which base subobject of the
+/// original derived class we are referencing.
+struct CXXBasePathElement {
+ /// \brief The base specifier that states the link from a derived
+ /// class to a base class, which will be followed by this base
+ /// path element.
+ const CXXBaseSpecifier *Base;
+
+ /// \brief The record decl of the class that the base is a base of.
+ const CXXRecordDecl *Class;
+
+ /// \brief Identifies which base class subobject (of type
+ /// \c Base->getType()) this base path element refers to.
+ ///
+ /// This value is only valid if \c !Base->isVirtual(), because there
+ /// is no base numbering for the zero or one virtual bases of a
+ /// given type.
+ int SubobjectNumber;
+};
+
+/// \brief Represents a path from a specific derived class
+/// (which is not represented as part of the path) to a particular
+/// (direct or indirect) base class subobject.
+///
+/// Individual elements in the path are described by the \c CXXBasePathElement
+/// structure, which captures both the link from a derived class to one of its
+/// direct bases and identification describing which base class
+/// subobject is being used.
+struct CXXBasePath : public llvm::SmallVector<CXXBasePathElement, 4> {
+ /// \brief The set of declarations found inside this base class
+ /// subobject.
+ DeclContext::lookup_result Decls;
+};
+
+/// BasePaths - Represents the set of paths from a derived class to
+/// one of its (direct or indirect) bases. For example, given the
+/// following class hierachy:
+///
+/// @code
+/// class A { };
+/// class B : public A { };
+/// class C : public A { };
+/// class D : public B, public C{ };
+/// @endcode
+///
+/// There are two potential BasePaths to represent paths from D to a
+/// base subobject of type A. One path is (D,0) -> (B,0) -> (A,0)
+/// and another is (D,0)->(C,0)->(A,1). These two paths actually
+/// refer to two different base class subobjects of the same type,
+/// so the BasePaths object refers to an ambiguous path. On the
+/// other hand, consider the following class hierarchy:
+///
+/// @code
+/// class A { };
+/// class B : public virtual A { };
+/// class C : public virtual A { };
+/// class D : public B, public C{ };
+/// @endcode
+///
+/// Here, there are two potential BasePaths again, (D, 0) -> (B, 0)
+/// -> (A,v) and (D, 0) -> (C, 0) -> (A, v), but since both of them
+/// refer to the same base class subobject of type A (the virtual
+/// one), there is no ambiguity.
+class CXXBasePaths {
+ /// \brief The type from which this search originated.
+ CXXRecordDecl *Origin;
+
+ /// Paths - The actual set of paths that can be taken from the
+ /// derived class to the same base class.
+ std::list<CXXBasePath> Paths;
+
+ /// ClassSubobjects - Records the class subobjects for each class
+ /// type that we've seen. The first element in the pair says
+ /// whether we found a path to a virtual base for that class type,
+ /// while the element contains the number of non-virtual base
+ /// class subobjects for that class type. The key of the map is
+ /// the cv-unqualified canonical type of the base class subobject.
+ std::map<QualType, std::pair<bool, unsigned>, QualTypeOrdering>
+ ClassSubobjects;
+
+ /// FindAmbiguities - Whether Sema::IsDerivedFrom should try find
+ /// ambiguous paths while it is looking for a path from a derived
+ /// type to a base type.
+ bool FindAmbiguities;
+
+ /// RecordPaths - Whether Sema::IsDerivedFrom should record paths
+ /// while it is determining whether there are paths from a derived
+ /// type to a base type.
+ bool RecordPaths;
+
+ /// DetectVirtual - Whether Sema::IsDerivedFrom should abort the search
+ /// if it finds a path that goes across a virtual base. The virtual class
+ /// is also recorded.
+ bool DetectVirtual;
+
+ /// ScratchPath - A BasePath that is used by Sema::IsDerivedFrom
+ /// to help build the set of paths.
+ CXXBasePath ScratchPath;
+
+ /// DetectedVirtual - The base class that is virtual.
+ const RecordType *DetectedVirtual;
+
+ /// \brief Array of the declarations that have been found. This
+ /// array is constructed only if needed, e.g., to iterate over the
+ /// results within LookupResult.
+ NamedDecl **DeclsFound;
+ unsigned NumDeclsFound;
+
+ friend class CXXRecordDecl;
+
+ void ComputeDeclsFound();
+
+public:
+ typedef std::list<CXXBasePath>::const_iterator paths_iterator;
+ typedef NamedDecl **decl_iterator;
+
+ /// BasePaths - Construct a new BasePaths structure to record the
+ /// paths for a derived-to-base search.
+ explicit CXXBasePaths(bool FindAmbiguities = true,
+ bool RecordPaths = true,
+ bool DetectVirtual = true)
+ : FindAmbiguities(FindAmbiguities), RecordPaths(RecordPaths),
+ DetectVirtual(DetectVirtual), DetectedVirtual(0), DeclsFound(0),
+ NumDeclsFound(0) { }
+
+ ~CXXBasePaths() { delete [] DeclsFound; }
+
+ paths_iterator begin() const { return Paths.begin(); }
+ paths_iterator end() const { return Paths.end(); }
+
+ CXXBasePath& front() { return Paths.front(); }
+ const CXXBasePath& front() const { return Paths.front(); }
+
+ decl_iterator found_decls_begin();
+ decl_iterator found_decls_end();
+
+ /// \brief Determine whether the path from the most-derived type to the
+ /// given base type is ambiguous (i.e., it refers to multiple subobjects of
+ /// the same base type).
+ bool isAmbiguous(QualType BaseType);
+
+ /// \brief Whether we are finding multiple paths to detect ambiguities.
+ bool isFindingAmbiguities() const { return FindAmbiguities; }
+
+ /// \brief Whether we are recording paths.
+ bool isRecordingPaths() const { return RecordPaths; }
+
+ /// \brief Specify whether we should be recording paths or not.
+ void setRecordingPaths(bool RP) { RecordPaths = RP; }
+
+ /// \brief Whether we are detecting virtual bases.
+ bool isDetectingVirtual() const { return DetectVirtual; }
+
+ /// \brief The virtual base discovered on the path (if we are merely
+ /// detecting virtuals).
+ const RecordType* getDetectedVirtual() const {
+ return DetectedVirtual;
+ }
+
+ /// \brief Retrieve the type from which this base-paths search
+ /// began
+ CXXRecordDecl *getOrigin() const { return Origin; }
+ void setOrigin(CXXRecordDecl *Rec) { Origin = Rec; }
+
+ /// \brief Clear the base-paths results.
+ void clear();
+
+ /// \brief Swap this data structure's contents with another CXXBasePaths
+ /// object.
+ void swap(CXXBasePaths &Other);
+};
+
+} // end namespace clang
+
+#endif
diff --git a/include/clang/AST/CanonicalType.h b/include/clang/AST/CanonicalType.h
new file mode 100644
index 000000000000..d7ac76dd32e4
--- /dev/null
+++ b/include/clang/AST/CanonicalType.h
@@ -0,0 +1,721 @@
+//===-- CanonicalType.h - C Language Family Type Representation -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the CanQual class template, which provides access to
+// canonical types.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_AST_CANONICAL_TYPE_H
+#define LLVM_CLANG_AST_CANONICAL_TYPE_H
+
+#include "clang/AST/Type.h"
+#include "llvm/Support/Casting.h"
+#include "llvm/Support/type_traits.h"
+#include <iterator>
+
+namespace clang {
+
+template<typename T> class CanProxy;
+template<typename T> struct CanProxyAdaptor;
+
+//----------------------------------------------------------------------------//
+// Canonical, qualified type template
+//----------------------------------------------------------------------------//
+
+/// \brief Represents a canonical, potentially-qualified type.
+///
+/// The CanQual template is a lightweight smart pointer that provides access
+/// to the canonical representation of a type, where all typedefs and other
+/// syntactic sugar has been eliminated. A CanQualType may also have various
+/// qualifiers (const, volatile, restrict) attached to it.
+///
+/// The template type parameter @p T is one of the Type classes (PointerType,
+/// BuiltinType, etc.). The type stored within @c CanQual<T> will be of that
+/// type (or some subclass of that type). The typedef @c CanQualType is just
+/// a shorthand for @c CanQual<Type>.
+///
+/// An instance of @c CanQual<T> can be implicitly converted to a
+/// @c CanQual<U> when T is derived from U, which essentially provides an
+/// implicit upcast. For example, @c CanQual<LValueReferenceType> can be
+/// converted to @c CanQual<ReferenceType>. Note that any @c CanQual type can
+/// be implicitly converted to a QualType, but the reverse operation requires
+/// a call to ASTContext::getCanonicalType().
+///
+///
+template<typename T = Type>
+class CanQual {
+ /// \brief The actual, canonical type.
+ QualType Stored;
+
+public:
+ /// \brief Constructs a NULL canonical type.
+ CanQual() : Stored() { }
+
+ /// \brief Converting constructor that permits implicit upcasting of
+ /// canonical type pointers.
+ template<typename U>
+ CanQual(const CanQual<U>& Other,
+ typename llvm::enable_if<llvm::is_base_of<T, U>, int>::type = 0);
+
+ /// \brief Implicit conversion to the underlying pointer.
+ ///
+ /// Also provides the ability to use canonical types in a boolean context,
+ /// e.g.,
+ /// @code
+ /// if (CanQual<PointerType> Ptr = T->getAs<PointerType>()) { ... }
+ /// @endcode
+ operator const T*() const { return getTypePtr(); }
+
+ /// \brief Retrieve the underlying type pointer, which refers to a
+ /// canonical type.
+ T *getTypePtr() const { return cast_or_null<T>(Stored.getTypePtr()); }
+
+ /// \brief Implicit conversion to a qualified type.
+ operator QualType() const { return Stored; }
+
+ /// \brief Retrieve a canonical type pointer with a different static type,
+ /// upcasting or downcasting as needed.
+ ///
+ /// The getAs() function is typically used to try to downcast to a
+ /// more specific (canonical) type in the type system. For example:
+ ///
+ /// @code
+ /// void f(CanQual<Type> T) {
+ /// if (CanQual<PointerType> Ptr = T->getAs<PointerType>()) {
+ /// // look at Ptr's pointee type
+ /// }
+ /// }
+ /// @endcode
+ ///
+ /// \returns A proxy pointer to the same type, but with the specified
+ /// static type (@p U). If the dynamic type is not the specified static type
+ /// or a derived class thereof, a NULL canonical type.
+ template<typename U> CanProxy<U> getAs() const;
+
+ /// \brief Overloaded arrow operator that produces a canonical type
+ /// proxy.
+ CanProxy<T> operator->() const;
+
+ /// \brief Retrieve all qualifiers.
+ Qualifiers getQualifiers() const { return Stored.getQualifiers(); }
+
+ /// \brief Retrieve the const/volatile/restrict qualifiers.
+ unsigned getCVRQualifiers() const { return Stored.getCVRQualifiers(); }
+
+ /// \brief Determines whether this type has any qualifiers
+ bool hasQualifiers() const { return Stored.hasQualifiers(); }
+
+ bool isConstQualified() const {
+ return Stored.isConstQualified();
+ }
+ bool isVolatileQualified() const {
+ return Stored.isVolatileQualified();
+ }
+ bool isRestrictQualified() const {
+ return Stored.isRestrictQualified();
+ }
+
+ /// \brief Retrieve the unqualified form of this type.
+ CanQual<T> getUnqualifiedType() const;
+
+ CanQual<T> getQualifiedType(unsigned TQs) const {
+ return CanQual<T>::CreateUnsafe(QualType(getTypePtr(), TQs));
+ }
+
+ /// \brief Determines whether this canonical type is more qualified than
+ /// the @p Other canonical type.
+ bool isMoreQualifiedThan(CanQual<T> Other) const {
+ return Stored.isMoreQualifiedThan(Other.Stored);
+ }
+
+ /// \brief Determines whether this canonical type is at least as qualified as
+ /// the @p Other canonical type.
+ bool isAtLeastAsQualifiedAs(CanQual<T> Other) const {
+ return Stored.isAtLeastAsQualifiedAs(Other.Stored);
+ }
+
+ /// \brief If the canonical type is a reference type, returns the type that
+ /// it refers to; otherwise, returns the type itself.
+ CanQual<Type> getNonReferenceType() const;
+
+ /// \brief Retrieve the internal representation of this canonical type.
+ void *getAsOpaquePtr() const { return Stored.getAsOpaquePtr(); }
+
+ /// \brief Construct a canonical type from its internal representation.
+ static CanQual<T> getFromOpaquePtr(void *Ptr);
+
+ /// \brief Builds a canonical type from a QualType.
+ ///
+ /// This routine is inherently unsafe, because it requires the user to
+ /// ensure that the given type is a canonical type with the correct
+ // (dynamic) type.
+ static CanQual<T> CreateUnsafe(QualType Other);
+};
+
+template<typename T, typename U>
+inline bool operator==(CanQual<T> x, CanQual<U> y) {
+ return x.getAsOpaquePtr() == y.getAsOpaquePtr();
+}
+
+template<typename T, typename U>
+inline bool operator!=(CanQual<T> x, CanQual<U> y) {
+ return x.getAsOpaquePtr() != y.getAsOpaquePtr();
+}
+
+/// \brief Represents a canonical, potentially-qualified type.
+typedef CanQual<Type> CanQualType;
+
+//----------------------------------------------------------------------------//
+// Internal proxy classes used by canonical types
+//----------------------------------------------------------------------------//
+
+#define LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(Accessor) \
+CanQualType Accessor() const { \
+return CanQualType::CreateUnsafe(this->getTypePtr()->Accessor()); \
+}
+
+#define LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Type, Accessor) \
+Type Accessor() const { return this->getTypePtr()->Accessor(); }
+
+/// \brief Base class of all canonical proxy types, which is responsible for
+/// storing the underlying canonical type and providing basic conversions.
+template<typename T>
+class CanProxyBase {
+protected:
+ CanQual<T> Stored;
+
+public:
+ /// \brief Retrieve the pointer to the underlying Type
+ T* getTypePtr() const { return Stored.getTypePtr(); }
+
+ /// \brief Implicit conversion to the underlying pointer.
+ ///
+ /// Also provides the ability to use canonical type proxies in a Boolean
+ // context,e.g.,
+ /// @code
+ /// if (CanQual<PointerType> Ptr = T->getAs<PointerType>()) { ... }
+ /// @endcode
+ operator const T*() const { return this->Stored.getTypePtr(); }
+
+ /// \brief Try to convert the given canonical type to a specific structural
+ /// type.
+ template<typename U> CanProxy<U> getAs() const {
+ return this->Stored.template getAs<U>();
+ }
+
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Type::TypeClass, getTypeClass)
+
+ // Type predicates
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isObjectType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isIncompleteType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isIncompleteOrObjectType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isPODType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isVariablyModifiedType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isIntegerType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isEnumeralType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isBooleanType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isCharType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isWideCharType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isIntegralType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isRealFloatingType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isComplexType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isAnyComplexType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isFloatingType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isRealType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isArithmeticType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isVoidType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isDerivedType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isScalarType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isAggregateType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isAnyPointerType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isVoidPointerType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isFunctionPointerType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isMemberFunctionPointerType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isClassType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isStructureType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isUnionType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isComplexIntegerType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isNullPtrType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isDependentType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isOverloadableType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, hasPointerRepresentation)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, hasObjCPointerRepresentation)
+ 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, isConstantSizeType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isSpecifierType)
+
+ /// \brief Retrieve the proxy-adaptor type.
+ ///
+ /// This arrow operator is used when CanProxyAdaptor has been specialized
+ /// for the given type T. In that case, we reference members of the
+ /// CanProxyAdaptor specialization. Otherwise, this operator will be hidden
+ /// by the arrow operator in the primary CanProxyAdaptor template.
+ const CanProxyAdaptor<T> *operator->() const {
+ return static_cast<const CanProxyAdaptor<T> *>(this);
+ }
+};
+
+/// \brief Replacable canonical proxy adaptor class that provides the link
+/// between a canonical type and the accessors of the type.
+///
+/// The CanProxyAdaptor is a replaceable class template that is instantiated
+/// as part of each canonical proxy type. The primary template merely provides
+/// redirection to the underlying type (T), e.g., @c PointerType. One can
+/// provide specializations of this class template for each underlying type
+/// that provide accessors returning canonical types (@c CanQualType) rather
+/// than the more typical @c QualType, to propagate the notion of "canonical"
+/// through the system.
+template<typename T>
+struct CanProxyAdaptor : CanProxyBase<T> { };
+
+/// \brief Canonical proxy type returned when retrieving the members of a
+/// canonical type or as the result of the @c CanQual<T>::getAs member
+/// function.
+///
+/// The CanProxy type mainly exists as a proxy through which operator-> will
+/// look to either map down to a raw T* (e.g., PointerType*) or to a proxy
+/// type that provides canonical-type access to the fields of the type.
+template<typename T>
+class CanProxy : public CanProxyAdaptor<T> {
+public:
+ /// \brief Build a NULL proxy.
+ CanProxy() { }
+
+ /// \brief Build a proxy to the given canonical type.
+ CanProxy(CanQual<T> Stored) { this->Stored = Stored; }
+
+ /// \brief Implicit conversion to the stored canonical type.
+ operator CanQual<T>() const { return this->Stored; }
+};
+
+} // end namespace clang
+
+namespace llvm {
+
+/// Implement simplify_type for CanQual<T>, so that we can dyn_cast from
+/// CanQual<T> to a specific Type class. We're prefer isa/dyn_cast/cast/etc.
+/// to return smart pointer (proxies?).
+template<typename T>
+struct simplify_type<const ::clang::CanQual<T> > {
+ typedef T* SimpleType;
+ static SimpleType getSimplifiedValue(const ::clang::CanQual<T> &Val) {
+ return Val.getTypePtr();
+ }
+};
+template<typename T>
+struct simplify_type< ::clang::CanQual<T> >
+: public simplify_type<const ::clang::CanQual<T> > {};
+
+// Teach SmallPtrSet that CanQual<T> is "basically a pointer".
+template<typename T>
+class PointerLikeTypeTraits<clang::CanQual<T> > {
+public:
+ static inline void *getAsVoidPointer(clang::CanQual<T> P) {
+ return P.getAsOpaquePtr();
+ }
+ static inline clang::CanQual<T> getFromVoidPointer(void *P) {
+ return clang::CanQual<T>::getFromOpaquePtr(P);
+ }
+ // qualifier information is encoded in the low bits.
+ enum { NumLowBitsAvailable = 0 };
+};
+
+} // end namespace llvm
+
+namespace clang {
+
+//----------------------------------------------------------------------------//
+// Canonical proxy adaptors for canonical type nodes.
+//----------------------------------------------------------------------------//
+
+/// \brief Iterator adaptor that turns an iterator over canonical QualTypes
+/// into an iterator over CanQualTypes.
+template<typename InputIterator>
+class CanTypeIterator {
+ InputIterator Iter;
+
+public:
+ typedef CanQualType value_type;
+ typedef value_type reference;
+ typedef CanProxy<Type> pointer;
+ typedef typename std::iterator_traits<InputIterator>::difference_type
+ difference_type;
+ typedef typename std::iterator_traits<InputIterator>::iterator_category
+ iterator_category;
+
+ CanTypeIterator() : Iter() { }
+ explicit CanTypeIterator(InputIterator Iter) : Iter(Iter) { }
+
+ // Input iterator
+ reference operator*() const {
+ return CanQualType::CreateUnsafe(*Iter);
+ }
+
+ pointer operator->() const;
+
+ CanTypeIterator &operator++() {
+ ++Iter;
+ return *this;
+ }
+
+ CanTypeIterator operator++(int) {
+ CanTypeIterator Tmp(*this);
+ ++Iter;
+ return Tmp;
+ }
+
+ friend bool operator==(const CanTypeIterator& X, const CanTypeIterator &Y) {
+ return X.Iter == Y.Iter;
+ }
+ friend bool operator!=(const CanTypeIterator& X, const CanTypeIterator &Y) {
+ return X.Iter != Y.Iter;
+ }
+
+ // Bidirectional iterator
+ CanTypeIterator &operator--() {
+ --Iter;
+ return *this;
+ }
+
+ CanTypeIterator operator--(int) {
+ CanTypeIterator Tmp(*this);
+ --Iter;
+ return Tmp;
+ }
+
+ // Random access iterator
+ reference operator[](difference_type n) const {
+ return CanQualType::CreateUnsafe(Iter[n]);
+ }
+
+ CanTypeIterator &operator+=(difference_type n) {
+ Iter += n;
+ return *this;
+ }
+
+ CanTypeIterator &operator-=(difference_type n) {
+ Iter -= n;
+ return *this;
+ }
+
+ friend CanTypeIterator operator+(CanTypeIterator X, difference_type n) {
+ X += n;
+ return X;
+ }
+
+ friend CanTypeIterator operator+(difference_type n, CanTypeIterator X) {
+ X += n;
+ return X;
+ }
+
+ friend CanTypeIterator operator-(CanTypeIterator X, difference_type n) {
+ X -= n;
+ return X;
+ }
+
+ friend difference_type operator-(const CanTypeIterator &X,
+ const CanTypeIterator &Y) {
+ return X - Y;
+ }
+};
+
+template<>
+struct CanProxyAdaptor<ComplexType> : public CanProxyBase<ComplexType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
+};
+
+template<>
+struct CanProxyAdaptor<PointerType> : public CanProxyBase<PointerType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
+};
+
+template<>
+struct CanProxyAdaptor<BlockPointerType>
+ : public CanProxyBase<BlockPointerType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
+};
+
+template<>
+struct CanProxyAdaptor<ReferenceType> : public CanProxyBase<ReferenceType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
+};
+
+template<>
+struct CanProxyAdaptor<LValueReferenceType>
+ : public CanProxyBase<LValueReferenceType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
+};
+
+template<>
+struct CanProxyAdaptor<RValueReferenceType>
+ : public CanProxyBase<RValueReferenceType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
+};
+
+template<>
+struct CanProxyAdaptor<MemberPointerType>
+ : public CanProxyBase<MemberPointerType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const Type *, getClass)
+};
+
+template<>
+struct CanProxyAdaptor<ArrayType> : public CanProxyBase<ArrayType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier,
+ getSizeModifier)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Qualifiers, getIndexTypeQualifiers)
+};
+
+template<>
+struct CanProxyAdaptor<ConstantArrayType>
+ : public CanProxyBase<ConstantArrayType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier,
+ getSizeModifier)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Qualifiers, getIndexTypeQualifiers)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const llvm::APInt &, getSize)
+};
+
+template<>
+struct CanProxyAdaptor<ConstantArrayWithExprType>
+ : public CanProxyBase<ConstantArrayWithExprType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier,
+ getSizeModifier)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Qualifiers, getIndexTypeQualifiers)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const llvm::APInt &, getSize)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Expr *, getSizeExpr)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceRange, getBracketsRange)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceLocation, getLBracketLoc)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceLocation, getRBracketLoc)
+};
+
+template<>
+struct CanProxyAdaptor<ConstantArrayWithoutExprType>
+ : public CanProxyBase<ConstantArrayWithoutExprType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier,
+ getSizeModifier)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Qualifiers, getIndexTypeQualifiers)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const llvm::APInt &, getSize)
+};
+
+template<>
+struct CanProxyAdaptor<IncompleteArrayType>
+ : public CanProxyBase<IncompleteArrayType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier,
+ getSizeModifier)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Qualifiers, getIndexTypeQualifiers)
+};
+
+template<>
+struct CanProxyAdaptor<VariableArrayType>
+ : public CanProxyBase<VariableArrayType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier,
+ getSizeModifier)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Qualifiers, getIndexTypeQualifiers)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Expr *, getSizeExpr)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceRange, getBracketsRange)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceLocation, getLBracketLoc)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceLocation, getRBracketLoc)
+};
+
+template<>
+struct CanProxyAdaptor<DependentSizedArrayType>
+ : public CanProxyBase<DependentSizedArrayType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Expr *, getSizeExpr)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceRange, getBracketsRange)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceLocation, getLBracketLoc)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceLocation, getRBracketLoc)
+};
+
+template<>
+struct CanProxyAdaptor<DependentSizedExtVectorType>
+ : public CanProxyBase<DependentSizedExtVectorType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const Expr *, getSizeExpr)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceLocation, getAttributeLoc)
+};
+
+template<>
+struct CanProxyAdaptor<VectorType> : public CanProxyBase<VectorType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getNumElements)
+};
+
+template<>
+struct CanProxyAdaptor<ExtVectorType> : public CanProxyBase<ExtVectorType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getNumElements)
+};
+
+template<>
+struct CanProxyAdaptor<FunctionType> : public CanProxyBase<FunctionType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getResultType)
+};
+
+template<>
+struct CanProxyAdaptor<FunctionNoProtoType>
+ : public CanProxyBase<FunctionNoProtoType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getResultType)
+};
+
+template<>
+struct CanProxyAdaptor<FunctionProtoType>
+ : public CanProxyBase<FunctionProtoType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getResultType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getNumArgs);
+ CanQualType getArgType(unsigned i) const {
+ return CanQualType::CreateUnsafe(this->getTypePtr()->getArgType(i));
+ }
+
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isVariadic)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getTypeQuals)
+
+ typedef CanTypeIterator<FunctionProtoType::arg_type_iterator>
+ arg_type_iterator;
+
+ arg_type_iterator arg_type_begin() const {
+ return arg_type_iterator(this->getTypePtr()->arg_type_begin());
+ }
+
+ arg_type_iterator arg_type_end() const {
+ return arg_type_iterator(this->getTypePtr()->arg_type_end());
+ }
+
+ // Note: canonical function types never have exception specifications
+};
+
+template<>
+struct CanProxyAdaptor<TypeOfType> : public CanProxyBase<TypeOfType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getUnderlyingType)
+};
+
+template<>
+struct CanProxyAdaptor<DecltypeType> : public CanProxyBase<DecltypeType> {
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Expr *, getUnderlyingExpr)
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getUnderlyingType)
+};
+
+template<>
+struct CanProxyAdaptor<TagType> : public CanProxyBase<TagType> {
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(TagDecl *, getDecl)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isBeingDefined)
+};
+
+template<>
+struct CanProxyAdaptor<RecordType> : public CanProxyBase<RecordType> {
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(RecordDecl *, getDecl)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isBeingDefined)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, hasConstFields)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getAddressSpace)
+};
+
+template<>
+struct CanProxyAdaptor<EnumType> : public CanProxyBase<EnumType> {
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(EnumDecl *, getDecl)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isBeingDefined)
+};
+
+template<>
+struct CanProxyAdaptor<TemplateTypeParmType>
+ : public CanProxyBase<TemplateTypeParmType> {
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getDepth)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getIndex)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isParameterPack)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(IdentifierInfo *, getName)
+};
+
+template<>
+struct CanProxyAdaptor<ObjCObjectPointerType>
+ : public CanProxyBase<ObjCObjectPointerType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const ObjCInterfaceType *,
+ getInterfaceType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isObjCIdType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isObjCClassType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isObjCQualifiedIdType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isObjCQualifiedClassType)
+
+ typedef ObjCObjectPointerType::qual_iterator qual_iterator;
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(qual_iterator, qual_begin)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(qual_iterator, qual_end)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, qual_empty)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getNumProtocols)
+};
+
+//----------------------------------------------------------------------------//
+// Method and function definitions
+//----------------------------------------------------------------------------//
+template<typename T>
+inline CanQual<T> CanQual<T>::getUnqualifiedType() const {
+ return CanQual<T>::CreateUnsafe(Stored.getUnqualifiedType());
+}
+
+template<typename T>
+inline CanQual<Type> CanQual<T>::getNonReferenceType() const {
+ if (CanQual<ReferenceType> RefType = getAs<ReferenceType>())
+ return RefType->getPointeeType();
+ else
+ return *this;
+}
+
+template<typename T>
+CanQual<T> CanQual<T>::getFromOpaquePtr(void *Ptr) {
+ CanQual<T> Result;
+ Result.Stored.setFromOpaqueValue(Ptr);
+ assert((!Result || Result.Stored.isCanonical())
+ && "Type is not canonical!");
+ return Result;
+}
+
+template<typename T>
+CanQual<T> CanQual<T>::CreateUnsafe(QualType Other) {
+ assert((Other.isNull() || Other->isCanonical()) && "Type is not canonical!");
+ assert((Other.isNull() || isa<T>(Other.getTypePtr())) &&
+ "Dynamic type does not meet the static type's requires");
+ CanQual<T> Result;
+ Result.Stored = Other;
+ return Result;
+}
+
+template<typename T>
+template<typename U>
+CanProxy<U> CanQual<T>::getAs() const {
+ if (Stored.isNull())
+ return CanProxy<U>();
+
+ if (isa<U>(Stored.getTypePtr()))
+ return CanQual<U>::CreateUnsafe(Stored);
+
+ return CanProxy<U>();
+}
+
+template<typename T>
+CanProxy<T> CanQual<T>::operator->() const {
+ return CanProxy<T>(*this);
+}
+
+template<typename InputIterator>
+typename CanTypeIterator<InputIterator>::pointer
+CanTypeIterator<InputIterator>::operator->() const {
+ return CanProxy<Type>(*this);
+}
+
+}
+
+
+#endif // LLVM_CLANG_AST_CANONICAL_TYPE_H
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index 69a52869d818..7c326dee338c 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -16,6 +16,7 @@
#include "clang/AST/APValue.h"
#include "clang/AST/DeclBase.h"
+#include "clang/AST/Redeclarable.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/ExternalASTSource.h"
@@ -26,23 +27,45 @@ class Stmt;
class CompoundStmt;
class StringLiteral;
class TemplateArgumentList;
+class MemberSpecializationInfo;
class FunctionTemplateSpecializationInfo;
-
+class TypeLoc;
+
+/// \brief A container of type source information.
+///
+/// A client can read the relevant info using TypeLoc wrappers, e.g:
+/// @code
+/// TypeLoc TL = DeclaratorInfo->getTypeLoc();
+/// if (PointerLoc *PL = dyn_cast<PointerLoc>(&TL))
+/// PL->getStarLoc().print(OS, SrcMgr);
+/// @endcode
+///
+class DeclaratorInfo {
+ QualType Ty;
+ // Contains a memory block after the class, used for type source information,
+ // allocated by ASTContext.
+ friend class ASTContext;
+ DeclaratorInfo(QualType ty) : Ty(ty) { }
+public:
+ /// \brief Return the TypeLoc wrapper for the type source info.
+ TypeLoc getTypeLoc() const;
+};
+
/// TranslationUnitDecl - The top declaration context.
class TranslationUnitDecl : public Decl, public DeclContext {
ASTContext &Ctx;
-
+
explicit TranslationUnitDecl(ASTContext &ctx)
: Decl(TranslationUnit, 0, SourceLocation()),
DeclContext(TranslationUnit),
Ctx(ctx) {}
public:
ASTContext &getASTContext() const { return Ctx; }
-
+
static TranslationUnitDecl *Create(ASTContext &C);
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return D->getKind() == TranslationUnit; }
- static bool classof(const TranslationUnitDecl *D) { return true; }
+ static bool classof(const TranslationUnitDecl *D) { return true; }
static DeclContext *castToDeclContext(const TranslationUnitDecl *D) {
return static_cast<DeclContext *>(const_cast<TranslationUnitDecl*>(D));
}
@@ -91,7 +114,7 @@ public:
/// manipulation, so it should be called only when performance doesn't matter.
/// For simple declarations, getNameAsCString() should suffice.
std::string getNameAsString() const { return Name.getAsString(); }
-
+
/// getQualifiedNameAsString - Returns human-readable qualified name for
/// declaration, like A::B::i, for i being member of namespace A::B.
/// If declaration is not member of context which can be named (record,
@@ -99,6 +122,25 @@ public:
/// Creating this name is expensive, so it should be called only when
/// performance doesn't matter.
std::string getQualifiedNameAsString() const;
+ std::string getQualifiedNameAsString(const PrintingPolicy &Policy) const;
+
+ /// getNameForDiagnostic - Appends a human-readable name for this
+ /// declaration into the given string.
+ ///
+ /// This is the method invoked by Sema when displaying a NamedDecl
+ /// in a diagnostic. It does not necessarily produce the same
+ /// result as getNameAsString(); for example, class template
+ /// specializations are printed with their template arguments.
+ ///
+ /// TODO: use an API that doesn't require so many temporary strings
+ virtual void getNameForDiagnostic(std::string &S,
+ const PrintingPolicy &Policy,
+ bool Qualified) const {
+ if (Qualified)
+ S += getQualifiedNameAsString(Policy);
+ else
+ S += getNameAsString();
+ }
/// declarationReplaces - Determine whether this declaration, if
/// known to be well-formed within its context, will replace the
@@ -118,7 +160,7 @@ public:
const NamedDecl *getUnderlyingDecl() const {
return const_cast<NamedDecl*>(this)->getUnderlyingDecl();
}
-
+
static bool classof(const Decl *D) {
return D->getKind() >= NamedFirst && D->getKind() <= NamedLast;
}
@@ -128,7 +170,7 @@ public:
/// NamespaceDecl - Represent a C++ namespace.
class NamespaceDecl : public NamedDecl, public DeclContext {
SourceLocation LBracLoc, RBracLoc;
-
+
// For extended namespace definitions:
//
// namespace A { int x; }
@@ -139,7 +181,7 @@ class NamespaceDecl : public NamedDecl, public DeclContext {
// OrigNamespace points to the original namespace declaration.
// OrigNamespace of the first namespace decl points to itself.
NamespaceDecl *OrigNamespace, *NextNamespace;
-
+
NamespaceDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id)
: NamedDecl(Namespace, DC, L, Id), DeclContext(Namespace) {
OrigNamespace = this;
@@ -148,9 +190,20 @@ class NamespaceDecl : public NamedDecl, public DeclContext {
public:
static NamespaceDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation L, IdentifierInfo *Id);
-
+
virtual void Destroy(ASTContext& C);
+ // \brief Returns true if this is an anonymous namespace declaration.
+ //
+ // For example:
+ // namespace {
+ // ...
+ // };
+ // q.v. C++ [namespace.unnamed]
+ bool isAnonymousNamespace() const {
+ return !getIdentifier();
+ }
+
NamespaceDecl *getNextNamespace() { return NextNamespace; }
const NamespaceDecl *getNextNamespace() const { return NextNamespace; }
void setNextNamespace(NamespaceDecl *ND) { NextNamespace = ND; }
@@ -159,7 +212,9 @@ public:
return OrigNamespace;
}
void setOriginalNamespace(NamespaceDecl *ND) { OrigNamespace = ND; }
-
+
+ virtual NamespaceDecl *getCanonicalDecl() { return OrigNamespace; }
+
virtual SourceRange getSourceRange() const {
return SourceRange(getLocation(), RBracLoc);
}
@@ -168,7 +223,7 @@ public:
SourceLocation getRBracLoc() const { return RBracLoc; }
void setLBracLoc(SourceLocation LBrace) { LBracLoc = LBrace; }
void setRBracLoc(SourceLocation RBrace) { RBracLoc = RBrace; }
-
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return D->getKind() == Namespace; }
static bool classof(const NamespaceDecl *D) { return true; }
@@ -180,20 +235,20 @@ public:
}
};
-/// ValueDecl - Represent the declaration of a variable (in which case it is
+/// ValueDecl - Represent the declaration of a variable (in which case it is
/// an lvalue) a function (in which case it is a function designator) or
-/// an enum constant.
+/// an enum constant.
class ValueDecl : public NamedDecl {
QualType DeclType;
protected:
ValueDecl(Kind DK, DeclContext *DC, SourceLocation L,
- DeclarationName N, QualType T)
+ DeclarationName N, QualType T)
: NamedDecl(DK, DC, L, N), DeclType(T) {}
public:
QualType getType() const { return DeclType; }
void setType(QualType newType) { DeclType = newType; }
-
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) {
return D->getKind() >= ValueFirst && D->getKind() <= ValueLast;
@@ -201,6 +256,29 @@ public:
static bool classof(const ValueDecl *D) { return true; }
};
+/// \brief Represents a ValueDecl that came out of a declarator.
+/// Contains type source information through DeclaratorInfo.
+class DeclaratorDecl : public ValueDecl {
+ DeclaratorInfo *DeclInfo;
+
+protected:
+ DeclaratorDecl(Kind DK, DeclContext *DC, SourceLocation L,
+ DeclarationName N, QualType T, DeclaratorInfo *DInfo)
+ : ValueDecl(DK, DC, L, N, T), DeclInfo(DInfo) {}
+
+public:
+ DeclaratorInfo *getDeclaratorInfo() const { return DeclInfo; }
+ void setDeclaratorInfo(DeclaratorInfo *DInfo) { DeclInfo = DInfo; }
+
+ SourceLocation getTypeSpecStartLoc() const;
+
+ // Implement isa/cast/dyncast/etc.
+ static bool classof(const Decl *D) {
+ return D->getKind() >= DeclaratorFirst && D->getKind() <= DeclaratorLast;
+ }
+ static bool classof(const DeclaratorDecl *D) { return true; }
+};
+
/// \brief Structure used to store a statement, the constant value to
/// which it was evaluated (if any), and whether or not the statement
/// is an integral constant expression (if known).
@@ -222,9 +300,32 @@ struct EvaluatedStmt {
APValue Evaluated;
};
+// \brief Describes the kind of template specialization that a
+// particular template specialization declaration represents.
+enum TemplateSpecializationKind {
+ /// This template specialization was formed from a template-id but
+ /// has not yet been declared, defined, or instantiated.
+ TSK_Undeclared = 0,
+ /// This template specialization was implicitly instantiated from a
+ /// template. (C++ [temp.inst]).
+ TSK_ImplicitInstantiation,
+ /// This template specialization was declared or defined by an
+ /// explicit specialization (C++ [temp.expl.spec]) or partial
+ /// specialization (C++ [temp.class.spec]).
+ TSK_ExplicitSpecialization,
+ /// This template specialization was instantiated from a template
+ /// due to an explicit instantiation declaration request
+ /// (C++0x [temp.explicit]).
+ TSK_ExplicitInstantiationDeclaration,
+ /// This template specialization was instantiated from a template
+ /// due to an explicit instantiation definition request
+ /// (C++ [temp.explicit]).
+ TSK_ExplicitInstantiationDefinition
+};
+
/// VarDecl - An instance of this class is created to represent a variable
/// declaration or definition.
-class VarDecl : public ValueDecl {
+class VarDecl : public DeclaratorDecl, public Redeclarable<VarDecl> {
public:
enum StorageClass {
None, Auto, Register, Extern, Static, PrivateExtern
@@ -236,81 +337,108 @@ public:
/// It is illegal to call this function with SC == None.
static const char *getStorageClassSpecifierString(StorageClass SC);
+protected:
+ /// \brief Placeholder type used in Init to denote an unparsed C++ default
+ /// argument.
+ struct UnparsedDefaultArgument;
+
+ /// \brief Placeholder type used in Init to denote an uninstantiated C++
+ /// default argument.
+ struct UninstantiatedDefaultArgument;
+
+ typedef llvm::PointerUnion4<Stmt *, EvaluatedStmt *,
+ UnparsedDefaultArgument *,
+ UninstantiatedDefaultArgument *> InitType;
+
+ /// \brief The initializer for this variable or, for a ParmVarDecl, the
+ /// C++ default argument.
+ mutable InitType Init;
+
private:
- mutable llvm::PointerUnion<Stmt *, EvaluatedStmt *> Init;
// FIXME: This can be packed into the bitfields in Decl.
unsigned SClass : 3;
bool ThreadSpecified : 1;
- bool HasCXXDirectInit : 1;
+ bool HasCXXDirectInit : 1;
/// DeclaredInCondition - Whether this variable was declared in a
/// condition, e.g., if (int x = foo()) { ... }.
bool DeclaredInCondition : 1;
- /// \brief The previous declaration of this variable.
- VarDecl *PreviousDeclaration;
-
- // Move to DeclGroup when it is implemented.
- SourceLocation TypeSpecStartLoc;
friend class StmtIteratorBase;
protected:
VarDecl(Kind DK, DeclContext *DC, SourceLocation L, IdentifierInfo *Id,
- QualType T, StorageClass SC, SourceLocation TSSL = SourceLocation())
- : ValueDecl(DK, DC, L, Id, T), Init(),
+ QualType T, DeclaratorInfo *DInfo, StorageClass SC)
+ : DeclaratorDecl(DK, DC, L, Id, T, DInfo), Init(),
ThreadSpecified(false), HasCXXDirectInit(false),
- DeclaredInCondition(false), PreviousDeclaration(0),
- TypeSpecStartLoc(TSSL) {
- SClass = SC;
+ DeclaredInCondition(false) {
+ SClass = SC;
}
+
+ typedef Redeclarable<VarDecl> redeclarable_base;
+ virtual VarDecl *getNextRedeclaration() { return RedeclLink.getNext(); }
+
public:
+ typedef redeclarable_base::redecl_iterator redecl_iterator;
+ redecl_iterator redecls_begin() const {
+ return redeclarable_base::redecls_begin();
+ }
+ redecl_iterator redecls_end() const {
+ return redeclarable_base::redecls_end();
+ }
+
static VarDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation L, IdentifierInfo *Id,
- QualType T, StorageClass S,
- SourceLocation TypeSpecStartLoc = SourceLocation());
+ QualType T, DeclaratorInfo *DInfo, StorageClass S);
virtual ~VarDecl();
virtual void Destroy(ASTContext& C);
StorageClass getStorageClass() const { return (StorageClass)SClass; }
void setStorageClass(StorageClass SC) { SClass = SC; }
-
- virtual SourceRange getSourceRange() const;
- SourceLocation getTypeSpecStartLoc() const { return TypeSpecStartLoc; }
- void setTypeSpecStartLoc(SourceLocation SL) {
- TypeSpecStartLoc = SL;
- }
+ virtual SourceRange getSourceRange() const;
- const Expr *getInit() const {
+ const Expr *getInit() const {
if (Init.isNull())
return 0;
const Stmt *S = Init.dyn_cast<Stmt *>();
- if (!S)
- S = Init.get<EvaluatedStmt *>()->Value;
-
- return (const Expr*) S;
+ if (!S) {
+ if (EvaluatedStmt *ES = Init.dyn_cast<EvaluatedStmt*>())
+ S = ES->Value;
+ }
+ return (const Expr*) S;
}
- Expr *getInit() {
+ Expr *getInit() {
if (Init.isNull())
return 0;
Stmt *S = Init.dyn_cast<Stmt *>();
- if (!S)
- S = Init.get<EvaluatedStmt *>()->Value;
+ if (!S) {
+ if (EvaluatedStmt *ES = Init.dyn_cast<EvaluatedStmt*>())
+ S = ES->Value;
+ }
- return (Expr*) S;
+ return (Expr*) S;
}
/// \brief Retrieve the address of the initializer expression.
Stmt **getInitAddress() {
- if (Init.is<Stmt *>())
- return reinterpret_cast<Stmt **>(&Init); // FIXME: ugly hack
- return &Init.get<EvaluatedStmt *>()->Value;
+ if (EvaluatedStmt *ES = Init.dyn_cast<EvaluatedStmt*>())
+ return &ES->Value;
+
+ // This union hack tip-toes around strict-aliasing rules.
+ union {
+ InitType *InitPtr;
+ Stmt **StmtPtr;
+ };
+
+ InitPtr = &Init;
+ return StmtPtr;
}
void setInit(ASTContext &C, Expr *I);
-
+
/// \brief Note that constant evaluation has computed the given
/// value for this variable's initializer.
void setEvaluatedValue(ASTContext &C, const APValue &Value) const {
@@ -325,7 +453,7 @@ public:
Eval->WasEvaluated = true;
Eval->Evaluated = Value;
}
-
+
/// \brief Return the already-evaluated value of this variable's
/// initializer, or NULL if the value is not yet known.
APValue *getEvaluatedValue() const {
@@ -350,7 +478,7 @@ public:
///
/// \pre isInitKnownICE()
bool isInitICE() const {
- assert(isInitKnownICE() &&
+ assert(isInitKnownICE() &&
"Check whether we already know that the initializer is an ICE");
return Init.get<EvaluatedStmt *>()->IsICE;
}
@@ -392,7 +520,7 @@ public:
bool hasCXXDirectInitializer() const {
return HasCXXDirectInit;
}
-
+
/// isDeclaredInCondition - Whether this variable was declared as
/// part of a condition in an if/switch/while statement, e.g.,
/// @code
@@ -401,27 +529,21 @@ public:
bool isDeclaredInCondition() const {
return DeclaredInCondition;
}
- void setDeclaredInCondition(bool InCondition) {
- DeclaredInCondition = InCondition;
+ void setDeclaredInCondition(bool InCondition) {
+ DeclaredInCondition = InCondition;
}
- /// getPreviousDeclaration - Return the previous declaration of this
- /// variable.
- const VarDecl *getPreviousDeclaration() const { return PreviousDeclaration; }
-
- void setPreviousDeclaration(VarDecl *PrevDecl) {
- PreviousDeclaration = PrevDecl;
- }
+ virtual VarDecl *getCanonicalDecl();
/// hasLocalStorage - Returns true if a variable with function scope
/// is a non-static local variable.
bool hasLocalStorage() const {
if (getStorageClass() == None)
return !isFileVarDecl();
-
+
// Return true for: Auto, Register.
// Return false for: Extern, Static, PrivateExtern.
-
+
return getStorageClass() <= Register;
}
@@ -448,7 +570,7 @@ public:
return DC->getLookupContext()->isFunctionOrMethod();
return false;
}
-
+
/// \brief Determines whether this is a static data member.
///
/// This will only be true in C++, and applies to, e.g., the
@@ -462,6 +584,24 @@ public:
return getDeclContext()->isRecord();
}
+ /// \brief If this variable is an instantiated static data member of a
+ /// class template specialization, returns the templated static data member
+ /// from which it was instantiated.
+ VarDecl *getInstantiatedFromStaticDataMember();
+
+ /// \brief If this variable is a static data member, determine what kind of
+ /// template specialization or instantiation this is.
+ TemplateSpecializationKind getTemplateSpecializationKind();
+
+ /// \brief If this variable is an instantiation of a static data member of a
+ /// class template specialization, retrieves the member specialization
+ /// information.
+ MemberSpecializationInfo *getMemberSpecializationInfo();
+
+ /// \brief For a static data member that was instantiated from a static
+ /// data member of a class template, set the template specialiation kind.
+ void setTemplateSpecializationKind(TemplateSpecializationKind TSK);
+
/// isFileVarDecl - Returns true for file scoped variable declaration.
bool isFileVarDecl() const {
if (getKind() != Decl::Var)
@@ -471,16 +611,19 @@ public:
if (isa<TranslationUnitDecl>(Ctx) || isa<NamespaceDecl>(Ctx) )
return true;
}
+ if (isStaticDataMember())
+ return true;
+
return false;
}
/// \brief Determine whether this is a tentative definition of a
/// variable in C.
bool isTentativeDefinition(ASTContext &Context) const;
-
+
/// \brief Determines whether this variable is a variable with
/// external, C linkage.
- bool isExternC(ASTContext &Context) const;
+ bool isExternC() const;
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) {
@@ -492,12 +635,12 @@ public:
class ImplicitParamDecl : public VarDecl {
protected:
ImplicitParamDecl(Kind DK, DeclContext *DC, SourceLocation L,
- IdentifierInfo *Id, QualType Tw)
- : VarDecl(DK, DC, L, Id, Tw, VarDecl::None) {}
+ IdentifierInfo *Id, QualType Tw)
+ : VarDecl(DK, DC, L, Id, Tw, /*DInfo=*/0, VarDecl::None) {}
public:
static ImplicitParamDecl *Create(ASTContext &C, DeclContext *DC,
- SourceLocation L, IdentifierInfo *Id,
- QualType T);
+ SourceLocation L, IdentifierInfo *Id,
+ QualType T);
// Implement isa/cast/dyncast/etc.
static bool classof(const ImplicitParamDecl *D) { return true; }
static bool classof(const Decl *D) { return D->getKind() == ImplicitParam; }
@@ -509,44 +652,72 @@ class ParmVarDecl : public VarDecl {
/// FIXME: Also can be paced into the bitfields in Decl.
/// in, inout, etc.
unsigned objcDeclQualifier : 6;
-
- /// Default argument, if any. [C++ Only]
- Expr *DefaultArg;
+
+ /// \brief Retrieves the fake "value" of an unparsed
+ static Expr *getUnparsedDefaultArgValue() {
+ uintptr_t Value = (uintptr_t)-1;
+ // Mask off the low bits
+ Value &= ~(uintptr_t)0x07;
+ return reinterpret_cast<Expr*> (Value);
+ }
+
protected:
ParmVarDecl(Kind DK, DeclContext *DC, SourceLocation L,
- IdentifierInfo *Id, QualType T, StorageClass S,
- Expr *DefArg)
- : VarDecl(DK, DC, L, Id, T, S),
- objcDeclQualifier(OBJC_TQ_None), DefaultArg(DefArg) {}
+ IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo,
+ StorageClass S, Expr *DefArg)
+ : VarDecl(DK, DC, L, Id, T, DInfo, S), objcDeclQualifier(OBJC_TQ_None) {
+ setDefaultArg(DefArg);
+ }
public:
static ParmVarDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation L,IdentifierInfo *Id,
- QualType T, StorageClass S, Expr *DefArg);
-
+ QualType T, DeclaratorInfo *DInfo,
+ StorageClass S, Expr *DefArg);
+
ObjCDeclQualifier getObjCDeclQualifier() const {
return ObjCDeclQualifier(objcDeclQualifier);
}
void setObjCDeclQualifier(ObjCDeclQualifier QTVal) {
objcDeclQualifier = QTVal;
}
-
- const Expr *getDefaultArg() const {
+
+ const Expr *getDefaultArg() const {
assert(!hasUnparsedDefaultArg() && "Default argument is not yet parsed!");
- return DefaultArg;
+ assert(!hasUninstantiatedDefaultArg() &&
+ "Default argument is not yet instantiated!");
+ return getInit();
}
- Expr *getDefaultArg() {
+ Expr *getDefaultArg() {
assert(!hasUnparsedDefaultArg() && "Default argument is not yet parsed!");
- return DefaultArg;
+ assert(!hasUninstantiatedDefaultArg() &&
+ "Default argument is not yet instantiated!");
+ return getInit();
+ }
+ void setDefaultArg(Expr *defarg) {
+ Init = reinterpret_cast<Stmt *>(defarg);
+ }
+
+ /// \brief Retrieve the source range that covers the entire default
+ /// argument.
+ SourceRange getDefaultArgRange() const;
+ void setUninstantiatedDefaultArg(Expr *arg) {
+ Init = reinterpret_cast<UninstantiatedDefaultArgument *>(arg);
+ }
+ Expr *getUninstantiatedDefaultArg() {
+ return (Expr *)Init.get<UninstantiatedDefaultArgument *>();
+ }
+ const Expr *getUninstantiatedDefaultArg() const {
+ return (const Expr *)Init.get<UninstantiatedDefaultArgument *>();
}
- void setDefaultArg(Expr *defarg) { DefaultArg = defarg; }
/// hasDefaultArg - Determines whether this parameter has a default argument,
/// either parsed or not.
bool hasDefaultArg() const {
- return DefaultArg != 0;
+ return getInit() || hasUnparsedDefaultArg() ||
+ hasUninstantiatedDefaultArg();
}
-
+
/// hasUnparsedDefaultArg - Determines whether this parameter has a
/// default argument that has not yet been parsed. This will occur
/// during the processing of a C++ class whose member functions have
@@ -558,7 +729,11 @@ public:
/// }; // x has a regular default argument now
/// @endcode
bool hasUnparsedDefaultArg() const {
- return DefaultArg == reinterpret_cast<Expr *>(-1);
+ return Init.is<UnparsedDefaultArgument*>();
+ }
+
+ bool hasUninstantiatedDefaultArg() const {
+ return Init.is<UninstantiatedDefaultArgument*>();
}
/// setUnparsedDefaultArg - Specify that this parameter has an
@@ -566,10 +741,12 @@ public:
/// real default argument via setDefaultArg when the class
/// definition enclosing the function declaration that owns this
/// default argument is completed.
- void setUnparsedDefaultArg() { DefaultArg = reinterpret_cast<Expr *>(-1); }
+ void setUnparsedDefaultArg() {
+ Init = (UnparsedDefaultArgument *)0;
+ }
QualType getOriginalType() const;
-
+
/// setOwningFunction - Sets the function declaration that owns this
/// ParmVarDecl. Since ParmVarDecls are often created before the
/// FunctionDecls that own them, this routine is required to update
@@ -577,9 +754,9 @@ public:
void setOwningFunction(DeclContext *FD) { setDeclContext(FD); }
// Implement isa/cast/dyncast/etc.
- static bool classof(const Decl *D) {
+ static bool classof(const Decl *D) {
return (D->getKind() == ParmVar ||
- D->getKind() == OriginalParmVar);
+ D->getKind() == OriginalParmVar);
}
static bool classof(const ParmVarDecl *D) { return true; }
};
@@ -594,15 +771,17 @@ protected:
QualType OriginalType;
private:
OriginalParmVarDecl(DeclContext *DC, SourceLocation L,
- IdentifierInfo *Id, QualType T,
+ IdentifierInfo *Id, QualType T,
+ DeclaratorInfo *DInfo,
QualType OT, StorageClass S,
Expr *DefArg)
- : ParmVarDecl(OriginalParmVar, DC, L, Id, T, S, DefArg), OriginalType(OT) {}
+ : ParmVarDecl(OriginalParmVar, DC, L, Id, T, DInfo, S, DefArg),
+ OriginalType(OT) {}
public:
static OriginalParmVarDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation L,IdentifierInfo *Id,
- QualType T, QualType OT,
- StorageClass S, Expr *DefArg);
+ QualType T, DeclaratorInfo *DInfo,
+ QualType OT, StorageClass S, Expr *DefArg);
void setOriginalType(QualType T) { OriginalType = T; }
@@ -610,9 +789,9 @@ public:
static bool classof(const Decl *D) { return D->getKind() == OriginalParmVar; }
static bool classof(const OriginalParmVarDecl *D) { return true; }
};
-
+
/// FunctionDecl - An instance of this class is created to represent a
-/// function declaration or definition.
+/// function declaration or definition.
///
/// Since a given function can be declared several times in a program,
/// there may be several FunctionDecls that correspond to that
@@ -621,46 +800,35 @@ public:
/// FunctionDecl (e.g., the translation unit); this FunctionDecl
/// contains all of the information known about the function. Other,
/// previous declarations of the function are available via the
-/// getPreviousDeclaration() chain.
-class FunctionDecl : public ValueDecl, public DeclContext {
+/// getPreviousDeclaration() chain.
+class FunctionDecl : public DeclaratorDecl, public DeclContext,
+ public Redeclarable<FunctionDecl> {
public:
enum StorageClass {
None, Extern, Static, PrivateExtern
};
-
-private:
+
+private:
/// ParamInfo - new[]'d array of pointers to VarDecls for the formal
/// parameters of this function. This is null if a prototype or if there are
/// no formals.
ParmVarDecl **ParamInfo;
-
+
LazyDeclStmtPtr Body;
-
- /// PreviousDeclaration - A link to the previous declaration of this
- /// same function, NULL if this is the first declaration. For
- /// example, in the following code, the PreviousDeclaration can be
- /// traversed several times to see all three declarations of the
- /// function "f", the last of which is also a definition.
- ///
- /// int f(int x, int y = 1);
- /// int f(int x = 0, int y);
- /// int f(int x, int y) { return x + y; }
- FunctionDecl *PreviousDeclaration;
// FIXME: This can be packed into the bitfields in Decl.
// NOTE: VC++ treats enums as signed, avoid using the StorageClass enum
unsigned SClass : 2;
bool IsInline : 1;
- bool C99InlineDefinition : 1;
bool IsVirtualAsWritten : 1;
bool IsPure : 1;
bool HasInheritedPrototype : 1;
bool HasWrittenPrototype : 1;
bool IsDeleted : 1;
+ bool IsTrivial : 1; // sunk from CXXMethodDecl
+ bool IsCopyAssignment : 1; // sunk from CXXMethodDecl
+ bool HasImplicitReturnZero : 1;
- // Move to DeclGroup when it is implemented.
- SourceLocation TypeSpecStartLoc;
-
/// \brief End part of this FunctionDecl's source range.
///
/// We could compute the full range in getSourceRange(). However, when we're
@@ -672,42 +840,59 @@ private:
/// \brief The template or declaration that this declaration
/// describes or was instantiated from, respectively.
- ///
+ ///
/// For non-templates, this value will be NULL. For function
/// declarations that describe a function template, this will be a
/// pointer to a FunctionTemplateDecl. For member functions
- /// of class template specializations, this will be the
- /// FunctionDecl from which the member function was instantiated.
- /// For function template specializations, this will be a
+ /// of class template specializations, this will be a MemberSpecializationInfo
+ /// pointer containing information about the specialization.
+ /// For function template specializations, this will be a
/// FunctionTemplateSpecializationInfo, which contains information about
- /// the template being specialized and the template arguments involved in
+ /// the template being specialized and the template arguments involved in
/// that specialization.
- llvm::PointerUnion3<FunctionTemplateDecl*, FunctionDecl*,
- FunctionTemplateSpecializationInfo*>
+ llvm::PointerUnion3<FunctionTemplateDecl *,
+ MemberSpecializationInfo *,
+ FunctionTemplateSpecializationInfo *>
TemplateOrSpecialization;
protected:
FunctionDecl(Kind DK, DeclContext *DC, SourceLocation L,
- DeclarationName N, QualType T,
- StorageClass S, bool isInline,
- SourceLocation TSSL = SourceLocation())
- : ValueDecl(DK, DC, L, N, T),
+ DeclarationName N, QualType T, DeclaratorInfo *DInfo,
+ StorageClass S, bool isInline)
+ : DeclaratorDecl(DK, DC, L, N, T, DInfo),
DeclContext(DK),
- ParamInfo(0), Body(), PreviousDeclaration(0),
- SClass(S), IsInline(isInline), C99InlineDefinition(false),
- IsVirtualAsWritten(false), IsPure(false), HasInheritedPrototype(false),
- HasWrittenPrototype(true), IsDeleted(false), TypeSpecStartLoc(TSSL),
+ ParamInfo(0), Body(),
+ SClass(S), IsInline(isInline),
+ IsVirtualAsWritten(false), IsPure(false), HasInheritedPrototype(false),
+ HasWrittenPrototype(true), IsDeleted(false), IsTrivial(false),
+ IsCopyAssignment(false),
+ HasImplicitReturnZero(false),
EndRangeLoc(L), TemplateOrSpecialization() {}
virtual ~FunctionDecl() {}
virtual void Destroy(ASTContext& C);
+ typedef Redeclarable<FunctionDecl> redeclarable_base;
+ virtual FunctionDecl *getNextRedeclaration() { return RedeclLink.getNext(); }
+
public:
+ typedef redeclarable_base::redecl_iterator redecl_iterator;
+ redecl_iterator redecls_begin() const {
+ return redeclarable_base::redecls_begin();
+ }
+ redecl_iterator redecls_end() const {
+ return redeclarable_base::redecls_end();
+ }
+
static FunctionDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L,
- DeclarationName N, QualType T,
+ DeclarationName N, QualType T,
+ DeclaratorInfo *DInfo,
StorageClass S = None, bool isInline = false,
- bool hasWrittenPrototype = true,
- SourceLocation TSStartLoc = SourceLocation());
+ bool hasWrittenPrototype = true);
+
+ virtual void getNameForDiagnostic(std::string &S,
+ const PrintingPolicy &Policy,
+ bool Qualified) const;
virtual SourceRange getSourceRange() const {
return SourceRange(getLocation(), EndRangeLoc);
@@ -715,9 +900,6 @@ public:
void setLocEnd(SourceLocation E) {
EndRangeLoc = E;
}
-
- SourceLocation getTypeSpecStartLoc() const { return TypeSpecStartLoc; }
- void setTypeSpecStartLoc(SourceLocation TS) { TypeSpecStartLoc = TS; }
/// getBody - Retrieve the body (definition) of the function. The
/// function body might be in any of the (re-)declarations of this
@@ -731,10 +913,6 @@ public:
return getBody(Definition);
}
- /// \brief If the function has a body that is immediately available,
- /// return it.
- Stmt *getBodyIfAvailable() const;
-
/// 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
@@ -755,14 +933,30 @@ public:
bool isPure() const { return IsPure; }
void setPure(bool P = true) { IsPure = P; }
+ /// Whether this function is "trivial" in some specialized C++ senses.
+ /// Can only be true for default constructors, copy constructors,
+ /// copy assignment operators, and destructors. Not meaningful until
+ /// the class has been fully built by Sema.
+ bool isTrivial() const { return IsTrivial; }
+ void setTrivial(bool IT) { IsTrivial = IT; }
+
+ bool isCopyAssignment() const { return IsCopyAssignment; }
+ void setCopyAssignment(bool CA) { IsCopyAssignment = CA; }
+
+ /// 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.
+ bool hasImplicitReturnZero() const { return HasImplicitReturnZero; }
+ void setHasImplicitReturnZero(bool IRZ) { HasImplicitReturnZero = IRZ; }
+
/// \brief Whether this function has a prototype, either because one
/// was explicitly written or because it was "inherited" by merging
/// a declaration without a prototype with a declaration that has a
/// prototype.
- bool hasPrototype() const {
- return HasWrittenPrototype || HasInheritedPrototype;
+ bool hasPrototype() const {
+ return HasWrittenPrototype || HasInheritedPrototype;
}
-
+
bool hasWrittenPrototype() const { return HasWrittenPrototype; }
void setHasWrittenPrototype(bool P) { HasWrittenPrototype = P; }
@@ -798,39 +992,36 @@ public:
/// \brief Determines whether this function is a function with
/// external, C linkage.
- bool isExternC(ASTContext &Context) const;
+ bool isExternC() const;
/// \brief Determines whether this is a global function.
bool isGlobal() const;
- /// getPreviousDeclaration - Return the previous declaration of this
- /// function.
- const FunctionDecl *getPreviousDeclaration() const {
- return PreviousDeclaration;
- }
-
void setPreviousDeclaration(FunctionDecl * PrevDecl);
- unsigned getBuiltinID(ASTContext &Context) const;
+ virtual const FunctionDecl *getCanonicalDecl() const;
+ virtual FunctionDecl *getCanonicalDecl();
+
+ unsigned getBuiltinID() const;
unsigned getNumParmVarDeclsFromType() const;
-
+
// Iterator access to formal parameters.
unsigned param_size() const { return getNumParams(); }
typedef ParmVarDecl **param_iterator;
typedef ParmVarDecl * const *param_const_iterator;
-
+
param_iterator param_begin() { return ParamInfo; }
param_iterator param_end() { return ParamInfo+param_size(); }
-
+
param_const_iterator param_begin() const { return ParamInfo; }
param_const_iterator param_end() const { return ParamInfo+param_size(); }
-
+
/// getNumParams - Return the number of parameters this function must have
/// based on its functiontype. This is the length of the PararmInfo array
/// after it has been created.
unsigned getNumParams() const;
-
+
const ParmVarDecl *getParamDecl(unsigned i) const {
assert(i < getNumParams() && "Illegal param #");
return ParamInfo[i];
@@ -847,8 +1038,8 @@ public:
/// arguments (in C++).
unsigned getMinRequiredArguments() const;
- QualType getResultType() const {
- return getType()->getAsFunctionType()->getResultType();
+ QualType getResultType() const {
+ return getType()->getAs<FunctionType>()->getResultType();
}
StorageClass getStorageClass() const { return StorageClass(SClass); }
void setStorageClass(StorageClass SC) { SClass = SC; }
@@ -856,27 +1047,11 @@ public:
bool isInline() const { return IsInline; }
void setInline(bool I) { IsInline = I; }
- /// \brief Whether this function is an "inline definition" as
- /// defined by C99.
- bool isC99InlineDefinition() const { return C99InlineDefinition; }
- void setC99InlineDefinition(bool I) { C99InlineDefinition = I; }
-
- /// \brief Determines whether this function has a gnu_inline
- /// attribute that affects its semantics.
- ///
- /// The gnu_inline attribute only introduces GNU inline semantics
- /// when all of the inline declarations of the function are marked
- /// gnu_inline.
- bool hasActiveGNUInlineAttribute(ASTContext &Context) const;
-
- /// \brief Determines whether this function is a GNU "extern
- /// inline", which is roughly the opposite of a C99 "extern inline"
- /// function.
- bool isExternGNUInline(ASTContext &Context) const;
-
+ bool isInlineDefinitionExternallyVisible() const;
+
/// isOverloadedOperator - Whether this function declaration
/// represents an C++ overloaded operator, e.g., "operator+".
- bool isOverloadedOperator() const {
+ bool isOverloadedOperator() const {
return getOverloadedOperator() != OO_None;
};
@@ -903,15 +1078,17 @@ public:
/// the FunctionDecl X<T>::A. When a complete definition of
/// X<int>::A is required, it will be instantiated from the
/// declaration returned by getInstantiatedFromMemberFunction().
- FunctionDecl *getInstantiatedFromMemberFunction() const {
- return TemplateOrSpecialization.dyn_cast<FunctionDecl*>();
- }
+ FunctionDecl *getInstantiatedFromMemberFunction() const;
+ /// \brief If this function is an instantiation of a member function of a
+ /// class template specialization, retrieves the member specialization
+ /// information.
+ MemberSpecializationInfo *getMemberSpecializationInfo() const;
+
/// \brief Specify that this record is an instantiation of the
- /// member function RD.
- void setInstantiationOfMemberFunction(FunctionDecl *RD) {
- TemplateOrSpecialization = RD;
- }
+ /// member function FD.
+ void setInstantiationOfMemberFunction(FunctionDecl *FD,
+ TemplateSpecializationKind TSK);
/// \brief Retrieves the function template that is described by this
/// function declaration.
@@ -933,20 +1110,34 @@ public:
TemplateOrSpecialization = Template;
}
+ /// \brief Determine whether this function is a function template
+ /// specialization.
+ bool isFunctionTemplateSpecialization() const {
+ return getPrimaryTemplate() != 0;
+ }
+
+ /// \brief If this function is actually a function template specialization,
+ /// retrieve information about this function template specialization.
+ /// Otherwise, returns NULL.
+ FunctionTemplateSpecializationInfo *getTemplateSpecializationInfo() const {
+ return TemplateOrSpecialization.
+ dyn_cast<FunctionTemplateSpecializationInfo*>();
+ }
+
/// \brief Retrieve the primary template that this function template
/// specialization either specializes or was instantiated from.
///
/// If this function declaration is not a function template specialization,
/// returns NULL.
FunctionTemplateDecl *getPrimaryTemplate() const;
-
+
/// \brief Retrieve the template arguments used to produce this function
/// template specialization from the primary template.
///
/// If this function declaration is not a function template specialization,
/// returns NULL.
- const TemplateArgumentList *getTemplateSpecializationArgs() const;
-
+ const TemplateArgumentList *getTemplateSpecializationArgs() const;
+
/// \brief Specify that this function declaration is actually a function
/// template specialization.
///
@@ -957,19 +1148,30 @@ public:
///
/// \param TemplateArgs the template arguments that produced this
/// function template specialization from the template.
+ ///
+ /// \param InsertPos If non-NULL, the position in the function template
+ /// specialization set where the function template specialization data will
+ /// be inserted.
+ ///
+ /// \param TSK the kind of template specialization this is.
void setFunctionTemplateSpecialization(ASTContext &Context,
FunctionTemplateDecl *Template,
const TemplateArgumentList *TemplateArgs,
- void *InsertPos);
+ void *InsertPos,
+ TemplateSpecializationKind TSK = TSK_ImplicitInstantiation);
- /// \brief Determine whether this is an explicit specialization of a
- /// function template or a member function of a class template.
- bool isExplicitSpecialization() const;
+ /// \brief Determine what kind of template instantiation this function
+ /// represents.
+ TemplateSpecializationKind getTemplateSpecializationKind() const;
- /// \brief Note that this is an explicit specialization of a function template
- /// or a member function of a class template.
- void setExplicitSpecialization(bool ES);
-
+ /// \brief Determine what kind of template instantiation this function
+ /// represents.
+ void setTemplateSpecializationKind(TemplateSpecializationKind TSK);
+
+ /// \brief Determine whether this is or was instantiated from an out-of-line
+ /// definition of a member function.
+ bool isOutOfLine() const;
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) {
return D->getKind() >= FunctionFirst && D->getKind() <= FunctionLast;
@@ -984,22 +1186,23 @@ public:
};
-/// FieldDecl - An instance of this class is created by Sema::ActOnField to
+/// FieldDecl - An instance of this class is created by Sema::ActOnField to
/// represent a member of a struct/union/class.
-class FieldDecl : public ValueDecl {
+class FieldDecl : public DeclaratorDecl {
// FIXME: This can be packed into the bitfields in Decl.
bool Mutable : 1;
Expr *BitWidth;
protected:
- FieldDecl(Kind DK, DeclContext *DC, SourceLocation L,
- IdentifierInfo *Id, QualType T, Expr *BW, bool Mutable)
- : ValueDecl(DK, DC, L, Id, T), Mutable(Mutable), BitWidth(BW)
- { }
+ FieldDecl(Kind DK, DeclContext *DC, SourceLocation L,
+ IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo,
+ Expr *BW, bool Mutable)
+ : DeclaratorDecl(DK, DC, L, Id, T, DInfo), Mutable(Mutable), BitWidth(BW) {
+ }
public:
- static FieldDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L,
- IdentifierInfo *Id, QualType T, Expr *BW,
- bool Mutable);
+ static FieldDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L,
+ IdentifierInfo *Id, QualType T,
+ DeclaratorInfo *DInfo, Expr *BW, bool Mutable);
/// isMutable - Determines whether this field is mutable (C++ only).
bool isMutable() const { return Mutable; }
@@ -1049,7 +1252,7 @@ public:
SourceLocation L, IdentifierInfo *Id,
QualType T, Expr *E,
const llvm::APSInt &V);
-
+
virtual void Destroy(ASTContext& C);
const Expr *getInitExpr() const { return (const Expr*) Init; }
@@ -1058,11 +1261,11 @@ public:
void setInitExpr(Expr *E) { Init = (Stmt*) E; }
void setInitVal(const llvm::APSInt &V) { Val = V; }
-
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return D->getKind() == EnumConstant; }
static bool classof(const EnumConstantDecl *D) { return true; }
-
+
friend class StmtIteratorBase;
};
@@ -1104,16 +1307,16 @@ class TypedefDecl : public TypeDecl {
/// UnderlyingType - This is the type the typedef is set to.
QualType UnderlyingType;
TypedefDecl(DeclContext *DC, SourceLocation L,
- IdentifierInfo *Id, QualType T)
+ IdentifierInfo *Id, QualType T)
: TypeDecl(Typedef, DC, L, Id), UnderlyingType(T) {}
virtual ~TypedefDecl() {}
public:
-
+
static TypedefDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation L,IdentifierInfo *Id,
QualType T);
-
+
QualType getUnderlyingType() const { return UnderlyingType; }
void setUnderlyingType(QualType newType) { UnderlyingType = newType; }
@@ -1123,16 +1326,17 @@ public:
};
class TypedefDecl;
-
+
/// TagDecl - Represents the declaration of a struct/union/class/enum.
-class TagDecl : public TypeDecl, public DeclContext {
+class TagDecl
+ : public TypeDecl, public DeclContext, public Redeclarable<TagDecl> {
public:
- enum TagKind {
- TK_struct,
- TK_union,
- TK_class,
- TK_enum
- };
+ // This is really ugly.
+ typedef ElaboratedType::TagKind TagKind;
+ static const TagKind TK_struct = ElaboratedType::TK_struct;
+ static const TagKind TK_union = ElaboratedType::TK_union;
+ static const TagKind TK_class = ElaboratedType::TK_class;
+ static const TagKind TK_enum = ElaboratedType::TK_enum;
private:
// FIXME: This can be packed into the bitfields in Decl.
@@ -1142,21 +1346,48 @@ private:
/// IsDefinition - True if this is a definition ("struct foo {};"), false if
/// it is a declaration ("struct foo;").
bool IsDefinition : 1;
-
+
/// TypedefForAnonDecl - If a TagDecl is anonymous and part of a typedef,
/// this points to the TypedefDecl. Used for mangling.
TypedefDecl *TypedefForAnonDecl;
-
+
+ SourceLocation TagKeywordLoc;
+ SourceLocation RBraceLoc;
+
protected:
TagDecl(Kind DK, TagKind TK, DeclContext *DC, SourceLocation L,
- IdentifierInfo *Id)
- : TypeDecl(DK, DC, L, Id), DeclContext(DK), TypedefForAnonDecl(0) {
+ IdentifierInfo *Id, TagDecl *PrevDecl,
+ SourceLocation TKL = SourceLocation())
+ : TypeDecl(DK, DC, L, Id), DeclContext(DK), TypedefForAnonDecl(0),
+ TagKeywordLoc(TKL) {
assert((DK != Enum || TK == TK_enum) &&"EnumDecl not matched with TK_enum");
TagDeclKind = TK;
IsDefinition = false;
+ setPreviousDeclaration(PrevDecl);
}
+
+ typedef Redeclarable<TagDecl> redeclarable_base;
+ virtual TagDecl *getNextRedeclaration() { return RedeclLink.getNext(); }
+
public:
-
+ typedef redeclarable_base::redecl_iterator redecl_iterator;
+ redecl_iterator redecls_begin() const {
+ return redeclarable_base::redecls_begin();
+ }
+ redecl_iterator redecls_end() const {
+ return redeclarable_base::redecls_end();
+ }
+
+ SourceLocation getRBraceLoc() const { return RBraceLoc; }
+ void setRBraceLoc(SourceLocation L) { RBraceLoc = L; }
+
+ SourceLocation getTagKeywordLoc() const { return TagKeywordLoc; }
+ void setTagKeywordLoc(SourceLocation TKL) { TagKeywordLoc = TKL; }
+
+ virtual SourceRange getSourceRange() const;
+
+ virtual TagDecl* getCanonicalDecl();
+
/// isDefinition - Return true if this decl has its body specified.
bool isDefinition() const {
return IsDefinition;
@@ -1168,7 +1399,7 @@ public:
bool isDependentType() const { return isDependentContext(); }
/// @brief Starts the definition of this tag declaration.
- ///
+ ///
/// This method should be invoked at the beginning of the definition
/// of this tag declaration. It will set the tag type into a state
/// where it is in the process of being defined.
@@ -1177,7 +1408,7 @@ public:
/// @brief Completes the definition of this tag declaration.
void completeDefinition();
- /// getDefinition - Returns the TagDecl that actually defines this
+ /// getDefinition - Returns the TagDecl that actually defines this
/// struct/union/class/enum. When determining whether or not a
/// struct/union/class/enum is completely defined, one should use this method
/// as opposed to 'isDefinition'. 'isDefinition' indicates whether or not a
@@ -1185,17 +1416,16 @@ public:
/// struct/union/class/enum type is defined. This method returns NULL if
/// there is no TagDecl that defines the struct/union/class/enum.
TagDecl* getDefinition(ASTContext& C) const;
-
+
const char *getKindName() const {
- switch (getTagKind()) {
- default: assert(0 && "Unknown TagKind!");
- case TK_struct: return "struct";
- case TK_union: return "union";
- case TK_class: return "class";
- case TK_enum: return "enum";
- }
+ return ElaboratedType::getNameForTagKind(getTagKind());
}
+ /// getTagKindForTypeSpec - Converts a type specifier (DeclSpec::TST)
+ /// into a tag kind. It is an error to provide a type specifier
+ /// which *isn't* a tag kind here.
+ static TagKind getTagKindForTypeSpec(unsigned TypeSpec);
+
TagKind getTagKind() const {
return TagKind(TagDeclKind);
}
@@ -1206,10 +1436,10 @@ public:
bool isClass() const { return getTagKind() == TK_class; }
bool isUnion() const { return getTagKind() == TK_union; }
bool isEnum() const { return getTagKind() == TK_enum; }
-
+
TypedefDecl *getTypedefForAnonDecl() const { return TypedefForAnonDecl; }
void setTypedefForAnonDecl(TypedefDecl *TDD) { TypedefForAnonDecl = TDD; }
-
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) {
return D->getKind() >= TagFirst && D->getKind() <= TagLast;
@@ -1240,15 +1470,19 @@ class EnumDecl : public TagDecl {
EnumDecl *InstantiatedFrom;
EnumDecl(DeclContext *DC, SourceLocation L,
- IdentifierInfo *Id)
- : TagDecl(Enum, TK_enum, DC, L, Id), InstantiatedFrom(0) {
+ IdentifierInfo *Id, EnumDecl *PrevDecl, SourceLocation TKL)
+ : TagDecl(Enum, TK_enum, DC, L, Id, PrevDecl, TKL), InstantiatedFrom(0) {
IntegerType = QualType();
}
public:
+ EnumDecl *getCanonicalDecl() {
+ return cast<EnumDecl>(TagDecl::getCanonicalDecl());
+ }
+
static EnumDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation L, IdentifierInfo *Id,
- EnumDecl *PrevDecl);
-
+ SourceLocation TKL, EnumDecl *PrevDecl);
+
virtual void Destroy(ASTContext& C);
/// completeDefinition - When created, the EnumDecl corresponds to a
@@ -1257,16 +1491,16 @@ public:
/// added (via DeclContext::addDecl). NewType is the new underlying
/// type of the enumeration type.
void completeDefinition(ASTContext &C, QualType NewType);
-
+
// enumerator_iterator - Iterates through the enumerators of this
// enumeration.
typedef specific_decl_iterator<EnumConstantDecl> enumerator_iterator;
- enumerator_iterator enumerator_begin() const {
+ enumerator_iterator enumerator_begin() const {
return enumerator_iterator(this->decls_begin());
}
- enumerator_iterator enumerator_end() const {
+ enumerator_iterator enumerator_end() const {
return enumerator_iterator(this->decls_end());
}
@@ -1307,18 +1541,24 @@ class RecordDecl : public TagDecl {
/// anonymous struct or union.
bool AnonymousStructOrUnion : 1;
+ /// HasObjectMember - This is true if this struct has at least one
+ /// member containing an object
+ bool HasObjectMember : 1;
+
protected:
RecordDecl(Kind DK, TagKind TK, DeclContext *DC,
- SourceLocation L, IdentifierInfo *Id);
+ SourceLocation L, IdentifierInfo *Id,
+ RecordDecl *PrevDecl, SourceLocation TKL);
virtual ~RecordDecl();
public:
static RecordDecl *Create(ASTContext &C, TagKind TK, DeclContext *DC,
SourceLocation L, IdentifierInfo *Id,
+ SourceLocation TKL = SourceLocation(),
RecordDecl* PrevDecl = 0);
virtual void Destroy(ASTContext& C);
-
+
bool hasFlexibleArrayMember() const { return HasFlexibleArrayMember; }
void setHasFlexibleArrayMember(bool V) { HasFlexibleArrayMember = V; }
@@ -1328,7 +1568,7 @@ public:
/// type declared, e.g.,
/// @code
/// union { int i; float f; };
- /// @endcode
+ /// @endcode
/// is an anonymous union but neither of the following are:
/// @code
/// union X { int i; float f; };
@@ -1339,6 +1579,9 @@ public:
AnonymousStructOrUnion = Anon;
}
+ bool hasObjectMember() const { return HasObjectMember; }
+ void setHasObjectMember (bool val) { HasObjectMember = val; }
+
/// \brief Determines whether this declaration represents the
/// injected class name.
///
@@ -1354,7 +1597,7 @@ public:
/// \endcode
bool isInjectedClassName() const;
- /// getDefinition - Returns the RecordDecl that actually defines this
+ /// getDefinition - Returns the RecordDecl that actually defines this
/// struct/union/class. When determining whether or not a struct/union/class
/// is completely defined, one should use this method as opposed to
/// 'isDefinition'. 'isDefinition' indicates whether or not a specific
@@ -1364,7 +1607,7 @@ public:
RecordDecl* getDefinition(ASTContext& C) const {
return cast_or_null<RecordDecl>(TagDecl::getDefinition(C));
}
-
+
// Iterator access to field members. The field iterator only visits
// the non-static data members of this class, ignoring any static
// data members, functions, constructors, destructors, etc.
@@ -1379,7 +1622,7 @@ public:
// field_empty - Whether there are any fields (non-static data
// members) in this record.
- bool field_empty() const {
+ bool field_empty() const {
return field_begin() == field_end();
}
@@ -1408,7 +1651,7 @@ public:
static bool classof(const Decl *D) {
return D->getKind() == FileScopeAsm;
}
- static bool classof(const FileScopeAsmDecl *D) { return true; }
+ static bool classof(const FileScopeAsmDecl *D) { return true; }
};
/// BlockDecl - This represents a block literal declaration, which is like an
@@ -1423,12 +1666,12 @@ class BlockDecl : public Decl, public DeclContext {
/// no formals.
ParmVarDecl **ParamInfo;
unsigned NumParams;
-
+
Stmt *Body;
-
+
protected:
BlockDecl(DeclContext *DC, SourceLocation CaretLoc)
- : Decl(Block, DC, CaretLoc), DeclContext(Block),
+ : Decl(Block, DC, CaretLoc), DeclContext(Block),
isVariadic(false), ParamInfo(0), NumParams(0), Body(0) {}
virtual ~BlockDecl();
@@ -1441,7 +1684,7 @@ public:
bool IsVariadic() const { return isVariadic; }
void setIsVariadic(bool value) { isVariadic = value; }
-
+
CompoundStmt *getCompoundBody() const { return (CompoundStmt*) Body; }
Stmt *getBody() const { return (Stmt*) Body; }
void setBody(CompoundStmt *B) { Body = (Stmt*) B; }
@@ -1450,14 +1693,14 @@ public:
unsigned param_size() const { return getNumParams(); }
typedef ParmVarDecl **param_iterator;
typedef ParmVarDecl * const *param_const_iterator;
-
+
bool param_empty() const { return NumParams == 0; }
param_iterator param_begin() { return ParamInfo; }
param_iterator param_end() { return ParamInfo+param_size(); }
-
+
param_const_iterator param_begin() const { return ParamInfo; }
param_const_iterator param_end() const { return ParamInfo+param_size(); }
-
+
unsigned getNumParams() const;
const ParmVarDecl *getParamDecl(unsigned i) const {
assert(i < getNumParams() && "Illegal param #");
@@ -1468,10 +1711,10 @@ public:
return ParamInfo[i];
}
void setParams(ASTContext& C, ParmVarDecl **NewParamInfo, unsigned NumParams);
-
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return D->getKind() == Block; }
- static bool classof(const BlockDecl *D) { return true; }
+ static bool classof(const BlockDecl *D) { return true; }
static DeclContext *castToDeclContext(const BlockDecl *D) {
return static_cast<DeclContext *>(const_cast<BlockDecl*>(D));
}
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index 0bce2f84c7ba..9e88871565f1 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -37,6 +37,7 @@ class ObjCCategoryDecl;
class ObjCProtocolDecl;
class ObjCImplementationDecl;
class ObjCCategoryImplDecl;
+class ObjCImplDecl;
class LinkageSpecDecl;
class BlockDecl;
class DeclarationName;
@@ -59,8 +60,8 @@ public:
namespace clang {
-/// Decl - This represents one declaration (or definition), e.g. a variable,
-/// typedef, function, struct, etc.
+/// Decl - This represents one declaration (or definition), e.g. a variable,
+/// typedef, function, struct, etc.
///
class Decl {
public:
@@ -68,7 +69,7 @@ public:
enum Kind {
#define DECL(Derived, Base) Derived,
#define DECL_RANGE(CommonBase, Start, End) \
- CommonBase##First = Start, CommonBase##Last = End,
+ CommonBase##First = Start, CommonBase##Last = End,
#define LAST_DECL_RANGE(CommonBase, Start, End) \
CommonBase##First = Start, CommonBase##Last = End
#include "clang/AST/DeclNodes.def"
@@ -78,7 +79,9 @@ public:
/// namespaces, labels, tags, members and ordinary
/// identifiers. These are meant as bitmasks, so that searches in
/// C++ can look into the "tag" namespace during ordinary lookup. We
- /// use additional namespaces for Objective-C entities.
+ /// use additional namespaces for Objective-C entities. We also
+ /// put C++ friend declarations (of previously-undeclared entities) in
+ /// shadow namespaces.
enum IdentifierNamespace {
IDNS_Label = 0x1,
IDNS_Tag = 0x2,
@@ -86,9 +89,11 @@ public:
IDNS_Ordinary = 0x8,
IDNS_ObjCProtocol = 0x10,
IDNS_ObjCImplementation = 0x20,
- IDNS_ObjCCategoryImpl = 0x40
+ IDNS_ObjCCategoryImpl = 0x40,
+ IDNS_OrdinaryFriend = 0x80,
+ IDNS_TagFriend = 0x100
};
-
+
/// ObjCDeclQualifier - Qualifier used on types in method declarations
/// for remote messaging. They are meant for the arguments though and
/// applied to the Decls (ObjCMethodDecl and ParmVarDecl).
@@ -101,7 +106,7 @@ public:
OBJC_TQ_Byref = 0x10,
OBJC_TQ_Oneway = 0x20
};
-
+
private:
/// NextDeclInContext - The next declaration within the same lexical
/// DeclContext. These pointers form the linked list that is
@@ -114,8 +119,8 @@ private:
DeclContext *SemanticDC;
DeclContext *LexicalDC;
};
-
-
+
+
/// DeclCtx - Holds either a DeclContext* or a MultipleDC*.
/// For declarations that don't contain C++ scope specifiers, it contains
/// the DeclContext where the Decl was declared.
@@ -139,16 +144,16 @@ private:
inline DeclContext *getSemanticDC() const {
return DeclCtx.get<DeclContext*>();
}
-
+
/// Loc - The location that this decl.
SourceLocation Loc;
-
+
/// DeclKind - This indicates which class this is.
Kind DeclKind : 8;
-
+
/// InvalidDecl - This indicates a semantic error occurred.
unsigned int InvalidDecl : 1;
-
+
/// HasAttrs - This indicates whether the decl has attributes or not.
unsigned int HasAttrs : 1;
@@ -162,23 +167,23 @@ private:
protected:
/// IdentifierNamespace - This specifies what IDNS_* namespace this lives in.
- unsigned IdentifierNamespace : 8;
-
+ unsigned IdentifierNamespace : 16;
+
private:
#ifndef NDEBUG
void CheckAccessDeclContext() const;
#else
void CheckAccessDeclContext() const { }
#endif
-
+
protected:
/// Access - Used by C++ decls for the access specifier.
// NOTE: VC++ treats enums as signed, avoid using the AccessSpecifier enum
unsigned Access : 2;
friend class CXXClassMemberWrapper;
- Decl(Kind DK, DeclContext *DC, SourceLocation L)
- : NextDeclInContext(0), DeclCtx(DC),
+ Decl(Kind DK, DeclContext *DC, SourceLocation L)
+ : NextDeclInContext(0), DeclCtx(DC),
Loc(L), DeclKind(DK), InvalidDecl(0),
HasAttrs(false), Implicit(false), Used(false),
IdentifierNamespace(getIdentifierNamespaceForKind(DK)), Access(AS_none) {
@@ -201,7 +206,7 @@ public:
Kind getKind() const { return DeclKind; }
const char *getDeclKindName() const;
-
+
Decl *getNextDeclInContext() { return NextDeclInContext; }
const Decl *getNextDeclInContext() const { return NextDeclInContext; }
@@ -219,16 +224,18 @@ public:
return const_cast<Decl*>(this)->getTranslationUnitDecl();
}
+ bool isInAnonymousNamespace() const;
+
ASTContext &getASTContext() const;
-
+
void setAccess(AccessSpecifier AS) {
- Access = AS;
+ Access = AS;
CheckAccessDeclContext();
}
-
- AccessSpecifier getAccess() const {
+
+ AccessSpecifier getAccess() const {
CheckAccessDeclContext();
- return AccessSpecifier(Access);
+ return AccessSpecifier(Access);
}
bool hasAttrs() const { return HasAttrs; }
@@ -246,11 +253,11 @@ public:
return V;
return 0;
}
-
+
template<typename T> bool hasAttr() const {
return getAttr<T>() != 0;
}
-
+
/// setInvalidDecl - Indicates the Decl had a semantic error. This
/// allows for graceful error recovery.
void setInvalidDecl(bool Invalid = true) { InvalidDecl = Invalid; }
@@ -261,12 +268,12 @@ public:
/// was written explicitly in the source code.
bool isImplicit() const { return Implicit; }
void setImplicit(bool I = true) { Implicit = I; }
-
+
/// \brief Whether this declaration was used, meaning that a definition
/// is required.
bool isUsed() const { return Used; }
void setUsed(bool U = true) { Used = U; }
-
+
unsigned getIdentifierNamespace() const {
return IdentifierNamespace;
}
@@ -275,7 +282,7 @@ public:
}
static unsigned getIdentifierNamespaceForKind(Kind DK);
-
+
/// getLexicalDeclContext - The declaration context where this Decl was
/// lexically declared (LexicalDC). May be different from
/// getDeclContext() (SemanticDC).
@@ -298,7 +305,7 @@ public:
bool isOutOfLine() const {
return getLexicalDeclContext() != getDeclContext();
}
-
+
/// setDeclContext - Set both the semantic and lexical DeclContext
/// to DC.
void setDeclContext(DeclContext *DC);
@@ -311,6 +318,72 @@ public:
// be defined inside or outside a function etc).
bool isDefinedOutsideFunctionOrMethod() const;
+ /// \brief Retrieves the "canonical" declaration of the given declaration.
+ virtual Decl *getCanonicalDecl() { return this; }
+ const Decl *getCanonicalDecl() const {
+ return const_cast<Decl*>(this)->getCanonicalDecl();
+ }
+
+ /// \brief Whether this particular Decl is a canonical one.
+ bool isCanonicalDecl() const { return getCanonicalDecl() == this; }
+
+protected:
+ /// \brief Returns the next redeclaration or itself if this is the only decl.
+ ///
+ /// Decl subclasses that can be redeclared should override this method so that
+ /// Decl::redecl_iterator can iterate over them.
+ virtual Decl *getNextRedeclaration() { return this; }
+
+public:
+ /// \brief Iterates through all the redeclarations of the same decl.
+ class redecl_iterator {
+ /// Current - The current declaration.
+ Decl *Current;
+ Decl *Starter;
+
+ public:
+ typedef Decl* value_type;
+ typedef Decl* reference;
+ typedef Decl* pointer;
+ typedef std::forward_iterator_tag iterator_category;
+ typedef std::ptrdiff_t difference_type;
+
+ redecl_iterator() : Current(0) { }
+ explicit redecl_iterator(Decl *C) : Current(C), Starter(C) { }
+
+ reference operator*() const { return Current; }
+ pointer operator->() const { return Current; }
+
+ redecl_iterator& operator++() {
+ assert(Current && "Advancing while iterator has reached end");
+ // Get either previous decl or latest decl.
+ Decl *Next = Current->getNextRedeclaration();
+ assert(Next && "Should return next redeclaration or itself, never null!");
+ Current = (Next != Starter ? Next : 0);
+ return *this;
+ }
+
+ redecl_iterator operator++(int) {
+ redecl_iterator tmp(*this);
+ ++(*this);
+ return tmp;
+ }
+
+ friend bool operator==(redecl_iterator x, redecl_iterator y) {
+ return x.Current == y.Current;
+ }
+ friend bool operator!=(redecl_iterator x, redecl_iterator y) {
+ return x.Current != y.Current;
+ }
+ };
+
+ /// \brief Returns iterator for all the redeclarations of the same decl.
+ /// It will iterate at least once (when this decl is the only one).
+ redecl_iterator redecls_begin() const {
+ return redecl_iterator(const_cast<Decl*>(this));
+ }
+ redecl_iterator redecls_end() const { return redecl_iterator(); }
+
/// getBody - If this Decl represents a declaration for a body of code,
/// such as a function or method definition, this method returns the
/// top-level Stmt* of that body. Otherwise this method returns null.
@@ -327,33 +400,71 @@ public:
static void addDeclKind(Kind k);
static bool CollectingStats(bool Enable = false);
static void PrintStats();
-
+
/// isTemplateParameter - Determines whether this declaration is a
/// template parameter.
bool isTemplateParameter() const;
-
+
/// isTemplateParameter - Determines whether this declaration is a
/// template parameter pack.
bool isTemplateParameterPack() const;
/// \brief Whether this declaration is a function or function template.
bool isFunctionOrFunctionTemplate() const;
-
+
+ /// \brief Changes the namespace of this declaration to reflect that it's
+ /// the object of a friend declaration.
+ ///
+ /// These declarations appear in the lexical context of the friending
+ /// class, but in the semantic context of the actual entity. This property
+ /// applies only to a specific decl object; other redeclarations of the
+ /// same entity may not (and probably don't) share this property.
+ void setObjectOfFriendDecl(bool PreviouslyDeclared) {
+ unsigned OldNS = IdentifierNamespace;
+ assert((OldNS == IDNS_Tag || OldNS == IDNS_Ordinary ||
+ OldNS == (IDNS_Tag | IDNS_Ordinary))
+ && "unsupported namespace for undeclared friend");
+ if (!PreviouslyDeclared) IdentifierNamespace = 0;
+
+ if (OldNS == IDNS_Tag)
+ IdentifierNamespace |= IDNS_TagFriend;
+ else
+ IdentifierNamespace |= IDNS_OrdinaryFriend;
+ }
+
+ enum FriendObjectKind {
+ FOK_None, // not a friend object
+ FOK_Declared, // a friend of a previously-declared entity
+ FOK_Undeclared // a friend of a previously-undeclared entity
+ };
+
+ /// \brief Determines whether this declaration is the object of a
+ /// friend declaration and, if so, what kind.
+ ///
+ /// There is currently no direct way to find the associated FriendDecl.
+ FriendObjectKind getFriendObjectKind() const {
+ unsigned mask
+ = (IdentifierNamespace & (IDNS_TagFriend | IDNS_OrdinaryFriend));
+ if (!mask) return FOK_None;
+ return (IdentifierNamespace & (IDNS_Tag | IDNS_Ordinary) ?
+ FOK_Declared : FOK_Undeclared);
+ }
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *) { return true; }
static DeclContext *castToDeclContext(const Decl *);
static Decl *castFromDeclContext(const DeclContext *);
-
+
/// Destroy - Call destructors and release memory.
virtual void Destroy(ASTContext& C);
- void print(llvm::raw_ostream &Out, unsigned Indentation = 0);
+ void print(llvm::raw_ostream &Out, unsigned Indentation = 0) const;
void print(llvm::raw_ostream &Out, const PrintingPolicy &Policy,
- unsigned Indentation = 0);
+ unsigned Indentation = 0) const;
static void printGroup(Decl** Begin, unsigned NumDecls,
llvm::raw_ostream &Out, const PrintingPolicy &Policy,
unsigned Indentation = 0);
- void dump();
+ void dump() const;
private:
const Attr *getAttrsImpl() const;
@@ -371,10 +482,10 @@ public:
PrettyStackTraceDecl(Decl *theDecl, SourceLocation L,
SourceManager &sm, const char *Msg)
: TheDecl(theDecl), Loc(L), SM(sm), Message(Msg) {}
-
+
virtual void print(llvm::raw_ostream &OS) const;
-};
-
+};
+
/// DeclContext - This is used only as base class of specific decl types that
/// can act as declaration contexts. These decls are (only the top classes
@@ -386,8 +497,6 @@ public:
/// TagDecl
/// ObjCMethodDecl
/// ObjCContainerDecl
-/// ObjCCategoryImplDecl
-/// ObjCImplementationDecl
/// LinkageSpecDecl
/// BlockDecl
///
@@ -421,9 +530,9 @@ class DeclContext {
mutable Decl *LastDecl;
protected:
- DeclContext(Decl::Kind K)
+ DeclContext(Decl::Kind K)
: DeclKind(K), ExternalLexicalStorage(false),
- ExternalVisibleStorage(false), LookupPtr(0), FirstDecl(0),
+ ExternalVisibleStorage(false), LookupPtr(0), FirstDecl(0),
LastDecl(0) { }
void DestroyDecls(ASTContext &C);
@@ -443,7 +552,7 @@ public:
const DeclContext *getParent() const {
return const_cast<DeclContext*>(this)->getParent();
}
-
+
/// getLexicalParent - Returns the containing lexical DeclContext. May be
/// different from getParent, e.g.:
///
@@ -458,8 +567,14 @@ public:
}
const DeclContext *getLexicalParent() const {
return const_cast<DeclContext*>(this)->getLexicalParent();
- }
+ }
+ DeclContext *getLookupParent();
+
+ const DeclContext *getLookupParent() const {
+ return const_cast<DeclContext*>(this)->getLookupParent();
+ }
+
ASTContext &getParentASTContext() const {
return cast<Decl>(this)->getASTContext();
}
@@ -499,10 +614,10 @@ public:
/// context are semantically declared in the nearest enclosing
/// non-transparent (opaque) context but are lexically declared in
/// this context. For example, consider the enumerators of an
- /// enumeration type:
+ /// enumeration type:
/// @code
/// enum E {
- /// Val1
+ /// Val1
/// };
/// @endcode
/// Here, E is a transparent context, so its enumerator (Val1) will
@@ -512,13 +627,16 @@ public:
/// inline namespaces.
bool isTransparentContext() const;
- bool Encloses(DeclContext *DC) const {
- for (; DC; DC = DC->getParent())
- if (DC == this)
- return true;
- return false;
+ /// \brief Determine whether this declaration context is equivalent
+ /// to the declaration context DC.
+ bool Equals(DeclContext *DC) {
+ return this->getPrimaryContext() == DC->getPrimaryContext();
}
+ /// \brief Determine whether this declaration context encloses the
+ /// declaration context DC.
+ bool Encloses(DeclContext *DC);
+
/// getPrimaryContext - There may be many different
/// declarations of the same entity (including forward declarations
/// of classes, multiple definitions of namespaces, etc.), each with
@@ -535,7 +653,7 @@ public:
const DeclContext *getLookupContext() const {
return const_cast<DeclContext *>(this)->getLookupContext();
}
-
+
/// \brief Retrieve the nearest enclosing namespace context.
DeclContext *getEnclosingNamespaceContext();
const DeclContext *getEnclosingNamespaceContext() const {
@@ -591,16 +709,16 @@ public:
return tmp;
}
- friend bool operator==(decl_iterator x, decl_iterator y) {
+ friend bool operator==(decl_iterator x, decl_iterator y) {
return x.Current == y.Current;
}
- friend bool operator!=(decl_iterator x, decl_iterator y) {
+ friend bool operator!=(decl_iterator x, decl_iterator y) {
return x.Current != y.Current;
}
};
/// decls_begin/decls_end - Iterate over the declarations stored in
- /// this context.
+ /// this context.
decl_iterator decls_begin() const;
decl_iterator decls_end() const;
bool decls_empty() const;
@@ -616,7 +734,7 @@ public:
/// will either be NULL or will point to a declaration of
/// type SpecificDecl.
DeclContext::decl_iterator Current;
-
+
/// SkipToNextDecl - Advances the current position up to the next
/// declaration of type SpecificDecl that also meets the criteria
/// required by Acceptable.
@@ -661,13 +779,13 @@ public:
++(*this);
return tmp;
}
-
+
friend bool
operator==(const specific_decl_iterator& x, const specific_decl_iterator& y) {
return x.Current == y.Current;
}
-
- friend bool
+
+ friend bool
operator!=(const specific_decl_iterator& x, const specific_decl_iterator& y) {
return x.Current != y.Current;
}
@@ -688,7 +806,7 @@ public:
/// will either be NULL or will point to a declaration of
/// type SpecificDecl.
DeclContext::decl_iterator Current;
-
+
/// SkipToNextDecl - Advances the current position up to the next
/// declaration of type SpecificDecl that also meets the criteria
/// required by Acceptable.
@@ -735,13 +853,13 @@ public:
++(*this);
return tmp;
}
-
+
friend bool
operator==(const filtered_decl_iterator& x, const filtered_decl_iterator& y) {
return x.Current == y.Current;
}
-
- friend bool
+
+ friend bool
operator!=(const filtered_decl_iterator& x, const filtered_decl_iterator& y) {
return x.Current != y.Current;
}
@@ -761,6 +879,14 @@ public:
/// semantic context via makeDeclVisibleInContext.
void addDecl(Decl *D);
+ /// @brief Add the declaration D to this context without modifying
+ /// any lookup tables.
+ ///
+ /// This is useful for some operations in dependent contexts where
+ /// the semantic context might not be dependent; this basically
+ /// only happens with friends.
+ void addHiddenDecl(Decl *D);
+
/// lookup_iterator - An iterator that provides access to the results
/// of looking up a name within this context.
typedef NamedDecl **lookup_iterator;
@@ -795,12 +921,16 @@ public:
/// visible from this context, as determined by
/// NamedDecl::declarationReplaces, the previous declaration will be
/// replaced with D.
- void makeDeclVisibleInContext(NamedDecl *D);
+ ///
+ /// @param Recoverable true if it's okay to not add this decl to
+ /// the lookup tables because it can be easily recovered by walking
+ /// the declaration chains.
+ void makeDeclVisibleInContext(NamedDecl *D, bool Recoverable = true);
/// udir_iterator - Iterates through the using-directives stored
/// within this context.
typedef UsingDirectiveDecl * const * udir_iterator;
-
+
typedef std::pair<udir_iterator, udir_iterator> udir_iterator_range;
udir_iterator_range getUsingDirectives() const;
@@ -824,8 +954,8 @@ public:
/// \brief State whether this DeclContext has external storage for
/// declarations lexically in this context.
- void setHasExternalLexicalStorage(bool ES = true) {
- ExternalLexicalStorage = ES;
+ void setHasExternalLexicalStorage(bool ES = true) {
+ ExternalLexicalStorage = ES;
}
/// \brief Whether this DeclContext has external storage containing
@@ -834,8 +964,8 @@ public:
/// \brief State whether this DeclContext has external storage for
/// declarations visible in this context.
- void setHasExternalVisibleStorage(bool ES = true) {
- ExternalVisibleStorage = ES;
+ void setHasExternalVisibleStorage(bool ES = true) {
+ ExternalVisibleStorage = ES;
}
static bool classof(const Decl *D);
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h
index c523e96e03b0..c858c5c0df78 100644
--- a/include/clang/AST/DeclCXX.h
+++ b/include/clang/AST/DeclCXX.h
@@ -14,46 +14,51 @@
#ifndef LLVM_CLANG_AST_DECLCXX_H
#define LLVM_CLANG_AST_DECLCXX_H
+#include "clang/AST/Expr.h"
#include "clang/AST/Decl.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/SmallPtrSet.h"
namespace clang {
class ClassTemplateDecl;
-class CXXRecordDecl;
+class ClassTemplateSpecializationDecl;
+class CXXBasePath;
+class CXXBasePaths;
class CXXConstructorDecl;
-class CXXDestructorDecl;
class CXXConversionDecl;
+class CXXDestructorDecl;
class CXXMethodDecl;
-class ClassTemplateSpecializationDecl;
-
-/// \brief Represents any kind of function declaration, whether it is a
+class CXXRecordDecl;
+class CXXMemberLookupCriteria;
+
+/// \brief Represents any kind of function declaration, whether it is a
/// concrete function or a function template.
class AnyFunctionDecl {
NamedDecl *Function;
-
+
AnyFunctionDecl(NamedDecl *ND) : Function(ND) { }
-
+
public:
AnyFunctionDecl(FunctionDecl *FD) : Function(FD) { }
AnyFunctionDecl(FunctionTemplateDecl *FTD);
-
- /// \brief Implicily converts any function or function template into a
+
+ /// \brief Implicily converts any function or function template into a
/// named declaration.
operator NamedDecl *() const { return Function; }
-
+
/// \brief Retrieve the underlying function or function template.
NamedDecl *get() const { return Function; }
-
- static AnyFunctionDecl getFromNamedDecl(NamedDecl *ND) {
+
+ static AnyFunctionDecl getFromNamedDecl(NamedDecl *ND) {
return AnyFunctionDecl(ND);
}
};
-
+
} // end namespace clang
namespace llvm {
- /// Implement simplify_type for AnyFunctionDecl, so that we can dyn_cast from
+ /// Implement simplify_type for AnyFunctionDecl, so that we can dyn_cast from
/// AnyFunctionDecl to any function or function template declaration.
template<> struct simplify_type<const ::clang::AnyFunctionDecl> {
typedef ::clang::NamedDecl* SimpleType;
@@ -63,26 +68,26 @@ namespace llvm {
};
template<> struct simplify_type< ::clang::AnyFunctionDecl>
: public simplify_type<const ::clang::AnyFunctionDecl> {};
-
+
// Provide PointerLikeTypeTraits for non-cvr pointers.
template<>
class PointerLikeTypeTraits< ::clang::AnyFunctionDecl> {
public:
static inline void *getAsVoidPointer(::clang::AnyFunctionDecl F) {
- return F.get();
+ return F.get();
}
static inline ::clang::AnyFunctionDecl getFromVoidPointer(void *P) {
return ::clang::AnyFunctionDecl::getFromNamedDecl(
static_cast< ::clang::NamedDecl*>(P));
}
-
+
enum { NumLowBitsAvailable = 2 };
};
-
+
} // end namespace llvm
namespace clang {
-
+
/// OverloadedFunctionDecl - An instance of this class represents a
/// set of overloaded functions. All of the functions have the same
/// name and occur within the same scope.
@@ -127,12 +132,64 @@ public:
unsigned size() const { return Functions.size(); }
// Implement isa/cast/dyncast/etc.
- static bool classof(const Decl *D) {
- return D->getKind() == OverloadedFunction;
+ static bool classof(const Decl *D) {
+ return D->getKind() == OverloadedFunction;
}
static bool classof(const OverloadedFunctionDecl *D) { return true; }
};
+/// \brief Provides uniform iteration syntax for an overload set, function,
+/// or function template.
+class OverloadIterator {
+ /// \brief An overloaded function set, function declaration, or
+ /// function template declaration.
+ NamedDecl *D;
+
+ /// \brief If the declaration is an overloaded function set, this is the
+ /// iterator pointing to the current position within that overloaded
+ /// function set.
+ OverloadedFunctionDecl::function_iterator Iter;
+
+public:
+ typedef AnyFunctionDecl value_type;
+ typedef value_type reference;
+ typedef NamedDecl *pointer;
+ typedef int difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ OverloadIterator() : D(0) { }
+
+ OverloadIterator(FunctionDecl *FD) : D(FD) { }
+ OverloadIterator(FunctionTemplateDecl *FTD)
+ : D(reinterpret_cast<NamedDecl*>(FTD)) { }
+ OverloadIterator(OverloadedFunctionDecl *Ovl)
+ : D(Ovl), Iter(Ovl->function_begin()) { }
+
+ OverloadIterator(NamedDecl *ND);
+
+ reference operator*() const;
+
+ pointer operator->() const { return (**this).get(); }
+
+ OverloadIterator &operator++();
+
+ OverloadIterator operator++(int) {
+ OverloadIterator Temp(*this);
+ ++(*this);
+ return Temp;
+ }
+
+ bool Equals(const OverloadIterator &Other) const;
+};
+
+inline bool operator==(const OverloadIterator &X, const OverloadIterator &Y) {
+ return X.Equals(Y);
+}
+
+inline bool operator!=(const OverloadIterator &X, const OverloadIterator &Y) {
+ return !(X == Y);
+}
+
/// CXXBaseSpecifier - A base class of a C++ class.
///
/// Each CXXBaseSpecifier represents a single, direct base class (or
@@ -162,7 +219,7 @@ class CXXBaseSpecifier {
/// struct (false). This determines the mapping from the access
/// specifier as written in the source code to the access specifier
/// used for semantic analysis.