From f27e5a09a0d815b8a4814152954ff87dadfdefc0 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 2 Jun 2009 17:58:47 +0000 Subject: Import Clang, at r72732. --- CMakeLists.txt | 56 + INPUTS/Cocoa_h.m | 2 + INPUTS/c99-intconst-1.c | 639 +++ INPUTS/carbon_h.c | 4 + INPUTS/iostream.cc | 5 + INPUTS/macro_pounder_fn.c | 17 + INPUTS/macro_pounder_obj.c | 16 + INPUTS/stpcpy-test.c | 47 + LICENSE.TXT | 63 + Makefile | 32 + ModuleInfo.txt | 5 + NOTES.txt | 86 + README.txt | 178 + TODO.txt | 68 + clang.xcodeproj/project.pbxproj | 1836 +++++++ docs/AnalyzerRegions.html | 258 + docs/BlockImplementation.txt | 647 +++ docs/BlockLanguageSpec.txt | 165 + docs/DriverArchitecture.png | Bin 0 -> 72966 bytes docs/DriverInternals.html | 517 ++ docs/InternalsManual.html | 1676 ++++++ docs/LanguageExtensions.html | 327 ++ docs/Makefile | 97 + docs/PCHInternals.html | 71 + docs/PTHInternals.html | 177 + docs/UsersManual.html | 688 +++ docs/doxygen.cfg | 1230 +++++ docs/doxygen.cfg.in | 1230 +++++ docs/doxygen.css | 378 ++ docs/doxygen.footer | 10 + docs/doxygen.header | 9 + docs/doxygen.intro | 15 + docs/index.html | 4 + docs/tools/Makefile | 112 + docs/tools/clang.pod | 514 ++ docs/tools/manpage.css | 256 + include/CMakeLists.txt | 1 + include/Makefile | 4 + include/clang/AST/APValue.h | 253 + include/clang/AST/AST.h | 28 + include/clang/AST/ASTConsumer.h | 81 + include/clang/AST/ASTContext.h | 857 +++ include/clang/AST/ASTDiagnostic.h | 27 + include/clang/AST/Attr.h | 506 ++ include/clang/AST/Builtins.def | 389 ++ include/clang/AST/Builtins.h | 137 + include/clang/AST/CFG.h | 405 ++ include/clang/AST/Decl.h | 1409 +++++ include/clang/AST/DeclBase.h | 900 +++ include/clang/AST/DeclCXX.h | 1073 ++++ include/clang/AST/DeclContextInternals.h | 220 + include/clang/AST/DeclGroup.h | 152 + include/clang/AST/DeclNodes.def | 161 + include/clang/AST/DeclObjC.h | 1224 +++++ include/clang/AST/DeclTemplate.h | 859 +++ include/clang/AST/DeclVisitor.h | 54 + include/clang/AST/DeclarationName.h | 357 ++ include/clang/AST/Expr.h | 2500 +++++++++ include/clang/AST/ExprCXX.h | 1234 +++++ include/clang/AST/ExprObjC.h | 494 ++ include/clang/AST/ExternalASTSource.h | 184 + include/clang/AST/NestedNameSpecifier.h | 183 + include/clang/AST/PPCBuiltins.def | 24 + include/clang/AST/ParentMap.h | 50 + include/clang/AST/PrettyPrinter.h | 86 + include/clang/AST/RecordLayout.h | 103 + include/clang/AST/Stmt.h | 1223 +++++ include/clang/AST/StmtCXX.h | 100 + include/clang/AST/StmtGraphTraits.h | 83 + include/clang/AST/StmtIterator.h | 145 + include/clang/AST/StmtNodes.def | 156 + include/clang/AST/StmtObjC.h | 307 ++ include/clang/AST/StmtVisitor.h | 176 + include/clang/AST/TargetBuiltins.h | 38 + include/clang/AST/TemplateName.h | 258 + include/clang/AST/Type.h | 1977 +++++++ include/clang/AST/TypeNodes.def | 85 + include/clang/AST/TypeOrdering.h | 63 + include/clang/AST/X86Builtins.def | 427 ++ include/clang/Analysis/Analyses/LiveVariables.h | 119 + .../clang/Analysis/Analyses/UninitializedValues.h | 74 + include/clang/Analysis/AnalysisDiagnostic.h | 27 + .../clang/Analysis/FlowSensitive/DataflowSolver.h | 291 + .../clang/Analysis/FlowSensitive/DataflowValues.h | 172 + include/clang/Analysis/LocalCheckers.h | 54 + include/clang/Analysis/PathDiagnostic.h | 487 ++ .../Analysis/PathSensitive/BasicValueFactory.h | 163 + include/clang/Analysis/PathSensitive/BugReporter.h | 466 ++ .../Analysis/PathSensitive/ConstraintManager.h | 67 + include/clang/Analysis/PathSensitive/Environment.h | 151 + .../clang/Analysis/PathSensitive/ExplodedGraph.h | 582 ++ include/clang/Analysis/PathSensitive/GRAuditor.h | 39 + .../clang/Analysis/PathSensitive/GRBlockCounter.h | 50 + .../clang/Analysis/PathSensitive/GRCoreEngine.h | 668 +++ .../clang/Analysis/PathSensitive/GRExprEngine.h | 738 +++ .../Analysis/PathSensitive/GRExprEngineBuilders.h | 101 + .../Analysis/PathSensitive/GRSimpleAPICheck.h | 40 + include/clang/Analysis/PathSensitive/GRState.h | 820 +++ .../clang/Analysis/PathSensitive/GRStateTrait.h | 148 + .../clang/Analysis/PathSensitive/GRTransferFuncs.h | 123 + include/clang/Analysis/PathSensitive/GRWorkList.h | 76 + include/clang/Analysis/PathSensitive/MemRegion.h | 665 +++ include/clang/Analysis/PathSensitive/SVals.h | 447 ++ include/clang/Analysis/PathSensitive/Store.h | 204 + .../clang/Analysis/PathSensitive/SymbolManager.h | 329 ++ .../clang/Analysis/PathSensitive/ValueManager.h | 103 + include/clang/Analysis/ProgramPoint.h | 351 ++ .../clang/Analysis/Support/BlkExprDeclBitVector.h | 307 ++ .../Analysis/Visitors/CFGRecStmtDeclVisitor.h | 91 + .../clang/Analysis/Visitors/CFGRecStmtVisitor.h | 35 + include/clang/Analysis/Visitors/CFGStmtVisitor.h | 156 + .../clang/Analysis/Visitors/CFGVarDeclVisitor.h | 64 + include/clang/Basic/CMakeLists.txt | 20 + include/clang/Basic/ConvertUTF.h | 159 + include/clang/Basic/Diagnostic.h | 697 +++ include/clang/Basic/Diagnostic.td | 73 + include/clang/Basic/DiagnosticASTKinds.td | 29 + include/clang/Basic/DiagnosticAnalysisKinds.td | 15 + include/clang/Basic/DiagnosticCommonKinds.td | 58 + include/clang/Basic/DiagnosticDriverKinds.td | 64 + include/clang/Basic/DiagnosticFrontendKinds.td | 136 + include/clang/Basic/DiagnosticGroups.td | 133 + include/clang/Basic/DiagnosticLexKinds.td | 277 + include/clang/Basic/DiagnosticParseKinds.td | 280 + include/clang/Basic/DiagnosticSemaKinds.td | 1822 ++++++ include/clang/Basic/FileManager.h | 178 + include/clang/Basic/IdentifierTable.h | 561 ++ include/clang/Basic/LangOptions.h | 157 + include/clang/Basic/Makefile | 22 + include/clang/Basic/OnDiskHashTable.h | 362 ++ include/clang/Basic/OperatorKinds.def | 106 + include/clang/Basic/OperatorKinds.h | 32 + include/clang/Basic/PrettyStackTrace.h | 37 + include/clang/Basic/SourceLocation.h | 305 ++ include/clang/Basic/SourceManager.h | 714 +++ include/clang/Basic/SourceManagerInternals.h | 130 + include/clang/Basic/TargetInfo.h | 391 ++ include/clang/Basic/TemplateKinds.h | 39 + include/clang/Basic/TokenKinds.def | 413 ++ include/clang/Basic/TokenKinds.h | 64 + include/clang/Basic/TypeTraits.h | 40 + include/clang/Basic/Version.h | 35 + include/clang/CMakeLists.txt | 1 + include/clang/CodeGen/ModuleBuilder.h | 40 + include/clang/Driver/Action.h | 209 + include/clang/Driver/Arg.h | 230 + include/clang/Driver/ArgList.h | 245 + include/clang/Driver/Compilation.h | 127 + include/clang/Driver/Driver.h | 271 + include/clang/Driver/DriverDiagnostic.h | 27 + include/clang/Driver/HostInfo.h | 84 + include/clang/Driver/Job.h | 138 + include/clang/Driver/Option.h | 308 ++ include/clang/Driver/Options.def | 624 +++ include/clang/Driver/Options.h | 90 + include/clang/Driver/Phases.h | 32 + include/clang/Driver/Tool.h | 69 + include/clang/Driver/ToolChain.h | 105 + include/clang/Driver/Types.def | 78 + include/clang/Driver/Types.h | 85 + include/clang/Driver/Util.h | 30 + include/clang/Frontend/ASTConsumers.h | 107 + include/clang/Frontend/Analyses.def | 77 + include/clang/Frontend/AnalysisConsumer.h | 78 + include/clang/Frontend/CompileOptions.h | 62 + include/clang/Frontend/DocumentXML.h | 128 + include/clang/Frontend/FixItRewriter.h | 95 + include/clang/Frontend/FrontendDiagnostic.h | 27 + include/clang/Frontend/InitHeaderSearch.h | 74 + include/clang/Frontend/InitPreprocessor.h | 70 + include/clang/Frontend/ManagerRegistry.h | 53 + include/clang/Frontend/PCHBitCodes.h | 660 +++ include/clang/Frontend/PCHReader.h | 567 ++ include/clang/Frontend/PCHWriter.h | 278 + include/clang/Frontend/PathDiagnosticClients.h | 34 + include/clang/Frontend/TextDiagnosticBuffer.h | 48 + include/clang/Frontend/TextDiagnosticPrinter.h | 85 + include/clang/Frontend/Utils.h | 79 + include/clang/Lex/DirectoryLookup.h | 133 + include/clang/Lex/HeaderMap.h | 67 + include/clang/Lex/HeaderSearch.h | 237 + include/clang/Lex/LexDiagnostic.h | 27 + include/clang/Lex/Lexer.h | 376 ++ include/clang/Lex/LiteralSupport.h | 176 + include/clang/Lex/MacroInfo.h | 218 + include/clang/Lex/MultipleIncludeOpt.h | 130 + include/clang/Lex/PPCallbacks.h | 122 + include/clang/Lex/PTHLexer.h | 104 + include/clang/Lex/PTHManager.h | 141 + include/clang/Lex/Pragma.h | 90 + include/clang/Lex/Preprocessor.h | 801 +++ include/clang/Lex/PreprocessorLexer.h | 161 + include/clang/Lex/ScratchBuffer.h | 45 + include/clang/Lex/Token.h | 312 ++ include/clang/Lex/TokenConcatenation.h | 73 + include/clang/Lex/TokenLexer.h | 154 + include/clang/Makefile | 4 + include/clang/Parse/AccessSpecifier.h | 30 + include/clang/Parse/Action.h | 1839 +++++++ include/clang/Parse/AttributeList.h | 173 + include/clang/Parse/DeclSpec.h | 1086 ++++ include/clang/Parse/Designator.h | 239 + include/clang/Parse/Ownership.h | 830 +++ include/clang/Parse/ParseDiagnostic.h | 27 + include/clang/Parse/Parser.h | 1208 ++++ include/clang/Parse/Scope.h | 310 ++ include/clang/Rewrite/DeltaTree.h | 48 + include/clang/Rewrite/HTMLRewrite.h | 82 + include/clang/Rewrite/RewriteRope.h | 230 + include/clang/Rewrite/Rewriter.h | 238 + include/clang/Rewrite/TokenRewriter.h | 79 + include/clang/Sema/ExternalSemaSource.h | 56 + include/clang/Sema/ParseAST.h | 37 + include/clang/Sema/SemaConsumer.h | 45 + include/clang/Sema/SemaDiagnostic.h | 27 + lib/AST/APValue.cpp | 108 + lib/AST/ASTConsumer.cpp | 19 + lib/AST/ASTContext.cpp | 3332 +++++++++++ lib/AST/Builtins.cpp | 290 + lib/AST/CFG.cpp | 1913 +++++++ lib/AST/CMakeLists.txt | 32 + lib/AST/Decl.cpp | 630 +++ lib/AST/DeclBase.cpp | 756 +++ lib/AST/DeclCXX.cpp | 462 ++ lib/AST/DeclGroup.cpp | 37 + lib/AST/DeclObjC.cpp | 693 +++ lib/AST/DeclPrinter.cpp | 722 +++ lib/AST/DeclTemplate.cpp | 324 ++ lib/AST/DeclarationName.cpp | 355 ++ lib/AST/Expr.cpp | 2059 +++++++ lib/AST/ExprCXX.cpp | 424 ++ lib/AST/ExprConstant.cpp | 1723 ++++++ lib/AST/InheritViz.cpp | 168 + lib/AST/Makefile | 22 + lib/AST/NestedNameSpecifier.cpp | 160 + lib/AST/ParentMap.cpp | 94 + lib/AST/Stmt.cpp | 587 ++ lib/AST/StmtDumper.cpp | 542 ++ lib/AST/StmtIterator.cpp | 155 + lib/AST/StmtPrinter.cpp | 1239 +++++ lib/AST/StmtViz.cpp | 61 + lib/AST/TemplateName.cpp | 65 + lib/AST/Type.cpp | 1658 ++++++ lib/Analysis/BasicConstraintManager.cpp | 342 ++ lib/Analysis/BasicObjCFoundationChecks.cpp | 492 ++ lib/Analysis/BasicObjCFoundationChecks.h | 47 + lib/Analysis/BasicStore.cpp | 637 +++ lib/Analysis/BasicValueFactory.cpp | 264 + lib/Analysis/BugReporter.cpp | 1697 ++++++ lib/Analysis/CFRefCount.cpp | 3635 ++++++++++++ lib/Analysis/CMakeLists.txt | 36 + lib/Analysis/CheckDeadStores.cpp | 259 + lib/Analysis/CheckNSError.cpp | 231 + lib/Analysis/CheckObjCDealloc.cpp | 257 + lib/Analysis/CheckObjCInstMethSignature.cpp | 120 + lib/Analysis/CheckObjCUnusedIVars.cpp | 111 + lib/Analysis/Environment.cpp | 167 + lib/Analysis/ExplodedGraph.cpp | 241 + lib/Analysis/GRBlockCounter.cpp | 54 + lib/Analysis/GRCoreEngine.cpp | 576 ++ lib/Analysis/GRExprEngine.cpp | 3426 ++++++++++++ lib/Analysis/GRExprEngineInternalChecks.cpp | 961 ++++ lib/Analysis/GRSimpleVals.cpp | 416 ++ lib/Analysis/GRSimpleVals.h | 86 + lib/Analysis/GRState.cpp | 318 ++ lib/Analysis/GRTransferFuncs.cpp | 28 + lib/Analysis/LiveVariables.cpp | 359 ++ lib/Analysis/Makefile | 22 + lib/Analysis/MemRegion.cpp | 494 ++ lib/Analysis/PathDiagnostic.cpp | 242 + lib/Analysis/RangeConstraintManager.cpp | 363 ++ lib/Analysis/RegionStore.cpp | 1304 +++++ lib/Analysis/SVals.cpp | 513 ++ lib/Analysis/SimpleConstraintManager.cpp | 263 + lib/Analysis/SimpleConstraintManager.h | 84 + lib/Analysis/Store.cpp | 110 + lib/Analysis/SymbolManager.cpp | 203 + lib/Analysis/UninitializedValues.cpp | 312 ++ lib/Basic/CMakeLists.txt | 24 + lib/Basic/ConvertUTF.c | 547 ++ lib/Basic/Diagnostic.cpp | 788 +++ lib/Basic/FileManager.cpp | 302 + lib/Basic/IdentifierTable.cpp | 388 ++ lib/Basic/Makefile | 22 + lib/Basic/SourceLocation.cpp | 125 + lib/Basic/SourceManager.cpp | 943 ++++ lib/Basic/TargetInfo.cpp | 295 + lib/Basic/Targets.cpp | 1500 +++++ lib/Basic/TokenKinds.cpp | 90 + lib/CMakeLists.txt | 11 + lib/CodeGen/ABIInfo.h | 133 + lib/CodeGen/CGBlocks.cpp | 1037 ++++ lib/CodeGen/CGBlocks.h | 223 + lib/CodeGen/CGBuilder.h | 26 + lib/CodeGen/CGBuiltin.cpp | 1037 ++++ lib/CodeGen/CGCXX.cpp | 454 ++ lib/CodeGen/CGCXX.h | 36 + lib/CodeGen/CGCall.cpp | 2196 ++++++++ lib/CodeGen/CGCall.h | 104 + lib/CodeGen/CGDebugInfo.cpp | 987 ++++ lib/CodeGen/CGDebugInfo.h | 126 + lib/CodeGen/CGDecl.cpp | 489 ++ lib/CodeGen/CGExpr.cpp | 1324 +++++ lib/CodeGen/CGExprAgg.cpp | 554 ++ lib/CodeGen/CGExprComplex.cpp | 663 +++ lib/CodeGen/CGExprConstant.cpp | 588 ++ lib/CodeGen/CGExprScalar.cpp | 1575 ++++++ lib/CodeGen/CGObjC.cpp | 644 +++ lib/CodeGen/CGObjCGNU.cpp | 1582 ++++++ lib/CodeGen/CGObjCMac.cpp | 5780 ++++++++++++++++++++ lib/CodeGen/CGObjCRuntime.h | 206 + lib/CodeGen/CGStmt.cpp | 1022 ++++ lib/CodeGen/CGValue.h | 323 ++ lib/CodeGen/CMakeLists.txt | 24 + lib/CodeGen/CodeGenFunction.cpp | 714 +++ lib/CodeGen/CodeGenFunction.h | 900 +++ lib/CodeGen/CodeGenModule.cpp | 1543 ++++++ lib/CodeGen/CodeGenModule.h | 467 ++ lib/CodeGen/CodeGenTypes.cpp | 614 +++ lib/CodeGen/CodeGenTypes.h | 212 + lib/CodeGen/Makefile | 23 + lib/CodeGen/Mangle.cpp | 772 +++ lib/CodeGen/Mangle.h | 44 + lib/CodeGen/ModuleBuilder.cpp | 100 + lib/CodeGen/README.txt | 65 + lib/Driver/Action.cpp | 79 + lib/Driver/Arg.cpp | 192 + lib/Driver/ArgList.cpp | 232 + lib/Driver/CMakeLists.txt | 19 + lib/Driver/Compilation.cpp | 174 + lib/Driver/Driver.cpp | 1254 +++++ lib/Driver/HostInfo.cpp | 408 ++ lib/Driver/InputInfo.h | 101 + lib/Driver/Job.cpp | 31 + lib/Driver/Makefile | 28 + lib/Driver/OptTable.cpp | 265 + lib/Driver/Option.cpp | 250 + lib/Driver/Phases.cpp | 27 + lib/Driver/Tool.cpp | 19 + lib/Driver/ToolChain.cpp | 35 + lib/Driver/ToolChains.cpp | 475 ++ lib/Driver/ToolChains.h | 134 + lib/Driver/Tools.cpp | 2033 +++++++ lib/Driver/Tools.h | 316 ++ lib/Driver/Types.cpp | 205 + lib/Frontend/ASTConsumers.cpp | 451 ++ lib/Frontend/AnalysisConsumer.cpp | 659 +++ lib/Frontend/Backend.cpp | 415 ++ lib/Frontend/CMakeLists.txt | 35 + lib/Frontend/CacheTokens.cpp | 658 +++ lib/Frontend/DependencyFile.cpp | 169 + lib/Frontend/DiagChecker.cpp | 302 + lib/Frontend/DocumentXML.cpp | 579 ++ lib/Frontend/FixItRewriter.cpp | 199 + lib/Frontend/GeneratePCH.cpp | 78 + lib/Frontend/HTMLDiagnostics.cpp | 602 ++ lib/Frontend/HTMLPrint.cpp | 92 + lib/Frontend/InitHeaderSearch.cpp | 327 ++ lib/Frontend/InitPreprocessor.cpp | 495 ++ lib/Frontend/Makefile | 18 + lib/Frontend/ManagerRegistry.cpp | 20 + lib/Frontend/PCHReader.cpp | 2260 ++++++++ lib/Frontend/PCHReaderDecl.cpp | 712 +++ lib/Frontend/PCHReaderStmt.cpp | 1136 ++++ lib/Frontend/PCHWriter.cpp | 1966 +++++++ lib/Frontend/PCHWriterDecl.cpp | 532 ++ lib/Frontend/PCHWriterStmt.cpp | 829 +++ lib/Frontend/PlistDiagnostics.cpp | 389 ++ lib/Frontend/PrintParserCallbacks.cpp | 831 +++ lib/Frontend/PrintPreprocessedOutput.cpp | 470 ++ lib/Frontend/RewriteBlocks.cpp | 1162 ++++ lib/Frontend/RewriteMacros.cpp | 215 + lib/Frontend/RewriteObjC.cpp | 4693 ++++++++++++++++ lib/Frontend/RewriteTest.cpp | 39 + lib/Frontend/StmtXML.cpp | 409 ++ lib/Frontend/TextDiagnosticBuffer.cpp | 39 + lib/Frontend/TextDiagnosticPrinter.cpp | 710 +++ lib/Frontend/Warnings.cpp | 106 + lib/Headers/CMakeLists.txt | 25 + lib/Headers/Makefile | 40 + lib/Headers/emmintrin.h | 1329 +++++ lib/Headers/float.h | 71 + lib/Headers/iso646.h | 43 + lib/Headers/limits.h | 114 + lib/Headers/mm_malloc.h | 59 + lib/Headers/mmintrin.h | 449 ++ lib/Headers/pmmintrin.h | 121 + lib/Headers/stdarg.h | 47 + lib/Headers/stdbool.h | 38 + lib/Headers/stddef.h | 43 + lib/Headers/stdint.h | 232 + lib/Headers/tgmath.h | 1358 +++++ lib/Headers/tmmintrin.h | 218 + lib/Headers/xmmintrin.h | 888 +++ lib/Lex/CMakeLists.txt | 26 + lib/Lex/HeaderMap.cpp | 245 + lib/Lex/HeaderSearch.cpp | 446 ++ lib/Lex/Lexer.cpp | 1809 ++++++ lib/Lex/LiteralSupport.cpp | 929 ++++ lib/Lex/MacroArgs.cpp | 240 + lib/Lex/MacroArgs.h | 109 + lib/Lex/MacroInfo.cpp | 75 + lib/Lex/Makefile | 28 + lib/Lex/PPCaching.cpp | 113 + lib/Lex/PPDirectives.cpp | 1665 ++++++ lib/Lex/PPExpressions.cpp | 717 +++ lib/Lex/PPLexerChange.cpp | 345 ++ lib/Lex/PPMacroExpansion.cpp | 605 ++ lib/Lex/PTHLexer.cpp | 701 +++ lib/Lex/Pragma.cpp | 699 +++ lib/Lex/Preprocessor.cpp | 478 ++ lib/Lex/PreprocessorLexer.cpp | 45 + lib/Lex/ScratchBuffer.cpp | 73 + lib/Lex/TokenConcatenation.cpp | 219 + lib/Lex/TokenLexer.cpp | 542 ++ lib/Makefile | 15 + lib/Parse/AttributeList.cpp | 145 + lib/Parse/CMakeLists.txt | 21 + lib/Parse/DeclSpec.cpp | 395 ++ lib/Parse/ExtensionRAIIObject.h | 40 + lib/Parse/Makefile | 22 + lib/Parse/MinimalAction.cpp | 225 + lib/Parse/ParseCXXInlineMethods.cpp | 271 + lib/Parse/ParseDecl.cpp | 2707 +++++++++ lib/Parse/ParseDeclCXX.cpp | 1292 +++++ lib/Parse/ParseExpr.cpp | 1514 +++++ lib/Parse/ParseExprCXX.cpp | 1166 ++++ lib/Parse/ParseInit.cpp | 308 ++ lib/Parse/ParseObjc.cpp | 1708 ++++++ lib/Parse/ParsePragma.cpp | 182 + lib/Parse/ParsePragma.h | 44 + lib/Parse/ParseStmt.cpp | 1435 +++++ lib/Parse/ParseTemplate.cpp | 812 +++ lib/Parse/ParseTentative.cpp | 920 ++++ lib/Parse/Parser.cpp | 996 ++++ lib/Rewrite/CMakeLists.txt | 9 + lib/Rewrite/DeltaTree.cpp | 485 ++ lib/Rewrite/HTMLRewrite.cpp | 574 ++ lib/Rewrite/Makefile | 22 + lib/Rewrite/RewriteRope.cpp | 807 +++ lib/Rewrite/Rewriter.cpp | 228 + lib/Rewrite/TokenRewriter.cpp | 98 + lib/Sema/CMakeLists.txt | 33 + lib/Sema/CXXFieldCollector.h | 76 + lib/Sema/IdentifierResolver.cpp | 293 + lib/Sema/IdentifierResolver.h | 214 + lib/Sema/JumpDiagnostics.cpp | 327 ++ lib/Sema/Makefile | 23 + lib/Sema/ParseAST.cpp | 85 + lib/Sema/Sema.cpp | 333 ++ lib/Sema/Sema.h | 2814 ++++++++++ lib/Sema/SemaAccess.cpp | 124 + lib/Sema/SemaAttr.cpp | 211 + lib/Sema/SemaCXXScopeSpec.cpp | 312 ++ lib/Sema/SemaChecking.cpp | 1449 +++++ lib/Sema/SemaDecl.cpp | 4415 +++++++++++++++ lib/Sema/SemaDeclAttr.cpp | 1803 ++++++ lib/Sema/SemaDeclCXX.cpp | 2823 ++++++++++ lib/Sema/SemaDeclObjC.cpp | 2166 ++++++++ lib/Sema/SemaExpr.cpp | 5395 ++++++++++++++++++ lib/Sema/SemaExprCXX.cpp | 1603 ++++++ lib/Sema/SemaExprObjC.cpp | 860 +++ lib/Sema/SemaInherit.cpp | 344 ++ lib/Sema/SemaInherit.h | 248 + lib/Sema/SemaInit.cpp | 1784 ++++++ lib/Sema/SemaLookup.cpp | 1626 ++++++ lib/Sema/SemaNamedCast.cpp | 932 ++++ lib/Sema/SemaOverload.cpp | 4485 +++++++++++++++ lib/Sema/SemaOverload.h | 263 + lib/Sema/SemaStmt.cpp | 1266 +++++ lib/Sema/SemaTemplate.cpp | 2651 +++++++++ lib/Sema/SemaTemplateInstantiate.cpp | 1034 ++++ lib/Sema/SemaTemplateInstantiateDecl.cpp | 767 +++ lib/Sema/SemaTemplateInstantiateExpr.cpp | 1278 +++++ lib/Sema/SemaTemplateInstantiateStmt.cpp | 443 ++ lib/Sema/SemaType.cpp | 1301 +++++ test/Analysis/CFDateGC.m | 87 + test/Analysis/CFNumber.c | 31 + test/Analysis/CFRetainRelease_NSAssertionHandler.m | 67 + test/Analysis/CGColorSpace.c | 21 + test/Analysis/CheckNSError.m | 59 + test/Analysis/MissingDealloc.m | 117 + test/Analysis/NSPanel.m | 90 + test/Analysis/NSString.m | 335 ++ test/Analysis/NSWindow.m | 89 + test/Analysis/NoReturn.m | 82 + test/Analysis/ObjCProperties.m | 25 + test/Analysis/ObjCRetSigs.m | 25 + test/Analysis/PR2599.m | 64 + test/Analysis/PR2978.m | 61 + test/Analysis/PR3991.m | 67 + test/Analysis/array-struct.c | 150 + test/Analysis/basicstore_wine_crash.c | 11 + test/Analysis/casts.c | 16 + test/Analysis/casts.m | 22 + test/Analysis/cfref_PR2519.c | 48 + test/Analysis/cfref_rdar6080742.c | 58 + test/Analysis/complex.c | 21 + test/Analysis/conditional-op-missing-lhs.c | 26 + test/Analysis/dead-stores.c | 175 + test/Analysis/dead-stores.m | 36 + test/Analysis/delegates.m | 114 + test/Analysis/exercise-ps.c | 25 + test/Analysis/fields.c | 10 + test/Analysis/func.c | 17 + test/Analysis/misc-ps-64.m | 49 + test/Analysis/misc-ps-basic-store.m | 21 + test/Analysis/misc-ps-eager-assume.m | 79 + test/Analysis/misc-ps-ranges.m | 23 + test/Analysis/misc-ps-region-store.m | 70 + test/Analysis/misc-ps.m | 287 + ...il-receiver-undefined-larger-than-voidptr-ret.m | 67 + test/Analysis/no-exit-cfg.c | 19 + test/Analysis/no-outofbounds-basicstore.c | 7 + test/Analysis/null-deref-ps-region.c | 14 + test/Analysis/null-deref-ps.c | 265 + test/Analysis/outofbound.c | 7 + test/Analysis/override-werror.c | 15 + test/Analysis/pr4209.m | 70 + test/Analysis/pr_2542_rdar_6793404.m | 68 + test/Analysis/pr_4164.c | 41 + test/Analysis/ptr-arith.c | 34 + test/Analysis/rdar-6442306-1.m | 31 + test/Analysis/rdar-6539791.c | 47 + test/Analysis/rdar-6540084.m | 36 + test/Analysis/rdar-6541136-region.c | 19 + test/Analysis/rdar-6541136.c | 20 + test/Analysis/rdar-6562655.m | 63 + test/Analysis/rdar-6582778-basic-store.c | 22 + ...dar-6600344-nil-receiver-undefined-struct-ret.m | 25 + test/Analysis/refcnt_naming.m | 62 + test/Analysis/region-1.m | 90 + test/Analysis/region-only-test.c | 13 + test/Analysis/retain-release-basic-store.m | 102 + test/Analysis/retain-release-gc-only.m | 161 + test/Analysis/retain-release-region-store.m | 118 + test/Analysis/retain-release.m | 708 +++ test/Analysis/stack-addr-ps.c | 44 + test/Analysis/uninit-msg-expr.m | 58 + test/Analysis/uninit-ps-rdar6145427.m | 37 + test/Analysis/uninit-vals-ps-region.c | 17 + test/Analysis/uninit-vals-ps.c | 85 + test/Analysis/uninit-vals.c | 53 + test/Analysis/uninit-vals.m | 25 + test/Analysis/unused-ivars.m | 10 + test/Analysis/xfail-no-outofbounds.c | 7 + test/Analysis/xfail_regionstore_wine_crash.c | 12 + test/CodeGen/2007-11-29-ArraySizeFromInitializer.c | 4 + test/CodeGen/2008-02-07-bitfield-bug.c | 11 + test/CodeGen/2008-02-08-bitfield-bug.c | 9 + test/CodeGen/2008-02-26-inline-asm-bug.c | 6 + test/CodeGen/2008-07-17-no-emit-on-error.c | 10 + test/CodeGen/2008-07-21-mixed-var-fn-decl.c | 5 + ...2008-07-22-bitfield-init-after-zero-len-array.c | 11 + test/CodeGen/2008-07-22-packed-bitfield-access.c | 10 + test/CodeGen/2008-07-29-override-alias-decl.c | 12 + test/CodeGen/2008-07-30-implicit-initialization.c | 28 + test/CodeGen/2008-07-30-redef-of-bitcasted-decl.c | 28 + test/CodeGen/2008-07-31-asm-labels.c | 33 + ...7-31-promotion-of-compound-pointer-arithmetic.c | 25 + test/CodeGen/2008-08-04-void-pointer-arithmetic.c | 6 + test/CodeGen/2008-08-19-cast-of-typedef.c | 10 + test/CodeGen/2008-08-25-incompatible-cond-expr.m | 10 + test/CodeGen/2008-09-22-bad-switch-type.c | 34 + test/CodeGen/2008-12-02-logical-or-fold.c | 4 + test/CodeGen/2009-01-21-invalid-debug-info.m | 16 + test/CodeGen/2009-03-22-increment-bitfield.c | 7 + test/CodeGen/2009-04-23-dbg.c | 20 + test/CodeGen/2009-05-22-callingconv.c | 25 + test/CodeGen/2009-05-28-const-typedef.c | 17 + test/CodeGen/2009-06-01-addrofknr.c | 21 + test/CodeGen/OpaqueStruct.c | 12 + test/CodeGen/PR2001-bitfield-reload.c | 17 + test/CodeGen/PR2413-void-address-cast-error.c | 6 + test/CodeGen/PR2643-null-store-to-bitfield.c | 10 + test/CodeGen/PR2743-reference-missing-static.c | 16 + test/CodeGen/PR3130-cond-constant.c | 3 + test/CodeGen/PR3589-freestanding-libcalls.c | 9 + test/CodeGen/PR3613-static-decl.c | 16 + test/CodeGen/PR3709-int-to-pointer-sign.c | 5 + test/CodeGen/PR3869-indirect-goto-long.c | 4 + test/CodeGen/address-space-cast.c | 4 + test/CodeGen/address-space.c | 20 + test/CodeGen/alias.c | 32 + test/CodeGen/align-local.c | 8 + test/CodeGen/alignof.c | 12 + test/CodeGen/array.c | 14 + test/CodeGen/asm-2.c | 10 + test/CodeGen/asm.c | 103 + test/CodeGen/atomic.c | 53 + test/CodeGen/attr-cleanup.c | 8 + test/CodeGen/attr-nodebug.c | 12 + test/CodeGen/attr-noinline.c | 9 + test/CodeGen/attr-used.c | 14 + test/CodeGen/attributes.c | 59 + test/CodeGen/bitfield-assign.c | 44 + test/CodeGen/bitfield-init.c | 14 + test/CodeGen/bitfield-promote.c | 19 + test/CodeGen/bitfield.c | 74 + test/CodeGen/blocks-1.c | 78 + test/CodeGen/blocks-2.c | 13 + test/CodeGen/blocks-seq.c | 18 + test/CodeGen/blocks.c | 30 + test/CodeGen/bool-bitfield.c | 54 + test/CodeGen/bool-convert.c | 10 + test/CodeGen/bool-init.c | 4 + test/CodeGen/boolassign.c | 6 + test/CodeGen/builtin-count-zeros.c | 4 + test/CodeGen/builtin-memfns.c | 15 + test/CodeGen/builtin-nanf.c | 15 + test/CodeGen/builtin-rename.c | 8 + test/CodeGen/builtin-stackaddress.c | 9 + test/CodeGen/builtin-unwind-init.c | 4 + test/CodeGen/builtinmemcpy.c | 3 + test/CodeGen/builtins-ffs_parity_popcount.c | 15 + test/CodeGen/builtins-powi.c | 29 + test/CodeGen/builtins-x86.c | 522 ++ test/CodeGen/builtins.c | 124 + test/CodeGen/builtinshufflevector.c | 5 + test/CodeGen/c-strings.c | 36 + test/CodeGen/cast-to-union.c | 13 + test/CodeGen/cast.c | 6 + test/CodeGen/cfstring.c | 13 + test/CodeGen/cfstring2.c | 13 + test/CodeGen/cleanup-stack.c | 25 + test/CodeGen/complex.c | 61 + test/CodeGen/compound-literal.c | 12 + test/CodeGen/compound-type.c | 7 + test/CodeGen/compound.c | 25 + test/CodeGen/conditional-gnu-ext.c | 12 + test/CodeGen/conditional.c | 44 + test/CodeGen/const-init.c | 104 + test/CodeGen/const-label-addr.c | 4 + test/CodeGen/constant-comparison.c | 12 + test/CodeGen/constructor-attribute.c | 38 + test/CodeGen/cxx-condition.cpp | 9 + test/CodeGen/cxx-default-arg.cpp | 25 + test/CodeGen/cxx-value-init.cpp | 11 + test/CodeGen/darwin-string-literals.c | 10 + test/CodeGen/debug-info.c | 37 + test/CodeGen/designated-initializers.c | 21 + test/CodeGen/dllimport-dllexport.c | 7 + test/CodeGen/dostmt.c | 70 + test/CodeGen/emit-all-decls.c | 8 + test/CodeGen/empty-union-init.c | 13 + test/CodeGen/enum.c | 18 + test/CodeGen/exprs.c | 118 + test/CodeGen/ext-vector-shuffle.c | 15 + test/CodeGen/ext-vector.c | 129 + test/CodeGen/extern-block-var.c | 6 + test/CodeGen/flexible-array-init.c | 8 + test/CodeGen/func-decl-cleanup.c | 12 + test/CodeGen/func-return-member.c | 23 + test/CodeGen/function-attributes.c | 69 + test/CodeGen/function-decay.m | 10 + test/CodeGen/functions.c | 35 + test/CodeGen/global-decls.c | 22 + test/CodeGen/global-init.c | 7 + test/CodeGen/global-with-initialiser.c | 25 + test/CodeGen/globalinit.c | 51 + test/CodeGen/illegal-UTF8.m | 8 + test/CodeGen/incomplete-function-type.c | 10 + test/CodeGen/indirect-goto.c | 20 + test/CodeGen/init-with-member-expr.c | 21 + test/CodeGen/init.c | 31 + test/CodeGen/inline.c | 86 + test/CodeGen/int-to-pointer.c | 6 + test/CodeGen/kr-func-promote.c | 5 + test/CodeGen/kr-style-block.c | 10 + test/CodeGen/libcalls.c | 22 + test/CodeGen/lineno-dbginfo.c | 5 + test/CodeGen/linkage-redecl.c | 11 + test/CodeGen/long-double-x86.c | 4 + test/CodeGen/mandel.c | 67 + test/CodeGen/mangle.c | 54 + test/CodeGen/merge-attrs.c | 13 + test/CodeGen/merge-statics.c | 13 + test/CodeGen/mmintrin-test.c | 26 + test/CodeGen/no-common.c | 6 + test/CodeGen/offsetof.c | 12 + test/CodeGen/opaque-pointer.c | 13 + test/CodeGen/overloadable.c | 26 + test/CodeGen/parameter-passing.c | 57 + test/CodeGen/pascal-string.c | 8 + test/CodeGen/pointer-arithmetic.c | 22 + test/CodeGen/pointer-cmp-type.c | 3 + test/CodeGen/pointer-to-int.c | 13 + test/CodeGen/private-extern.c | 10 + test/CodeGen/rdr-6098585-default-after-caserange.c | 18 + .../rdr-6098585-default-fallthrough-to-caserange.c | 20 + test/CodeGen/rdr-6098585-empty-case-range.c | 23 + .../rdr-6098585-fallthrough-to-empty-range.c | 15 + test/CodeGen/rdr-6098585-unsigned-caserange.c | 12 + .../CodeGen/rdr-6732143-dangling-block-reference.m | 10 + test/CodeGen/regparm.c | 19 + test/CodeGen/shared-string-literals.c | 9 + test/CodeGen/sizeof-vla.c | 13 + test/CodeGen/statements.c | 13 + test/CodeGen/static-forward-decl-fun.c | 6 + test/CodeGen/static-forward-decl.c | 5 + test/CodeGen/static-local-union.c | 4 + test/CodeGen/static-order.c | 19 + test/CodeGen/staticinit.c | 31 + test/CodeGen/stdcall-fastcall.c | 17 + test/CodeGen/string-init.c | 10 + test/CodeGen/string-literal.c | 7 + test/CodeGen/struct-comma.c | 4 + test/CodeGen/struct-copy.c | 7 + test/CodeGen/struct-init.c | 12 + test/CodeGen/struct-passing.c | 21 + test/CodeGen/struct-x86-darwin.c | 25 + test/CodeGen/struct.c | 192 + test/CodeGen/switch.c | 87 + test/CodeGen/tentative-decls.c | 39 + test/CodeGen/thread-specifier.c | 10 + test/CodeGen/trapv.c | 10 + test/CodeGen/typedef-func.c | 16 + test/CodeGen/typedef.c | 8 + test/CodeGen/types.c | 34 + test/CodeGen/uint128_t.c | 18 + test/CodeGen/union-init.c | 31 + test/CodeGen/union.c | 41 + test/CodeGen/unwind-attr.c | 5 + test/CodeGen/var-align.c | 4 + test/CodeGen/variable-array.c | 19 + test/CodeGen/vector.c | 13 + test/CodeGen/visibility.c | 41 + test/CodeGen/vla.c | 37 + test/CodeGen/volatile-1.c | 143 + test/CodeGen/volatile.c | 94 + test/CodeGen/weak-global.c | 3 + test/CodeGen/weak-incomplete.c | 5 + test/CodeGen/whilestmt.c | 62 + test/CodeGen/writable-strings.c | 8 + test/CodeGen/x86.c | 23 + test/CodeGen/x86_32-arguments.c | 157 + test/CodeGen/x86_64-arguments.c | 85 + test/CodeGenCXX/__null.cpp | 9 + test/CodeGenCXX/const-init.cpp | 11 + test/CodeGenCXX/explicit-instantiation.cpp | 11 + test/CodeGenCXX/expr.cpp | 5 + test/CodeGenCXX/extern-c.cpp | 13 + test/CodeGenCXX/mangle.cpp | 87 + test/CodeGenCXX/member-functions.cpp | 63 + test/CodeGenCXX/new.cpp | 56 + test/CodeGenCXX/reference-field.cpp | 6 + test/CodeGenCXX/references.cpp | 89 + test/CodeGenObjC/2008-10-23-invalid-icmp.m | 7 + test/CodeGenObjC/attr-strong.c | 9 + test/CodeGenObjC/bitfield-1.m | 81 + test/CodeGenObjC/bitfield-ivar-metadata.m | 15 + test/CodeGenObjC/bitfield-ivar-offsets.m | 26 + test/CodeGenObjC/blocks-1.m | 33 + test/CodeGenObjC/blocks-2.m | 11 + test/CodeGenObjC/blocks.m | 36 + test/CodeGenObjC/category-super-class-meth.m | 19 + test/CodeGenObjC/class-getter-dotsyntax.m | 21 + test/CodeGenObjC/class-obj-hidden-visibility.m | 6 + test/CodeGenObjC/class-type.m | 36 + test/CodeGenObjC/compatibility-alias.m | 8 + test/CodeGenObjC/constant-strings.m | 4 + test/CodeGenObjC/continuation-class.m | 35 + test/CodeGenObjC/debug-info.m | 18 + test/CodeGenObjC/dot-syntax-1.m | 264 + test/CodeGenObjC/dot-syntax.m | 98 + test/CodeGenObjC/encode-test-1.m | 36 + test/CodeGenObjC/encode-test-2.m | 29 + test/CodeGenObjC/encode-test-3.m | 21 + test/CodeGenObjC/encode-test-4.m | 5 + test/CodeGenObjC/encode-test-5.m | 16 + test/CodeGenObjC/encode-test.m | 94 + test/CodeGenObjC/forward-class-impl-metadata.m | 41 + test/CodeGenObjC/hidden-synthesized-ivar.m | 13 + test/CodeGenObjC/hidden.m | 19 + test/CodeGenObjC/image-info.m | 2 + test/CodeGenObjC/implicit-objc_msgSend.m | 7 + test/CodeGenObjC/implicit-property.m | 16 + test/CodeGenObjC/interface-layout-64.m | 124 + test/CodeGenObjC/interface.m | 34 + test/CodeGenObjC/ivar-layout-64.m | 89 + test/CodeGenObjC/ivars.m | 14 + test/CodeGenObjC/link-errors.m | 39 + test/CodeGenObjC/message-arrays.m | 15 + test/CodeGenObjC/messages-2.m | 139 + test/CodeGenObjC/messages.m | 27 + test/CodeGenObjC/metadata-symbols-32.m | 88 + test/CodeGenObjC/metadata-symbols-64.m | 130 + test/CodeGenObjC/metadata_symbols.m | 61 + test/CodeGenObjC/newproperty-nested-synthesis-1.m | 78 + test/CodeGenObjC/no-category-class.m | 8 + test/CodeGenObjC/non-lazy-classes.m | 33 + test/CodeGenObjC/objc-align.m | 47 + test/CodeGenObjC/objc2-assign-global.m | 8 + test/CodeGenObjC/objc2-no-strong-cast.m | 22 + test/CodeGenObjC/objc2-no-write-barrier.m | 18 + test/CodeGenObjC/objc2-property-encode.m | 13 + test/CodeGenObjC/objc2-protocol-enc.m | 43 + test/CodeGenObjC/objc2-retain-codegen.m | 12 + test/CodeGenObjC/objc2-strong-cast-1.m | 23 + test/CodeGenObjC/objc2-strong-cast-2.m | 27 + test/CodeGenObjC/objc2-strong-cast.m | 17 + test/CodeGenObjC/objc2-weak-compare.m | 24 + test/CodeGenObjC/objc2-weak-ivar.m | 10 + test/CodeGenObjC/overloadable.m | 10 + test/CodeGenObjC/predefined-expr-in-method.m | 17 + test/CodeGenObjC/property-aggr-type.m | 50 + test/CodeGenObjC/property-agrr-getter.m | 17 + test/CodeGenObjC/property-getter-dot-syntax.m | 11 + test/CodeGenObjC/property-incr-decr-1.m | 29 + test/CodeGenObjC/property-setter-attr.m | 10 + test/CodeGenObjC/property.m | 52 + .../protocol-definition-hidden-visibility.m | 19 + test/CodeGenObjC/protocol-property-synth.m | 33 + test/CodeGenObjC/protocols-lazy.m | 48 + test/CodeGenObjC/runtime-fns.m | 33 + test/CodeGenObjC/super-classmethod-category.m | 13 + test/CodeGenObjC/super-dotsyntax-property.m | 41 + test/CodeGenObjC/synchronized.m | 41 + test/CodeGenObjC/synthesize_ivar-cont-class.m | 18 + test/CodeGenObjC/synthesize_ivar.m | 27 + test/CodeGenObjC/try.m | 9 + test/CodeGenObjC/unname-bf-metadata.m | 14 + test/Coverage/ast-printing.c | 6 + test/Coverage/ast-printing.cpp | 6 + test/Coverage/ast-printing.m | 5 + test/Coverage/c-language-features.inc | 181 + test/Coverage/codegen-gnu.m | 3 + test/Coverage/codegen-next.m | 4 + test/Coverage/codegen.c | 7 + test/Coverage/cxx-language-features.inc | 21 + test/Coverage/html-diagnostics.c | 15 + test/Coverage/html-print.c | 3 + test/Coverage/objc-language-features.inc | 81 + test/Coverage/parse-callbacks.c | 4 + test/Coverage/parse-callbacks.m | 4 + test/Coverage/targets.c | 18 + test/Coverage/verbose.c | 1 + test/Driver/Xarch.c | 10 + test/Driver/analyze.c | 9 + test/Driver/bindings.c | 56 + test/Driver/ccc-add-args.c | 3 + test/Driver/clang-translation.c | 16 + test/Driver/clang_cpp.c | 4 + test/Driver/clang_f_opts.c | 10 + test/Driver/darwin-cc.c | 6 + test/Driver/darwin-ld.c | 44 + test/Driver/darwin-version.c | 6 + test/Driver/dragonfly.c | 6 + test/Driver/emit-llvm.c | 3 + test/Driver/flags.c | 9 + test/Driver/freebsd.c | 7 + test/Driver/hello.c | 14 + test/Driver/immediate-options.c | 5 + test/Driver/lto.c | 25 + test/Driver/parsing.c | 24 + test/Driver/phases.c | 79 + test/Driver/preprocessor.c | 6 + test/Driver/pth.c | 8 + test/Driver/qa_override.c | 6 + test/Driver/std.c | 8 + test/Driver/unknown-gcc-arch.c | 8 + test/Driver/x86_features.c | 3 + test/FixIt/fixit-at.c | 5 + test/FixIt/fixit-c90.c | 11 + test/FixIt/fixit-errors-1.c | 13 + test/FixIt/fixit-errors.c | 10 + test/FixIt/fixit-objc.m | 8 + test/FixIt/fixit.c | 29 + test/FixIt/fixit.cpp | 29 + test/Frontend/darwin-version.c | 23 + test/Frontend/dependency-gen.c | 7 + test/Frontend/mmacosx-version-min-test.c | 1 + test/Frontend/rewrite-macros.c | 18 + test/Frontend/stdin.c | 3 + test/Lexer/11-27-2007-FloatLiterals.c | 7 + test/Lexer/badstring_in_if0.c | 8 + test/Lexer/block_cmt_end.c | 38 + test/Lexer/c90.c | 13 + test/Lexer/comment-escape.c | 6 + test/Lexer/constants.c | 35 + test/Lexer/counter.c | 16 + test/Lexer/cxx0x_keyword.cpp | 2 + test/Lexer/cxx0x_keyword_as_cxx98.cpp | 2 + test/Lexer/digraph.c | 15 + test/Lexer/dollar-idents.c | 7 + test/Lexer/escape_newline.c | 7 + test/Lexer/multiple-include.c | 27 + test/Lexer/numeric-literal-trash.c | 13 + test/Lexer/pragma-mark.c | 11 + test/Lexer/rdr-6096838-2.c | 5 + test/Lexer/rdr-6096838.c | 6 + test/Lexer/token-concat.c | 4 + test/Lexer/unknown-char.c | 2 + test/Makefile | 47 + test/Misc/caret-diags-macros.c | 26 + test/Misc/caret-diags-scratch-buffer.c | 12 + test/Misc/diag-checker.c | 5 + test/Misc/diag-mapping.c | 30 + test/Misc/diag-mapping2.c | 19 + test/Misc/emit-html-insert.c | 4 + test/Misc/emit-html.c | 18 + test/Misc/message-length.c | 35 + test/Misc/predefines.c | 5 + test/PCH/asm.c | 11 + test/PCH/asm.h | 14 + test/PCH/attrs.c | 8 + test/PCH/attrs.h | 7 + test/PCH/blocks.c | 12 + test/PCH/blocks.h | 14 + test/PCH/builtins.c | 10 + test/PCH/builtins.h | 2 + test/PCH/enum.c | 15 + test/PCH/enum.h | 16 + test/PCH/exprs.c | 89 + test/PCH/exprs.h | 86 + test/PCH/ext_vector.c | 10 + test/PCH/ext_vector.h | 4 + test/PCH/external-defs.c | 19 + test/PCH/external-defs.h | 13 + test/PCH/functions.c | 20 + test/PCH/functions.h | 6 + test/PCH/fuzzy-pch.c | 19 + test/PCH/fuzzy-pch.h | 2 + test/PCH/line-directive.c | 25 + test/PCH/line-directive.h | 2 + test/PCH/method_pool.h | 37 + test/PCH/method_pool.m | 21 + test/PCH/multiple_decls.c | 17 + test/PCH/multiple_decls.h | 7 + test/PCH/nonvisible-external-defs.c | 10 + test/PCH/nonvisible-external-defs.h | 11 + test/PCH/objc_exprs.h | 18 + test/PCH/objc_exprs.m | 28 + test/PCH/objc_import.h | 7 + test/PCH/objc_import.m | 15 + test/PCH/objc_methods.h | 11 + test/PCH/objc_methods.m | 16 + test/PCH/objc_property.h | 12 + test/PCH/objc_property.m | 11 + test/PCH/preprocess.c | 5 + test/PCH/preprocess.h | 7 + test/PCH/stmts.c | 14 + test/PCH/stmts.h | 96 + test/PCH/struct.c | 28 + test/PCH/struct.h | 29 + test/PCH/tentative-defs.c | 9 + test/PCH/tentative-defs.h | 9 + test/PCH/types.c | 72 + test/PCH/types.h | 44 + test/PCH/va_arg.c | 12 + test/PCH/va_arg.h | 8 + test/PCH/variables.c | 23 + test/PCH/variables.h | 26 + test/Parser/2008-10-31-parse-noop-failure.c | 4 + test/Parser/CompoundStmtScope.c | 8 + test/Parser/MicrosoftExtensions.c | 30 + test/Parser/argument_qualified.c | 5 + test/Parser/argument_redef.c | 6 + test/Parser/argument_scope.c | 6 + test/Parser/asm.c | 15 + test/Parser/attributes.c | 53 + test/Parser/bad-control.c | 9 + test/Parser/block-block-storageclass.c | 19 + test/Parser/block-pointer-decl.c | 26 + test/Parser/builtin_classify_type.c | 21 + test/Parser/builtin_types_compatible.c | 43 + test/Parser/c-namespace.c | 6 + test/Parser/char-literal-printing.c | 31 + test/Parser/check-objc2-syntax-1.m | 10 + test/Parser/check-syntax-1.m | 4 + test/Parser/check_cast.c | 12 + test/Parser/compound_literal.c | 5 + test/Parser/control-scope.c | 8 + test/Parser/cxx-ambig-paren-expr.cpp | 26 + test/Parser/cxx-bool.cpp | 4 + test/Parser/cxx-casting.cpp | 36 + test/Parser/cxx-class.cpp | 38 + test/Parser/cxx-condition.cpp | 11 + test/Parser/cxx-decl.cpp | 3 + test/Parser/cxx-exception-spec.cpp | 17 + test/Parser/cxx-friend.cpp | 17 + test/Parser/cxx-namespace-alias.cpp | 8 + test/Parser/cxx-reference.cpp | 21 + test/Parser/cxx-template-decl.cpp | 82 + test/Parser/cxx-throw.cpp | 15 + test/Parser/cxx-try.cpp | 41 + test/Parser/cxx-typeid.cpp | 13 + test/Parser/cxx-typeof.cpp | 7 + test/Parser/cxx-using-directive.cpp | 41 + test/Parser/cxx-variadic-func.cpp | 5 + test/Parser/cxx0x-rvalue-reference.cpp | 9 + test/Parser/declarators.c | 66 + test/Parser/designator.c | 17 + test/Parser/encode.m | 8 + test/Parser/enhanced-proto-1.m | 17 + test/Parser/expressions.c | 50 + test/Parser/expressions.m | 6 + test/Parser/extension.c | 20 + test/Parser/function-decls.c | 10 + test/Parser/goto-ident.c | 6 + test/Parser/if-scope-c90.c | 8 + test/Parser/if-scope-c99.c | 8 + test/Parser/implicit-casts.c | 20 + test/Parser/method-prototype-1.m | 43 + test/Parser/namelookup-bug-1.c | 7 + test/Parser/namelookup-bug-2.c | 14 + test/Parser/objc-alias-printing.m | 18 + test/Parser/objc-category-neg-1.m | 8 + test/Parser/objc-forcollection-1.m | 43 + test/Parser/objc-forcollection-neg-2.m | 38 + test/Parser/objc-forcollection-neg.m | 37 + test/Parser/objc-foreach-syntax.m | 26 + test/Parser/objc-init.m | 41 + test/Parser/objc-interfaces.m | 8 + test/Parser/objc-messaging-1.m | 19 + test/Parser/objc-messaging-neg-1.m | 7 + test/Parser/objc-missing-impl.m | 2 + test/Parser/objc-property-syntax.m | 12 + test/Parser/objc-quirks.m | 10 + test/Parser/objc-try-catch-1.m | 68 + test/Parser/objc-type-printing.m | 19 + test/Parser/parmvardecl_conversion.c | 4 + test/Parser/pointer-arithmetic.c | 9 + test/Parser/pointer_promotion.c | 18 + test/Parser/pragma-pack.c | 32 + test/Parser/prefix-attributes.m | 8 + test/Parser/promote_types_in_proto.c | 9 + test/Parser/recovery.c | 75 + test/Parser/selector-1.m | 14 + test/Parser/statements.c | 56 + test/Parser/struct-recursion.c | 11 + test/Parser/traditional_arg_scope.c | 7 + test/Parser/typeof.c | 19 + test/Parser/types.c | 14 + test/Preprocessor/_Pragma-dependency.c | 7 + test/Preprocessor/_Pragma-location.c | 4 + test/Preprocessor/_Pragma-physloc.c | 6 + test/Preprocessor/_Pragma-syshdr2.c | 5 + test/Preprocessor/_Pragma.c | 10 + test/Preprocessor/assembler-with-cpp.c | 77 + test/Preprocessor/builtin_line.c | 13 + test/Preprocessor/c90.c | 10 + test/Preprocessor/c99-6_10_3_3_p4.c | 6 + test/Preprocessor/c99-6_10_3_4_p5.c | 29 + test/Preprocessor/c99-6_10_3_4_p6.c | 24 + test/Preprocessor/c99-6_10_3_4_p7.c | 9 + test/Preprocessor/c99-6_10_3_4_p9.c | 16 + test/Preprocessor/clang_headers.c | 3 + test/Preprocessor/comment_save.c | 7 + test/Preprocessor/comment_save_if.c | 6 + test/Preprocessor/comment_save_macro.c | 8 + test/Preprocessor/cxx_and.cpp | 17 + test/Preprocessor/cxx_bitand.cpp | 16 + test/Preprocessor/cxx_bitor.cpp | 18 + test/Preprocessor/cxx_compl.cpp | 16 + test/Preprocessor/cxx_not.cpp | 15 + test/Preprocessor/cxx_not_eq.cpp | 16 + test/Preprocessor/cxx_oper_keyword.cpp | 7 + test/Preprocessor/cxx_oper_spelling.cpp | 11 + test/Preprocessor/cxx_or.cpp | 17 + test/Preprocessor/cxx_true.cpp | 13 + test/Preprocessor/cxx_xor.cpp | 18 + test/Preprocessor/dependencies-and-pp.c | 5 + test/Preprocessor/disabled-cond-diags.c | 10 + test/Preprocessor/dump-macros-spacing.c | 13 + test/Preprocessor/dump-options.c | 3 + test/Preprocessor/dump_macros.c | 31 + test/Preprocessor/dumptokens_phyloc.c | 5 + test/Preprocessor/expr_comma.c | 10 + test/Preprocessor/expr_invalid_tok.c | 15 + test/Preprocessor/expr_liveness.c | 52 + test/Preprocessor/expr_multichar.c | 5 + test/Preprocessor/expr_usual_conversions.c | 13 + test/Preprocessor/extension-warning.c | 18 + test/Preprocessor/file_to_include.h | 3 + test/Preprocessor/function_macro_file.c | 5 + test/Preprocessor/function_macro_file.h | 3 + test/Preprocessor/hash_line.c | 8 + test/Preprocessor/hash_space.c | 6 + test/Preprocessor/header_lookup1.c | 2 + test/Preprocessor/if_warning.c | 21 + test/Preprocessor/ifdef-recover.c | 15 + test/Preprocessor/import_self.c | 7 + test/Preprocessor/include-directive1.c | 14 + test/Preprocessor/include-directive2.c | 17 + test/Preprocessor/include-directive3.c | 3 + test/Preprocessor/include-macros.c | 4 + test/Preprocessor/include-pth.c | 3 + test/Preprocessor/indent_macro.c | 6 + test/Preprocessor/line-directive.c | 92 + test/Preprocessor/macro-multiline.c | 8 + test/Preprocessor/macro_arg_keyword.c | 6 + test/Preprocessor/macro_disable.c | 13 + test/Preprocessor/macro_disable2.c | 8 + test/Preprocessor/macro_disable3.c | 8 + test/Preprocessor/macro_disable4.c | 6 + test/Preprocessor/macro_expand.c | 19 + test/Preprocessor/macro_expandloc.c | 6 + test/Preprocessor/macro_expandloc2.c | 6 + test/Preprocessor/macro_fn.c | 46 + test/Preprocessor/macro_fn_comma_swallow.c | 21 + test/Preprocessor/macro_fn_disable_expand.c | 11 + test/Preprocessor/macro_fn_lparen_scan.c | 27 + test/Preprocessor/macro_fn_lparen_scan2.c | 7 + test/Preprocessor/macro_fn_placemarker.c | 5 + test/Preprocessor/macro_fn_preexpand.c | 12 + test/Preprocessor/macro_fn_varargs_iso.c | 11 + test/Preprocessor/macro_fn_varargs_named.c | 10 + test/Preprocessor/macro_misc.c | 23 + test/Preprocessor/macro_not_define.c | 9 + test/Preprocessor/macro_paste_bad.c | 35 + test/Preprocessor/macro_paste_bcpl_comment.c | 5 + test/Preprocessor/macro_paste_c_block_comment.c | 7 + test/Preprocessor/macro_paste_commaext.c | 13 + test/Preprocessor/macro_paste_empty.c | 13 + test/Preprocessor/macro_paste_hard.c | 17 + test/Preprocessor/macro_paste_hashhash.c | 7 + test/Preprocessor/macro_paste_mscomment.c | 20 + test/Preprocessor/macro_paste_none.c | 6 + test/Preprocessor/macro_paste_simple.c | 5 + test/Preprocessor/macro_paste_spacing.c | 7 + test/Preprocessor/macro_paste_spacing2.c | 6 + test/Preprocessor/macro_rescan.c | 9 + test/Preprocessor/macro_rescan2.c | 15 + test/Preprocessor/macro_rescan_varargs.c | 10 + test/Preprocessor/macro_rparen_scan.c | 8 + test/Preprocessor/macro_rparen_scan2.c | 8 + test/Preprocessor/macro_space.c | 5 + test/Preprocessor/mi_opt.c | 11 + test/Preprocessor/mi_opt.h | 4 + test/Preprocessor/objc-pp.m | 4 + test/Preprocessor/optimize.c | 29 + test/Preprocessor/output_paste_avoid.c | 23 + test/Preprocessor/overflow.c | 25 + test/Preprocessor/pic.c | 10 + test/Preprocessor/pr2086.c | 11 + test/Preprocessor/pr2086.h | 6 + test/Preprocessor/pragma_microsoft.c | 20 + test/Preprocessor/pragma_poison.c | 20 + test/Preprocessor/pragma_unknown.c | 28 + test/Preprocessor/print_line_track.c | 17 + test/Preprocessor/skipping_unclean.c | 9 + test/Preprocessor/stringize_misc.c | 26 + test/Preprocessor/stringize_space.c | 4 + test/Preprocessor/stringize_space2.c | 6 + test/Preprocessor/undef-error.c | 5 + test/Preprocessor/unterminated.c | 5 + test/Preprocessor/x86_target_features.c | 35 + test/Rewriter/block-test.c | 38 + test/Rewriter/crash.m | 25 + test/Rewriter/finally.m | 27 + test/Rewriter/id-test-3.m | 14 + test/Rewriter/ivar-encoding-1.m | 15 + test/Rewriter/ivar-encoding-2.m | 12 + test/Rewriter/metadata-test-1.m | 12 + test/Rewriter/metadata-test-2.m | 15 + test/Rewriter/method-encoding-1.m | 18 + test/Rewriter/objc-encoding-bug-1.m | 19 + test/Rewriter/objc-ivar-receiver-1.m | 24 + test/Rewriter/objc-string-concat-1.m | 14 + test/Rewriter/objc-super-test.m | 18 + test/Rewriter/objc-synchronized-1.m | 20 + test/Rewriter/properties.m | 54 + test/Rewriter/protocol-rewrite-1.m | 48 + test/Rewriter/rewrite-api-bug.m | 11 + test/Rewriter/rewrite-foreach-1.m | 37 + test/Rewriter/rewrite-foreach-2.m | 34 + test/Rewriter/rewrite-foreach-3.m | 29 + test/Rewriter/rewrite-foreach-4.m | 32 + test/Rewriter/rewrite-foreach-5.m | 47 + test/Rewriter/rewrite-foreach-6.m | 13 + test/Rewriter/rewrite-nest.m | 27 + test/Rewriter/rewrite-protocol-type-1.m | 24 + test/Rewriter/rewrite-try-catch.m | 27 + test/Rewriter/static-type-protocol-1.m | 27 + test/Rewriter/undecl-objc-h.m | 29 + test/Rewriter/undeclared-method-1.m | 9 + test/Rewriter/undef-field-reference-1.m | 15 + test/Rewriter/va-method.m | 17 + test/Sema/128bitint.c | 6 + test/Sema/PR2727.c | 8 + test/Sema/PR2728.c | 9 + test/Sema/PR2919-builtin-types-compat-strips-crv.c | 7 + test/Sema/PR2923.c | 12 + test/Sema/PR2963-enum-constant.c | 17 + test/Sema/address-constant.c | 10 + test/Sema/address_spaces.c | 32 + test/Sema/align-x86.c | 14 + test/Sema/annotate.c | 7 + test/Sema/anonymous-struct-union.c | 98 + test/Sema/arg-duplicate.c | 14 + test/Sema/arg-scope-c99.c | 2 + test/Sema/arg-scope.c | 5 + test/Sema/array-constraint.c | 52 + test/Sema/array-declared-as-incorrect-type.c | 16 + test/Sema/array-init.c | 265 + test/Sema/asm.c | 78 + test/Sema/assign-null.c | 10 + test/Sema/assign.c | 15 + test/Sema/ast-print.c | 8 + test/Sema/attr-aligned.c | 21 + test/Sema/attr-cleanup.c | 40 + test/Sema/attr-deprecated.c | 45 + test/Sema/attr-mode.c | 22 + test/Sema/attr-nodebug.c | 8 + test/Sema/attr-noinline.c | 8 + test/Sema/attr-noreturn.c | 27 + test/Sema/attr-regparm.c | 7 + test/Sema/attr-unused.c | 12 + test/Sema/attr-used.c | 20 + test/Sema/attr-warn_unused_result.c | 19 + test/Sema/attr-weak.c | 13 + test/Sema/bitfield-layout.c | 32 + test/Sema/bitfield.c | 36 + test/Sema/block-args.c | 29 + test/Sema/block-as-object.m | 20 + test/Sema/block-byref-args.c | 18 + test/Sema/block-call.c | 55 + test/Sema/block-explicit-return-type.c | 81 + test/Sema/block-labels.c | 17 + test/Sema/block-literal.c | 124 + test/Sema/block-misc.c | 187 + test/Sema/block-printf-attribute-1.c | 15 + test/Sema/block-return.c | 104 + test/Sema/block-sentinel-attribute.c | 25 + test/Sema/block-storageclass.c | 18 + test/Sema/builtin-object-size.c | 28 + test/Sema/builtin-prefetch.c | 13 + test/Sema/builtin-stackaddress.c | 16 + test/Sema/builtins.c | 52 + test/Sema/c89-2.c | 7 + test/Sema/c89.c | 82 + test/Sema/callingconv.c | 10 + test/Sema/carbon-pth.c | 7 + test/Sema/carbon.c | 5 + test/Sema/cast-to-union.c | 19 + test/Sema/cast.c | 14 + test/Sema/check-increment.c | 10 + test/Sema/compare.c | 17 + test/Sema/complex-int.c | 52 + test/Sema/complex-promotion.c | 15 + test/Sema/compound-literal.c | 33 + test/Sema/conditional-expr.c | 51 + test/Sema/conditional.c | 15 + test/Sema/const-eval.c | 67 + test/Sema/const-ptr-int-ptr-cast.c | 5 + test/Sema/constant-builtins-2.c | 50 + test/Sema/constant-builtins.c | 24 + test/Sema/constructor-attribute.c | 15 + test/Sema/darwin-align-cast.c | 23 + test/Sema/decl-invalid.c | 29 + test/Sema/decl-type-merging.c | 16 + test/Sema/declspec.c | 23 + test/Sema/default.c | 8 + test/Sema/default1.c | 2 + test/Sema/deref.c | 44 + test/Sema/designated-initializers.c | 234 + test/Sema/dllimport-dllexport.c | 18 + test/Sema/enum.c | 86 + test/Sema/expr-address-of.c | 109 + test/Sema/expr-comma-c89.c | 18 + test/Sema/expr-comma.c | 18 + test/Sema/exprs.c | 108 + test/Sema/ext_vector_components.c | 37 + test/Sema/flexible-array-init.c | 58 + test/Sema/floating-point-compare.c | 25 + test/Sema/for.c | 7 + test/Sema/format-attribute.c | 34 + test/Sema/format-string-percentm.c | 6 + test/Sema/format-strings.c | 132 + test/Sema/function-pointer-sentinel-attribute.c | 23 + test/Sema/function-ptr.c | 11 + test/Sema/function-redecl.c | 127 + test/Sema/function-sentinel-attr.c | 30 + test/Sema/function.c | 89 + test/Sema/gnu89.c | 3 + test/Sema/heinous-extensions-off.c | 10 + test/Sema/heinous-extensions-on.c | 10 + test/Sema/i-c-e.c | 66 + test/Sema/if-empty-body.c | 16 + test/Sema/illegal-types.c | 7 + test/Sema/implicit-builtin-decl.c | 53 + test/Sema/implicit-builtin-freestanding.c | 4 + test/Sema/implicit-builtin-redecl.c | 14 + test/Sema/implicit-cast.c | 8 + test/Sema/implicit-decl.c | 17 + test/Sema/implicit-def.c | 8 + test/Sema/implicit-int.c | 31 + test/Sema/incompatible-sign.c | 5 + test/Sema/incomplete-call.c | 13 + test/Sema/incomplete-decl.c | 30 + test/Sema/indirect-goto.c | 8 + test/Sema/init-struct-qualified.c | 12 + test/Sema/init.c | 128 + test/Sema/inline.c | 6 + test/Sema/int-arith-convert.c | 12 + test/Sema/invalid-decl.c | 22 + test/Sema/invalid-init-diag.c | 4 + test/Sema/invalid-struct-init.c | 29 + test/Sema/knr-def-call.c | 18 + test/Sema/knr-variadic-def.c | 29 + test/Sema/member-reference.c | 20 + test/Sema/merge-decls.c | 39 + test/Sema/ms-fuzzy-asm.c | 9 + test/Sema/nested-redef.c | 22 + test/Sema/nonnull.c | 32 + test/Sema/offsetof.c | 50 + test/Sema/overloadable-complex.c | 50 + test/Sema/overloadable.c | 53 + test/Sema/pointer-addition.c | 19 + test/Sema/pointer-subtract-compat.c | 11 + test/Sema/pragma-pack-2.c | 93 + test/Sema/pragma-pack-3.c | 34 + test/Sema/pragma-pack.c | 27 + test/Sema/pragma-unused.c | 38 + test/Sema/predef.c | 19 + test/Sema/predefined-function.c | 38 + test/Sema/private-extern.c | 88 + test/Sema/rdar6248119.m | 27 + test/Sema/rdr6094103-unordered-compare-promote.c | 6 + test/Sema/recover-goto.c | 4 + test/Sema/redefinition.c | 10 + test/Sema/return-silent.c | 9 + test/Sema/return.c | 12 + test/Sema/scope-check.c | 196 + test/Sema/self-comparison.c | 33 + test/Sema/sentinel-attribute.c | 15 + test/Sema/shift.c | 6 + test/Sema/statements.c | 29 + test/Sema/static-init.c | 23 + test/Sema/stdcall-fastcall.c | 10 + test/Sema/struct-cast.c | 14 + test/Sema/struct-compat.c | 17 + test/Sema/struct-decl.c | 43 + test/Sema/struct-packed-align.c | 111 + test/Sema/surpress-deprecated.c | 7 + test/Sema/switch.c | 70 + test/Sema/tentative-decls.c | 65 + test/Sema/text-diag.c | 4 + test/Sema/thread-specifier.c | 21 + test/Sema/transparent-union-pointer.c | 14 + test/Sema/transparent-union.c | 40 + test/Sema/type-spec-struct-union.c | 65 + test/Sema/typecheck-binop.c | 27 + test/Sema/typedef-prototype.c | 8 + test/Sema/typedef-redef.c | 11 + test/Sema/typedef-retain.c | 38 + test/Sema/typedef-variable-type.c | 3 + test/Sema/types.c | 39 + test/Sema/ucn-cstring.c | 17 + test/Sema/unnamed-bitfield-init.c | 6 + test/Sema/unused-expr.c | 46 + test/Sema/usual-float.c | 12 + test/Sema/va_arg_x86_32.c | 6 + test/Sema/va_arg_x86_64.c | 16 + test/Sema/var-redecl.c | 61 + test/Sema/varargs-x86-64.c | 8 + test/Sema/varargs.c | 63 + test/Sema/variadic-block.c | 41 + test/Sema/vector-assign.c | 45 + test/Sema/vector-cast.c | 38 + test/Sema/vector-init.c | 23 + test/Sema/vla.c | 56 + test/Sema/void_arg.c | 26 + test/Sema/warn-freestanding-complex.c | 4 + test/Sema/warn-missing-prototypes.c | 37 + test/Sema/wchar.c | 12 + test/SemaCXX/__null.cpp | 14 + test/SemaCXX/abstract.cpp | 128 + test/SemaCXX/access-base-class.cpp | 82 + test/SemaCXX/access.cpp | 23 + test/SemaCXX/addr-of-overloaded-function.cpp | 29 + test/SemaCXX/address-of.cpp | 35 + test/SemaCXX/aggregate-initialization.cpp | 28 + test/SemaCXX/anonymous-union.cpp | 113 + test/SemaCXX/attr-unavailable.cpp | 20 + test/SemaCXX/basic_lookup_argdep.cpp | 60 + test/SemaCXX/blocks.cpp | 11 + test/SemaCXX/bool.cpp | 18 + test/SemaCXX/carbon.cpp | 5 + test/SemaCXX/class-names.cpp | 52 + test/SemaCXX/class.cpp | 112 + test/SemaCXX/complex-overload.cpp | 50 + test/SemaCXX/composite-pointer-type.cpp | 27 + test/SemaCXX/condition.cpp | 35 + test/SemaCXX/conditional-expr.cpp | 181 + test/SemaCXX/const-cast.cpp | 63 + test/SemaCXX/constant-expression.cpp | 83 + test/SemaCXX/constructor-initializer.cpp | 56 + test/SemaCXX/constructor-recovery.cpp | 10 + test/SemaCXX/constructor.cpp | 60 + test/SemaCXX/conversion-function.cpp | 66 + test/SemaCXX/convert-to-bool.cpp | 67 + test/SemaCXX/converting-constructor.cpp | 40 + test/SemaCXX/copy-assignment.cpp | 99 + test/SemaCXX/copy-initialization.cpp | 23 + test/SemaCXX/dcl_ambig_res.cpp | 66 + test/SemaCXX/dcl_init_aggr.cpp | 122 + test/SemaCXX/decl-expr-ambiguity.cpp | 43 + test/SemaCXX/default1.cpp | 31 + test/SemaCXX/default2.cpp | 123 + test/SemaCXX/deleted-function.cpp | 36 + test/SemaCXX/dependent-types.cpp | 10 + test/SemaCXX/derived-to-base-ambig.cpp | 33 + test/SemaCXX/destructor.cpp | 56 + test/SemaCXX/direct-initializer.cpp | 36 + test/SemaCXX/do-while-scope.cpp | 8 + test/SemaCXX/dynamic-cast.cpp | 74 + test/SemaCXX/elaborated-type-specifier.cpp | 47 + test/SemaCXX/enum.cpp | 38 + test/SemaCXX/exception-spec.cpp | 35 + test/SemaCXX/exceptions.cpp | 99 + test/SemaCXX/expressions.cpp | 9 + test/SemaCXX/fntype-decl.cpp | 20 + test/SemaCXX/friend.cpp | 6 + test/SemaCXX/function-redecl.cpp | 26 + test/SemaCXX/function-type-qual.cpp | 23 + test/SemaCXX/functional-cast.cpp | 27 + test/SemaCXX/i-c-e-cxx.cpp | 6 + test/SemaCXX/implicit-int.cpp | 5 + test/SemaCXX/inherit.cpp | 32 + test/SemaCXX/inline.cpp | 5 + test/SemaCXX/linkage-spec.cpp | 27 + test/SemaCXX/member-expr-static.cpp | 21 + test/SemaCXX/member-expr.cpp | 33 + test/SemaCXX/member-location.cpp | 5 + test/SemaCXX/member-name-lookup.cpp | 148 + test/SemaCXX/member-pointer-size.cpp | 15 + test/SemaCXX/member-pointer.cpp | 129 + test/SemaCXX/ms-exception-spec.cpp | 3 + test/SemaCXX/namespace-alias.cpp | 64 + test/SemaCXX/namespace.cpp | 69 + test/SemaCXX/nested-name-spec.cpp | 173 + test/SemaCXX/new-delete.cpp | 97 + test/SemaCXX/no-implicit-builtin-decls.cpp | 7 + test/SemaCXX/nullptr.cpp | 67 + test/SemaCXX/offsetof.cpp | 15 + test/SemaCXX/overload-call-copycon.cpp | 48 + test/SemaCXX/overload-call.cpp | 280 + test/SemaCXX/overload-decl.cpp | 31 + test/SemaCXX/overload-member-call.cpp | 56 + test/SemaCXX/overloaded-builtin-operators.cpp | 122 + test/SemaCXX/overloaded-operator-decl.cpp | 39 + test/SemaCXX/overloaded-operator.cpp | 211 + test/SemaCXX/qualification-conversion.cpp | 23 + test/SemaCXX/qualified-id-lookup.cpp | 111 + test/SemaCXX/qualified-names-diag.cpp | 33 + test/SemaCXX/qualified-names-print.cpp | 15 + test/SemaCXX/references.cpp | 89 + test/SemaCXX/reinterpret-cast.cpp | 90 + test/SemaCXX/reinterpret-fn-obj-pedantic.cpp | 9 + test/SemaCXX/return-stack-addr.cpp | 112 + test/SemaCXX/rval-references.cpp | 91 + test/SemaCXX/statements.cpp | 5 + test/SemaCXX/static-assert.cpp | 30 + test/SemaCXX/static-cast.cpp | 129 + test/SemaCXX/static-initializers.cpp | 12 + test/SemaCXX/struct-class-redecl.cpp | 8 + test/SemaCXX/template-specialization.cpp | 4 + test/SemaCXX/this.cpp | 6 + test/SemaCXX/trivial-constructor.cpp | 38 + test/SemaCXX/trivial-destructor.cpp | 38 + test/SemaCXX/type-convert-construct.cpp | 17 + test/SemaCXX/type-definition-in-specifier.cpp | 25 + test/SemaCXX/type-dependent-exprs.cpp | 24 + test/SemaCXX/type-traits.cpp | 111 + test/SemaCXX/typedef-redecl.cpp | 31 + test/SemaCXX/typeid.cpp | 16 + test/SemaCXX/types_compatible_p.cpp | 5 + test/SemaCXX/unused.cpp | 15 + test/SemaCXX/user-defined-conversions.cpp | 69 + test/SemaCXX/using-directive.cpp | 108 + test/SemaCXX/vararg-non-pod.cpp | 56 + test/SemaCXX/virtual-override.cpp | 106 + test/SemaCXX/virtuals.cpp | 38 + test/SemaCXX/warn-for-var-in-else.cpp | 30 + test/SemaCXX/wchar_t.cpp | 9 + test/SemaObjC/ContClassPropertyLookup.m | 18 + test/SemaObjC/DoubleMethod.m | 19 + test/SemaObjC/access-property-getter.m | 35 + test/SemaObjC/alias-test-1.m | 31 + test/SemaObjC/alias-test-2.m | 17 + test/SemaObjC/argument-checking.m | 25 + test/SemaObjC/at-defs.m | 29 + test/SemaObjC/attr-cleanup.m | 10 + test/SemaObjC/attr-deprecated.m | 99 + test/SemaObjC/attr-objc-exception.m | 16 + test/SemaObjC/attr-objc-gc.m | 8 + test/SemaObjC/bad-receiver-1.m | 19 + test/SemaObjC/block-attr.m | 9 + test/SemaObjC/block-ivar.m | 19 + test/SemaObjC/blocks.m | 46 + test/SemaObjC/call-super-2.m | 98 + test/SemaObjC/catch-stmt.m | 13 + test/SemaObjC/category-1.m | 56 + test/SemaObjC/category-method-lookup-2.m | 22 + test/SemaObjC/category-method-lookup.m | 31 + test/SemaObjC/check-dup-decl-methods-1.m | 38 + test/SemaObjC/check-dup-objc-decls-1.m | 39 + test/SemaObjC/class-bitfield.m | 37 + test/SemaObjC/class-conforming-protocol-1.m | 21 + test/SemaObjC/class-conforming-protocol-2.m | 22 + test/SemaObjC/class-def-test-1.m | 33 + test/SemaObjC/class-extension-dup-methods.m | 15 + test/SemaObjC/class-impl-1.m | 40 + test/SemaObjC/class-method-lookup.m | 46 + test/SemaObjC/class-method-self.m | 26 + test/SemaObjC/class-property-access.m | 12 + test/SemaObjC/class-proto-1.m | 36 + test/SemaObjC/cocoa-pth.m | 7 + test/SemaObjC/cocoa.m | 5 + test/SemaObjC/compare-qualified-id.m | 33 + .../SemaObjC/compatible-protocol-qualified-types.m | 75 + test/SemaObjC/comptypes-1.m | 91 + test/SemaObjC/comptypes-2.m | 37 + test/SemaObjC/comptypes-3.m | 64 + test/SemaObjC/comptypes-4.m | 25 + test/SemaObjC/comptypes-5.m | 44 + test/SemaObjC/comptypes-6.m | 16 + test/SemaObjC/comptypes-7.m | 70 + test/SemaObjC/comptypes-8.m | 12 + test/SemaObjC/comptypes-9.m | 86 + test/SemaObjC/comptypes-a.m | 32 + test/SemaObjC/comptypes-legal.m | 37 + test/SemaObjC/conditional-expr-2.m | 29 + test/SemaObjC/conditional-expr-3.m | 67 + test/SemaObjC/conditional-expr-4.m | 78 + test/SemaObjC/conditional-expr.m | 44 + test/SemaObjC/conflicting-ivar-test-1.m | 86 + test/SemaObjC/continuation-class-err.m | 15 + test/SemaObjC/duplicate-ivar-check.m | 22 + test/SemaObjC/enhanced-proto-2.m | 21 + test/SemaObjC/error-property-gc-attr.m | 27 + test/SemaObjC/exprs.m | 21 + test/SemaObjC/foreach.m | 18 + test/SemaObjC/format-arg-attribute.m | 28 + test/SemaObjC/format-strings-objc.m | 43 + test/SemaObjC/forward-class-1.m | 47 + test/SemaObjC/forward-class-receiver.m | 13 + test/SemaObjC/gcc-cast-ext.m | 24 + test/SemaObjC/id.m | 20 + test/SemaObjC/id_builtin.m | 10 + test/SemaObjC/ignore-weakimport-method.m | 7 + .../incompatible-protocol-qualified-types.m | 40 + test/SemaObjC/inst-method-lookup-in-root.m | 27 + test/SemaObjC/interface-1.m | 38 + test/SemaObjC/interface-layout-2.m | 16 + test/SemaObjC/interface-layout.m | 27 + test/SemaObjC/interface-scope-2.m | 126 + test/SemaObjC/interface-scope.m | 12 + test/SemaObjC/interface-tu-variable.m | 26 + test/SemaObjC/invalid-code.m | 7 + test/SemaObjC/invalid-objc-decls-1.m | 34 + test/SemaObjC/invalid-receiver.m | 9 + test/SemaObjC/invalid-typename.m | 12 + test/SemaObjC/ivar-access-package.m | 45 + test/SemaObjC/ivar-access-tests.m | 122 + test/SemaObjC/ivar-lookup.m | 18 + test/SemaObjC/ivar-ref-misuse.m | 41 + test/SemaObjC/ivar-sem-check-1.m | 19 + test/SemaObjC/ivar-sem-check-2.m | 23 + test/SemaObjC/legacy-implementation-1.m | 11 + test/SemaObjC/message.m | 100 + test/SemaObjC/method-arg-decay.m | 95 + test/SemaObjC/method-attributes.m | 32 + test/SemaObjC/method-bad-param.m | 30 + test/SemaObjC/method-conflict.m | 53 + test/SemaObjC/method-def-1.m | 40 + test/SemaObjC/method-def-2.m | 19 + test/SemaObjC/method-encoding-2.m | 12 + test/SemaObjC/method-lookup-2.m | 62 + test/SemaObjC/method-lookup-3.m | 52 + test/SemaObjC/method-lookup-4.m | 62 + test/SemaObjC/method-lookup.m | 34 + test/SemaObjC/method-no-context.m | 4 + test/SemaObjC/method-not-defined.m | 13 + test/SemaObjC/method-sentinel-attr.m | 37 + test/SemaObjC/method-typecheck-1.m | 37 + test/SemaObjC/method-typecheck-2.m | 25 + test/SemaObjC/method-undef-category-warn-1.m | 32 + test/SemaObjC/method-undef-extension-warn-1.m | 25 + test/SemaObjC/method-undefined-warn-1.m | 42 + test/SemaObjC/missing-method-context.m | 4 + test/SemaObjC/newproperty-class-method-1.m | 60 + test/SemaObjC/no-gc-weak-test.m | 28 + test/SemaObjC/no-warn-synth-protocol-meth.m | 17 + test/SemaObjC/no-warn-unimpl-method.m | 42 + test/SemaObjC/nsobject-attribute-1.m | 48 + test/SemaObjC/nsobject-attribute.m | 36 + test/SemaObjC/objc-string-constant.m | 39 + test/SemaObjC/objc2-merge-gc-attribue-decl.m | 12 + test/SemaObjC/objc2-warn-weak-decl.m | 10 + test/SemaObjC/property-10.m | 22 + test/SemaObjC/property-11.m | 35 + test/SemaObjC/property-12.m | 32 + test/SemaObjC/property-13.m | 77 + test/SemaObjC/property-2.m | 63 + test/SemaObjC/property-3.m | 14 + test/SemaObjC/property-4.m | 29 + test/SemaObjC/property-5.m | 34 + test/SemaObjC/property-6.m | 69 + test/SemaObjC/property-7.m | 34 + test/SemaObjC/property-8.m | 74 + test/SemaObjC/property-9-impl-method.m | 94 + test/SemaObjC/property-9.m | 86 + test/SemaObjC/property-category-1.m | 52 + test/SemaObjC/property-category-2.m | 19 + test/SemaObjC/property-category-3.m | 31 + test/SemaObjC/property-error-readonly-assign.m | 21 + test/SemaObjC/property-impl-misuse.m | 16 + test/SemaObjC/property-inherited.m | 44 + test/SemaObjC/property-ivar-mismatch.m | 14 + test/SemaObjC/property-method-lookup-impl.m | 26 + test/SemaObjC/property-missing.m | 22 + test/SemaObjC/property-nonfragile-abi.m | 21 + test/SemaObjC/property-noprotocol-warning.m | 36 + test/SemaObjC/property-redundant-decl-accessor.m | 18 + test/SemaObjC/property-typecheck-1.m | 101 + test/SemaObjC/property-user-setter.m | 90 + test/SemaObjC/property-weak.m | 5 + test/SemaObjC/property.m | 55 + test/SemaObjC/props-on-prots.m | 65 + test/SemaObjC/protocol-archane.m | 35 + test/SemaObjC/protocol-attribute.m | 49 + test/SemaObjC/protocol-expr-1.m | 15 + test/SemaObjC/protocol-expr-neg-1.m | 19 + test/SemaObjC/protocol-id-test-1.m | 16 + test/SemaObjC/protocol-id-test-2.m | 12 + test/SemaObjC/protocol-id-test-3.m | 94 + test/SemaObjC/protocol-implementation-inherited.m | 56 + test/SemaObjC/protocol-lookup-2.m | 33 + test/SemaObjC/protocol-lookup.m | 50 + .../protocol-qualified-class-unsupported.m | 40 + test/SemaObjC/protocol-typecheck.m | 25 + test/SemaObjC/protocols.m | 63 + test/SemaObjC/rdr-6211479-array-property.m | 9 + test/SemaObjC/scope-check.m | 103 + test/SemaObjC/selector-1.m | 22 + test/SemaObjC/selector-error.m | 20 + test/SemaObjC/selector-overload.m | 47 + test/SemaObjC/sizeof-interface.m | 79 + test/SemaObjC/static-ivar-ref-1.m | 17 + test/SemaObjC/stmts.m | 14 + test/SemaObjC/string.m | 15 + test/SemaObjC/super-cat-prot.m | 48 + test/SemaObjC/super-property-message-expr.m | 21 + test/SemaObjC/super-property-notation.m | 30 + test/SemaObjC/super.m | 40 + test/SemaObjC/synchronized.m | 23 + test/SemaObjC/synthesize-setter-contclass.m | 24 + test/SemaObjC/synthesized-ivar.m | 13 + test/SemaObjC/try-catch.m | 47 + test/SemaObjC/typedef-class.m | 78 + test/SemaObjC/ucn-objc-string.m | 13 + test/SemaObjC/undef-class-messagin-error.m | 13 + test/SemaObjC/undef-protocol-methods-1.m | 42 + test/SemaObjC/undef-superclass-1.m | 26 + test/SemaObjC/undefined-protocol-type-1.m | 9 + test/SemaObjC/unused.m | 18 + test/SemaObjC/va-method-1.m | 17 + test/SemaObjC/warn-selector-selection.m | 14 + test/SemaObjC/warn-weak-field.m | 24 + test/SemaObjC/weak-attr-ivar.m | 73 + test/SemaObjC/writable-property-in-superclass.m | 17 + test/SemaObjCXX/blocks.mm | 46 + test/SemaObjCXX/cocoa.mm | 4 + test/SemaObjCXX/linkage-spec.mm | 4 + test/SemaObjCXX/objc-decls-inside-namespace.mm | 27 + test/SemaObjCXX/overload.mm | 94 + test/SemaObjCXX/protocol-lookup.mm | 50 + test/SemaObjCXX/reserved-keyword-selectors.mm | 35 + test/SemaObjCXX/vararg-non-pod.mm | 32 + test/SemaObjCXX/void_to_obj.mm | 11 + test/SemaTemplate/class-template-decl.cpp | 49 + test/SemaTemplate/class-template-id-2.cpp | 24 + test/SemaTemplate/class-template-id.cpp | 38 + test/SemaTemplate/class-template-spec.cpp | 80 + test/SemaTemplate/current-instantiation.cpp | 71 + test/SemaTemplate/default-arguments.cpp | 12 + test/SemaTemplate/dependent-type-identity.cpp | 72 + test/SemaTemplate/enum-argument.cpp | 7 + test/SemaTemplate/example-dynarray.cpp | 150 + test/SemaTemplate/fibonacci.cpp | 66 + test/SemaTemplate/fun-template-def.cpp | 43 + test/SemaTemplate/injected-class-name.cpp | 40 + test/SemaTemplate/instantiate-array.cpp | 28 + test/SemaTemplate/instantiate-c99.cpp | 81 + test/SemaTemplate/instantiate-call.cpp | 50 + test/SemaTemplate/instantiate-cast.cpp | 109 + test/SemaTemplate/instantiate-clang.cpp | 35 + test/SemaTemplate/instantiate-complete.cpp | 47 + test/SemaTemplate/instantiate-declref.cpp | 71 + test/SemaTemplate/instantiate-enum.cpp | 11 + test/SemaTemplate/instantiate-expr-1.cpp | 71 + test/SemaTemplate/instantiate-expr-2.cpp | 132 + test/SemaTemplate/instantiate-expr-3.cpp | 115 + test/SemaTemplate/instantiate-expr-4.cpp | 289 + test/SemaTemplate/instantiate-expr-basic.cpp | 17 + test/SemaTemplate/instantiate-field.cpp | 28 + test/SemaTemplate/instantiate-function-1.cpp | 211 + test/SemaTemplate/instantiate-function-1.mm | 14 + test/SemaTemplate/instantiate-function-2.cpp | 12 + test/SemaTemplate/instantiate-member-class.cpp | 38 + test/SemaTemplate/instantiate-method.cpp | 74 + test/SemaTemplate/instantiate-static-var.cpp | 18 + test/SemaTemplate/instantiate-subscript.cpp | 26 + .../instantiate-template-template-parm.cpp | 21 + test/SemaTemplate/instantiate-try-catch.cpp | 14 + test/SemaTemplate/instantiate-type.cpp | 17 + test/SemaTemplate/instantiate-typedef.cpp | 16 + test/SemaTemplate/instantiation-backtrace.cpp | 32 + test/SemaTemplate/instantiation-default-1.cpp | 102 + test/SemaTemplate/instantiation-default-2.cpp | 18 + test/SemaTemplate/instantiation-default-3.cpp | 21 + test/SemaTemplate/instantiation-depth.cpp | 9 + test/SemaTemplate/metafun-apply.cpp | 43 + test/SemaTemplate/nested-name-spec-template.cpp | 61 + test/SemaTemplate/nested-template.cpp | 16 + test/SemaTemplate/qualified-names-diag.cpp | 16 + test/SemaTemplate/right-angle-brackets-0x.cpp | 22 + test/SemaTemplate/right-angle-brackets-98.cpp | 12 + test/SemaTemplate/temp.cpp | 5 + test/SemaTemplate/temp_arg.cpp | 12 + test/SemaTemplate/temp_arg_nontype.cpp | 124 + test/SemaTemplate/temp_arg_template.cpp | 38 + test/SemaTemplate/temp_arg_type.cpp | 24 + test/SemaTemplate/temp_class_spec.cpp | 20 + test/SemaTemplate/temp_explicit.cpp | 111 + test/SemaTemplate/temp_explicit_cxx0x.cpp | 24 + test/SemaTemplate/temp_param.cpp | 90 + test/SemaTemplate/typename-specifier-2.cpp | 30 + test/SemaTemplate/typename-specifier.cpp | 74 + test/TestRunner.sh | 134 + tools/CMakeLists.txt | 2 + tools/Makefile | 13 + tools/clang-cc/CMakeLists.txt | 26 + tools/clang-cc/Makefile | 32 + tools/clang-cc/clang-cc.cpp | 2293 ++++++++ tools/driver/CMakeLists.txt | 12 + tools/driver/Makefile | 23 + tools/driver/driver.cpp | 228 + tools/scan-view/Reporter.py | 248 + tools/scan-view/Resources/FileRadar.scpt | Bin 0 -> 18418 bytes tools/scan-view/Resources/GetRadarVersion.scpt | 0 tools/scan-view/Resources/bugcatcher.ico | Bin 0 -> 318 bytes tools/scan-view/ScanView.py | 770 +++ tools/scan-view/scan-view | 131 + tools/scan-view/startfile.py | 203 + utils/ABITest/ABITestGen.py | 638 +++ utils/ABITest/Enumeration.py | 276 + utils/ABITest/Makefile.test.common | 170 + utils/ABITest/TypeGen.py | 381 ++ utils/ABITest/build-and-summarize-all.sh | 15 + utils/ABITest/build-and-summarize.sh | 14 + utils/ABITest/build.sh | 12 + utils/ABITest/layout/Makefile | 68 + utils/ABITest/return-types-32/Makefile | 7 + utils/ABITest/return-types-64/Makefile | 7 + utils/ABITest/single-args-32/Makefile | 7 + utils/ABITest/single-args-64/Makefile | 13 + utils/ABITest/summarize.sh | 15 + utils/CaptureCmd | 73 + utils/CmpDriver | 194 + utils/FindSpecRefs | 910 +++ utils/SummarizeErrors | 117 + utils/builtin-defines.c | 85 + utils/ccc-analyzer | 617 +++ utils/pch-test.pl | 61 + utils/scan-build | 1278 +++++ utils/scanview.css | 62 + utils/sorttable.js | 493 ++ utils/test/Makefile.multi | 21 + utils/test/MultiTestRunner.py | 331 ++ utils/test/ProgressBar.py | 227 + utils/test/TestRunner.py | 210 + utils/token-delta.py | 251 + utils/ubiviz | 74 + win32/clangAST/clangAST.vcproj | 347 ++ win32/clangAnalysis/clangAnalysis.vcproj | 351 ++ win32/clangBasic/clangBasic.vcproj | 236 + win32/clangCodeGen/clangCodeGen.vcproj | 271 + win32/clangDriver/clangDriver.vcproj | 270 + win32/clangLex/clangLex.vcproj | 283 + win32/clangLibDriver/clangLibDriver.vcproj | 205 + win32/clangParse/clangParse.vcproj | 248 + win32/clangRewrite/clangRewrite.vcproj | 191 + win32/clangSema/clangSema.vcproj | 263 + www/CheckerNotes.html | 9 + www/OpenProjects.html | 112 + www/StaticAnalysis.html | 156 + www/StaticAnalysisUsage.html | 274 + www/carbon-compile.png | Bin 0 -> 23702 bytes www/clang_video-05-25-2007.html | 27 + www/clang_video-07-25-2007.html | 30 + www/comparison.html | 195 + www/content.css | 25 + www/cxx_status.html | 2320 ++++++++ www/demo/DemoInfo.html | 83 + www/demo/cathead.png | Bin 0 -> 21602 bytes www/demo/index.cgi | 461 ++ www/demo/syntax.css | 4 + www/demo/what is this directory.txt | 15 + www/diagnostics.html | 279 + www/distclang_status.html | 30 + www/feature-compile1.png | Bin 0 -> 91247 bytes www/feature-compile2.png | Bin 0 -> 140963 bytes www/feature-memory1.png | Bin 0 -> 92680 bytes www/features.html | 423 ++ www/get_involved.html | 61 + www/get_started.html | 228 + www/hacking.html | 101 + www/index.html | 117 + www/latest_checker.html.incl | 1 + www/menu.css | 39 + www/menu.html.incl | 43 + www/performance-2008-10-31.html | 134 + www/performance.html | 112 + www/timing-data/2008-10-31/176.gcc-01.txt | 135 + www/timing-data/2008-10-31/176.gcc-02.txt | 135 + www/timing-data/2008-10-31/176.gcc.png | Bin 0 -> 20395 bytes www/timing-data/2008-10-31/sketch-01.txt | 187 + www/timing-data/2008-10-31/sketch-02.txt | 187 + www/timing-data/2008-10-31/sketch.png | Bin 0 -> 23482 bytes www/timing-data/2009-03-02/176.gcc.pdf | Bin 0 -> 34547 bytes www/timing-data/2009-03-02/176.gcc.png | Bin 0 -> 77003 bytes www/timing-data/2009-03-02/176.gcc.txt | 1120 ++++ www/timing-data/2009-03-02/sketch.pdf | Bin 0 -> 36086 bytes www/timing-data/2009-03-02/sketch.png | Bin 0 -> 78278 bytes www/timing-data/2009-03-02/sketch.txt | 2368 ++++++++ 1829 files changed, 297910 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 INPUTS/Cocoa_h.m create mode 100644 INPUTS/c99-intconst-1.c create mode 100644 INPUTS/carbon_h.c create mode 100644 INPUTS/iostream.cc create mode 100644 INPUTS/macro_pounder_fn.c create mode 100644 INPUTS/macro_pounder_obj.c create mode 100644 INPUTS/stpcpy-test.c create mode 100644 LICENSE.TXT create mode 100644 Makefile create mode 100644 ModuleInfo.txt create mode 100644 NOTES.txt create mode 100644 README.txt create mode 100644 TODO.txt create mode 100644 clang.xcodeproj/project.pbxproj create mode 100644 docs/AnalyzerRegions.html create mode 100644 docs/BlockImplementation.txt create mode 100644 docs/BlockLanguageSpec.txt create mode 100644 docs/DriverArchitecture.png create mode 100644 docs/DriverInternals.html create mode 100644 docs/InternalsManual.html create mode 100644 docs/LanguageExtensions.html create mode 100644 docs/Makefile create mode 100644 docs/PCHInternals.html create mode 100644 docs/PTHInternals.html create mode 100644 docs/UsersManual.html create mode 100644 docs/doxygen.cfg create mode 100644 docs/doxygen.cfg.in create mode 100644 docs/doxygen.css create mode 100644 docs/doxygen.footer create mode 100644 docs/doxygen.header create mode 100644 docs/doxygen.intro create mode 100644 docs/index.html create mode 100644 docs/tools/Makefile create mode 100644 docs/tools/clang.pod create mode 100644 docs/tools/manpage.css create mode 100644 include/CMakeLists.txt create mode 100644 include/Makefile create mode 100644 include/clang/AST/APValue.h create mode 100644 include/clang/AST/AST.h create mode 100644 include/clang/AST/ASTConsumer.h create mode 100644 include/clang/AST/ASTContext.h create mode 100644 include/clang/AST/ASTDiagnostic.h create mode 100644 include/clang/AST/Attr.h create mode 100644 include/clang/AST/Builtins.def create mode 100644 include/clang/AST/Builtins.h create mode 100644 include/clang/AST/CFG.h create mode 100644 include/clang/AST/Decl.h create mode 100644 include/clang/AST/DeclBase.h create mode 100644 include/clang/AST/DeclCXX.h create mode 100644 include/clang/AST/DeclContextInternals.h create mode 100644 include/clang/AST/DeclGroup.h create mode 100644 include/clang/AST/DeclNodes.def create mode 100644 include/clang/AST/DeclObjC.h create mode 100644 include/clang/AST/DeclTemplate.h create mode 100644 include/clang/AST/DeclVisitor.h create mode 100644 include/clang/AST/DeclarationName.h create mode 100644 include/clang/AST/Expr.h create mode 100644 include/clang/AST/ExprCXX.h create mode 100644 include/clang/AST/ExprObjC.h create mode 100644 include/clang/AST/ExternalASTSource.h create mode 100644 include/clang/AST/NestedNameSpecifier.h create mode 100644 include/clang/AST/PPCBuiltins.def create mode 100644 include/clang/AST/ParentMap.h create mode 100644 include/clang/AST/PrettyPrinter.h create mode 100644 include/clang/AST/RecordLayout.h create mode 100644 include/clang/AST/Stmt.h create mode 100644 include/clang/AST/StmtCXX.h create mode 100644 include/clang/AST/StmtGraphTraits.h create mode 100644 include/clang/AST/StmtIterator.h create mode 100644 include/clang/AST/StmtNodes.def create mode 100644 include/clang/AST/StmtObjC.h create mode 100644 include/clang/AST/StmtVisitor.h create mode 100644 include/clang/AST/TargetBuiltins.h create mode 100644 include/clang/AST/TemplateName.h create mode 100644 include/clang/AST/Type.h create mode 100644 include/clang/AST/TypeNodes.def create mode 100644 include/clang/AST/TypeOrdering.h create mode 100644 include/clang/AST/X86Builtins.def create mode 100644 include/clang/Analysis/Analyses/LiveVariables.h create mode 100644 include/clang/Analysis/Analyses/UninitializedValues.h create mode 100644 include/clang/Analysis/AnalysisDiagnostic.h create mode 100644 include/clang/Analysis/FlowSensitive/DataflowSolver.h create mode 100644 include/clang/Analysis/FlowSensitive/DataflowValues.h create mode 100644 include/clang/Analysis/LocalCheckers.h create mode 100644 include/clang/Analysis/PathDiagnostic.h create mode 100644 include/clang/Analysis/PathSensitive/BasicValueFactory.h create mode 100644 include/clang/Analysis/PathSensitive/BugReporter.h create mode 100644 include/clang/Analysis/PathSensitive/ConstraintManager.h create mode 100644 include/clang/Analysis/PathSensitive/Environment.h create mode 100644 include/clang/Analysis/PathSensitive/ExplodedGraph.h create mode 100644 include/clang/Analysis/PathSensitive/GRAuditor.h create mode 100644 include/clang/Analysis/PathSensitive/GRBlockCounter.h create mode 100644 include/clang/Analysis/PathSensitive/GRCoreEngine.h create mode 100644 include/clang/Analysis/PathSensitive/GRExprEngine.h create mode 100644 include/clang/Analysis/PathSensitive/GRExprEngineBuilders.h create mode 100644 include/clang/Analysis/PathSensitive/GRSimpleAPICheck.h create mode 100644 include/clang/Analysis/PathSensitive/GRState.h create mode 100644 include/clang/Analysis/PathSensitive/GRStateTrait.h create mode 100644 include/clang/Analysis/PathSensitive/GRTransferFuncs.h create mode 100644 include/clang/Analysis/PathSensitive/GRWorkList.h create mode 100644 include/clang/Analysis/PathSensitive/MemRegion.h create mode 100644 include/clang/Analysis/PathSensitive/SVals.h create mode 100644 include/clang/Analysis/PathSensitive/Store.h create mode 100644 include/clang/Analysis/PathSensitive/SymbolManager.h create mode 100644 include/clang/Analysis/PathSensitive/ValueManager.h create mode 100644 include/clang/Analysis/ProgramPoint.h create mode 100644 include/clang/Analysis/Support/BlkExprDeclBitVector.h create mode 100644 include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h create mode 100644 include/clang/Analysis/Visitors/CFGRecStmtVisitor.h create mode 100644 include/clang/Analysis/Visitors/CFGStmtVisitor.h create mode 100644 include/clang/Analysis/Visitors/CFGVarDeclVisitor.h create mode 100644 include/clang/Basic/CMakeLists.txt create mode 100644 include/clang/Basic/ConvertUTF.h create mode 100644 include/clang/Basic/Diagnostic.h create mode 100644 include/clang/Basic/Diagnostic.td create mode 100644 include/clang/Basic/DiagnosticASTKinds.td create mode 100644 include/clang/Basic/DiagnosticAnalysisKinds.td create mode 100644 include/clang/Basic/DiagnosticCommonKinds.td create mode 100644 include/clang/Basic/DiagnosticDriverKinds.td create mode 100644 include/clang/Basic/DiagnosticFrontendKinds.td create mode 100644 include/clang/Basic/DiagnosticGroups.td create mode 100644 include/clang/Basic/DiagnosticLexKinds.td create mode 100644 include/clang/Basic/DiagnosticParseKinds.td create mode 100644 include/clang/Basic/DiagnosticSemaKinds.td create mode 100644 include/clang/Basic/FileManager.h create mode 100644 include/clang/Basic/IdentifierTable.h create mode 100644 include/clang/Basic/LangOptions.h create mode 100644 include/clang/Basic/Makefile create mode 100644 include/clang/Basic/OnDiskHashTable.h create mode 100644 include/clang/Basic/OperatorKinds.def create mode 100644 include/clang/Basic/OperatorKinds.h create mode 100644 include/clang/Basic/PrettyStackTrace.h create mode 100644 include/clang/Basic/SourceLocation.h create mode 100644 include/clang/Basic/SourceManager.h create mode 100644 include/clang/Basic/SourceManagerInternals.h create mode 100644 include/clang/Basic/TargetInfo.h create mode 100644 include/clang/Basic/TemplateKinds.h create mode 100644 include/clang/Basic/TokenKinds.def create mode 100644 include/clang/Basic/TokenKinds.h create mode 100644 include/clang/Basic/TypeTraits.h create mode 100644 include/clang/Basic/Version.h create mode 100644 include/clang/CMakeLists.txt create mode 100644 include/clang/CodeGen/ModuleBuilder.h create mode 100644 include/clang/Driver/Action.h create mode 100644 include/clang/Driver/Arg.h create mode 100644 include/clang/Driver/ArgList.h create mode 100644 include/clang/Driver/Compilation.h create mode 100644 include/clang/Driver/Driver.h create mode 100644 include/clang/Driver/DriverDiagnostic.h create mode 100644 include/clang/Driver/HostInfo.h create mode 100644 include/clang/Driver/Job.h create mode 100644 include/clang/Driver/Option.h create mode 100644 include/clang/Driver/Options.def create mode 100644 include/clang/Driver/Options.h create mode 100644 include/clang/Driver/Phases.h create mode 100644 include/clang/Driver/Tool.h create mode 100644 include/clang/Driver/ToolChain.h create mode 100644 include/clang/Driver/Types.def create mode 100644 include/clang/Driver/Types.h create mode 100644 include/clang/Driver/Util.h create mode 100644 include/clang/Frontend/ASTConsumers.h create mode 100644 include/clang/Frontend/Analyses.def create mode 100644 include/clang/Frontend/AnalysisConsumer.h create mode 100644 include/clang/Frontend/CompileOptions.h create mode 100644 include/clang/Frontend/DocumentXML.h create mode 100644 include/clang/Frontend/FixItRewriter.h create mode 100644 include/clang/Frontend/FrontendDiagnostic.h create mode 100644 include/clang/Frontend/InitHeaderSearch.h create mode 100644 include/clang/Frontend/InitPreprocessor.h create mode 100644 include/clang/Frontend/ManagerRegistry.h create mode 100644 include/clang/Frontend/PCHBitCodes.h create mode 100644 include/clang/Frontend/PCHReader.h create mode 100644 include/clang/Frontend/PCHWriter.h create mode 100644 include/clang/Frontend/PathDiagnosticClients.h create mode 100644 include/clang/Frontend/TextDiagnosticBuffer.h create mode 100644 include/clang/Frontend/TextDiagnosticPrinter.h create mode 100644 include/clang/Frontend/Utils.h create mode 100644 include/clang/Lex/DirectoryLookup.h create mode 100644 include/clang/Lex/HeaderMap.h create mode 100644 include/clang/Lex/HeaderSearch.h create mode 100644 include/clang/Lex/LexDiagnostic.h create mode 100644 include/clang/Lex/Lexer.h create mode 100644 include/clang/Lex/LiteralSupport.h create mode 100644 include/clang/Lex/MacroInfo.h create mode 100644 include/clang/Lex/MultipleIncludeOpt.h create mode 100644 include/clang/Lex/PPCallbacks.h create mode 100644 include/clang/Lex/PTHLexer.h create mode 100644 include/clang/Lex/PTHManager.h create mode 100644 include/clang/Lex/Pragma.h create mode 100644 include/clang/Lex/Preprocessor.h create mode 100644 include/clang/Lex/PreprocessorLexer.h create mode 100644 include/clang/Lex/ScratchBuffer.h create mode 100644 include/clang/Lex/Token.h create mode 100644 include/clang/Lex/TokenConcatenation.h create mode 100644 include/clang/Lex/TokenLexer.h create mode 100644 include/clang/Makefile create mode 100644 include/clang/Parse/AccessSpecifier.h create mode 100644 include/clang/Parse/Action.h create mode 100644 include/clang/Parse/AttributeList.h create mode 100644 include/clang/Parse/DeclSpec.h create mode 100644 include/clang/Parse/Designator.h create mode 100644 include/clang/Parse/Ownership.h create mode 100644 include/clang/Parse/ParseDiagnostic.h create mode 100644 include/clang/Parse/Parser.h create mode 100644 include/clang/Parse/Scope.h create mode 100644 include/clang/Rewrite/DeltaTree.h create mode 100644 include/clang/Rewrite/HTMLRewrite.h create mode 100644 include/clang/Rewrite/RewriteRope.h create mode 100644 include/clang/Rewrite/Rewriter.h create mode 100644 include/clang/Rewrite/TokenRewriter.h create mode 100644 include/clang/Sema/ExternalSemaSource.h create mode 100644 include/clang/Sema/ParseAST.h create mode 100644 include/clang/Sema/SemaConsumer.h create mode 100644 include/clang/Sema/SemaDiagnostic.h create mode 100644 lib/AST/APValue.cpp create mode 100644 lib/AST/ASTConsumer.cpp create mode 100644 lib/AST/ASTContext.cpp create mode 100644 lib/AST/Builtins.cpp create mode 100644 lib/AST/CFG.cpp create mode 100644 lib/AST/CMakeLists.txt create mode 100644 lib/AST/Decl.cpp create mode 100644 lib/AST/DeclBase.cpp create mode 100644 lib/AST/DeclCXX.cpp create mode 100644 lib/AST/DeclGroup.cpp create mode 100644 lib/AST/DeclObjC.cpp create mode 100644 lib/AST/DeclPrinter.cpp create mode 100644 lib/AST/DeclTemplate.cpp create mode 100644 lib/AST/DeclarationName.cpp create mode 100644 lib/AST/Expr.cpp create mode 100644 lib/AST/ExprCXX.cpp create mode 100644 lib/AST/ExprConstant.cpp create mode 100644 lib/AST/InheritViz.cpp create mode 100644 lib/AST/Makefile create mode 100644 lib/AST/NestedNameSpecifier.cpp create mode 100644 lib/AST/ParentMap.cpp create mode 100644 lib/AST/Stmt.cpp create mode 100644 lib/AST/StmtDumper.cpp create mode 100644 lib/AST/StmtIterator.cpp create mode 100644 lib/AST/StmtPrinter.cpp create mode 100644 lib/AST/StmtViz.cpp create mode 100644 lib/AST/TemplateName.cpp create mode 100644 lib/AST/Type.cpp create mode 100644 lib/Analysis/BasicConstraintManager.cpp create mode 100644 lib/Analysis/BasicObjCFoundationChecks.cpp create mode 100644 lib/Analysis/BasicObjCFoundationChecks.h create mode 100644 lib/Analysis/BasicStore.cpp create mode 100644 lib/Analysis/BasicValueFactory.cpp create mode 100644 lib/Analysis/BugReporter.cpp create mode 100644 lib/Analysis/CFRefCount.cpp create mode 100644 lib/Analysis/CMakeLists.txt create mode 100644 lib/Analysis/CheckDeadStores.cpp create mode 100644 lib/Analysis/CheckNSError.cpp create mode 100644 lib/Analysis/CheckObjCDealloc.cpp create mode 100644 lib/Analysis/CheckObjCInstMethSignature.cpp create mode 100644 lib/Analysis/CheckObjCUnusedIVars.cpp create mode 100644 lib/Analysis/Environment.cpp create mode 100644 lib/Analysis/ExplodedGraph.cpp create mode 100644 lib/Analysis/GRBlockCounter.cpp create mode 100644 lib/Analysis/GRCoreEngine.cpp create mode 100644 lib/Analysis/GRExprEngine.cpp create mode 100644 lib/Analysis/GRExprEngineInternalChecks.cpp create mode 100644 lib/Analysis/GRSimpleVals.cpp create mode 100644 lib/Analysis/GRSimpleVals.h create mode 100644 lib/Analysis/GRState.cpp create mode 100644 lib/Analysis/GRTransferFuncs.cpp create mode 100644 lib/Analysis/LiveVariables.cpp create mode 100644 lib/Analysis/Makefile create mode 100644 lib/Analysis/MemRegion.cpp create mode 100644 lib/Analysis/PathDiagnostic.cpp create mode 100644 lib/Analysis/RangeConstraintManager.cpp create mode 100644 lib/Analysis/RegionStore.cpp create mode 100644 lib/Analysis/SVals.cpp create mode 100644 lib/Analysis/SimpleConstraintManager.cpp create mode 100644 lib/Analysis/SimpleConstraintManager.h create mode 100644 lib/Analysis/Store.cpp create mode 100644 lib/Analysis/SymbolManager.cpp create mode 100644 lib/Analysis/UninitializedValues.cpp create mode 100644 lib/Basic/CMakeLists.txt create mode 100644 lib/Basic/ConvertUTF.c create mode 100644 lib/Basic/Diagnostic.cpp create mode 100644 lib/Basic/FileManager.cpp create mode 100644 lib/Basic/IdentifierTable.cpp create mode 100644 lib/Basic/Makefile create mode 100644 lib/Basic/SourceLocation.cpp create mode 100644 lib/Basic/SourceManager.cpp create mode 100644 lib/Basic/TargetInfo.cpp create mode 100644 lib/Basic/Targets.cpp create mode 100644 lib/Basic/TokenKinds.cpp create mode 100644 lib/CMakeLists.txt create mode 100644 lib/CodeGen/ABIInfo.h create mode 100644 lib/CodeGen/CGBlocks.cpp create mode 100644 lib/CodeGen/CGBlocks.h create mode 100644 lib/CodeGen/CGBuilder.h create mode 100644 lib/CodeGen/CGBuiltin.cpp create mode 100644 lib/CodeGen/CGCXX.cpp create mode 100644 lib/CodeGen/CGCXX.h create mode 100644 lib/CodeGen/CGCall.cpp create mode 100644 lib/CodeGen/CGCall.h create mode 100644 lib/CodeGen/CGDebugInfo.cpp create mode 100644 lib/CodeGen/CGDebugInfo.h create mode 100644 lib/CodeGen/CGDecl.cpp create mode 100644 lib/CodeGen/CGExpr.cpp create mode 100644 lib/CodeGen/CGExprAgg.cpp create mode 100644 lib/CodeGen/CGExprComplex.cpp create mode 100644 lib/CodeGen/CGExprConstant.cpp create mode 100644 lib/CodeGen/CGExprScalar.cpp create mode 100644 lib/CodeGen/CGObjC.cpp create mode 100644 lib/CodeGen/CGObjCGNU.cpp create mode 100644 lib/CodeGen/CGObjCMac.cpp create mode 100644 lib/CodeGen/CGObjCRuntime.h create mode 100644 lib/CodeGen/CGStmt.cpp create mode 100644 lib/CodeGen/CGValue.h create mode 100644 lib/CodeGen/CMakeLists.txt create mode 100644 lib/CodeGen/CodeGenFunction.cpp create mode 100644 lib/CodeGen/CodeGenFunction.h create mode 100644 lib/CodeGen/CodeGenModule.cpp create mode 100644 lib/CodeGen/CodeGenModule.h create mode 100644 lib/CodeGen/CodeGenTypes.cpp create mode 100644 lib/CodeGen/CodeGenTypes.h create mode 100644 lib/CodeGen/Makefile create mode 100644 lib/CodeGen/Mangle.cpp create mode 100644 lib/CodeGen/Mangle.h create mode 100644 lib/CodeGen/ModuleBuilder.cpp create mode 100644 lib/CodeGen/README.txt create mode 100644 lib/Driver/Action.cpp create mode 100644 lib/Driver/Arg.cpp create mode 100644 lib/Driver/ArgList.cpp create mode 100644 lib/Driver/CMakeLists.txt create mode 100644 lib/Driver/Compilation.cpp create mode 100644 lib/Driver/Driver.cpp create mode 100644 lib/Driver/HostInfo.cpp create mode 100644 lib/Driver/InputInfo.h create mode 100644 lib/Driver/Job.cpp create mode 100644 lib/Driver/Makefile create mode 100644 lib/Driver/OptTable.cpp create mode 100644 lib/Driver/Option.cpp create mode 100644 lib/Driver/Phases.cpp create mode 100644 lib/Driver/Tool.cpp create mode 100644 lib/Driver/ToolChain.cpp create mode 100644 lib/Driver/ToolChains.cpp create mode 100644 lib/Driver/ToolChains.h create mode 100644 lib/Driver/Tools.cpp create mode 100644 lib/Driver/Tools.h create mode 100644 lib/Driver/Types.cpp create mode 100644 lib/Frontend/ASTConsumers.cpp create mode 100644 lib/Frontend/AnalysisConsumer.cpp create mode 100644 lib/Frontend/Backend.cpp create mode 100644 lib/Frontend/CMakeLists.txt create mode 100644 lib/Frontend/CacheTokens.cpp create mode 100644 lib/Frontend/DependencyFile.cpp create mode 100644 lib/Frontend/DiagChecker.cpp create mode 100644 lib/Frontend/DocumentXML.cpp create mode 100644 lib/Frontend/FixItRewriter.cpp create mode 100644 lib/Frontend/GeneratePCH.cpp create mode 100644 lib/Frontend/HTMLDiagnostics.cpp create mode 100644 lib/Frontend/HTMLPrint.cpp create mode 100644 lib/Frontend/InitHeaderSearch.cpp create mode 100644 lib/Frontend/InitPreprocessor.cpp create mode 100644 lib/Frontend/Makefile create mode 100644 lib/Frontend/ManagerRegistry.cpp create mode 100644 lib/Frontend/PCHReader.cpp create mode 100644 lib/Frontend/PCHReaderDecl.cpp create mode 100644 lib/Frontend/PCHReaderStmt.cpp create mode 100644 lib/Frontend/PCHWriter.cpp create mode 100644 lib/Frontend/PCHWriterDecl.cpp create mode 100644 lib/Frontend/PCHWriterStmt.cpp create mode 100644 lib/Frontend/PlistDiagnostics.cpp create mode 100644 lib/Frontend/PrintParserCallbacks.cpp create mode 100644 lib/Frontend/PrintPreprocessedOutput.cpp create mode 100644 lib/Frontend/RewriteBlocks.cpp create mode 100644 lib/Frontend/RewriteMacros.cpp create mode 100644 lib/Frontend/RewriteObjC.cpp create mode 100644 lib/Frontend/RewriteTest.cpp create mode 100644 lib/Frontend/StmtXML.cpp create mode 100644 lib/Frontend/TextDiagnosticBuffer.cpp create mode 100644 lib/Frontend/TextDiagnosticPrinter.cpp create mode 100644 lib/Frontend/Warnings.cpp create mode 100644 lib/Headers/CMakeLists.txt create mode 100644 lib/Headers/Makefile create mode 100644 lib/Headers/emmintrin.h create mode 100644 lib/Headers/float.h create mode 100644 lib/Headers/iso646.h create mode 100644 lib/Headers/limits.h create mode 100644 lib/Headers/mm_malloc.h create mode 100644 lib/Headers/mmintrin.h create mode 100644 lib/Headers/pmmintrin.h create mode 100644 lib/Headers/stdarg.h create mode 100644 lib/Headers/stdbool.h create mode 100644 lib/Headers/stddef.h create mode 100644 lib/Headers/stdint.h create mode 100644 lib/Headers/tgmath.h create mode 100644 lib/Headers/tmmintrin.h create mode 100644 lib/Headers/xmmintrin.h create mode 100644 lib/Lex/CMakeLists.txt create mode 100644 lib/Lex/HeaderMap.cpp create mode 100644 lib/Lex/HeaderSearch.cpp create mode 100644 lib/Lex/Lexer.cpp create mode 100644 lib/Lex/LiteralSupport.cpp create mode 100644 lib/Lex/MacroArgs.cpp create mode 100644 lib/Lex/MacroArgs.h create mode 100644 lib/Lex/MacroInfo.cpp create mode 100644 lib/Lex/Makefile create mode 100644 lib/Lex/PPCaching.cpp create mode 100644 lib/Lex/PPDirectives.cpp create mode 100644 lib/Lex/PPExpressions.cpp create mode 100644 lib/Lex/PPLexerChange.cpp create mode 100644 lib/Lex/PPMacroExpansion.cpp create mode 100644 lib/Lex/PTHLexer.cpp create mode 100644 lib/Lex/Pragma.cpp create mode 100644 lib/Lex/Preprocessor.cpp create mode 100644 lib/Lex/PreprocessorLexer.cpp create mode 100644 lib/Lex/ScratchBuffer.cpp create mode 100644 lib/Lex/TokenConcatenation.cpp create mode 100644 lib/Lex/TokenLexer.cpp create mode 100755 lib/Makefile create mode 100644 lib/Parse/AttributeList.cpp create mode 100644 lib/Parse/CMakeLists.txt create mode 100644 lib/Parse/DeclSpec.cpp create mode 100644 lib/Parse/ExtensionRAIIObject.h create mode 100644 lib/Parse/Makefile create mode 100644 lib/Parse/MinimalAction.cpp create mode 100644 lib/Parse/ParseCXXInlineMethods.cpp create mode 100644 lib/Parse/ParseDecl.cpp create mode 100644 lib/Parse/ParseDeclCXX.cpp create mode 100644 lib/Parse/ParseExpr.cpp create mode 100644 lib/Parse/ParseExprCXX.cpp create mode 100644 lib/Parse/ParseInit.cpp create mode 100644 lib/Parse/ParseObjc.cpp create mode 100644 lib/Parse/ParsePragma.cpp create mode 100644 lib/Parse/ParsePragma.h create mode 100644 lib/Parse/ParseStmt.cpp create mode 100644 lib/Parse/ParseTemplate.cpp create mode 100644 lib/Parse/ParseTentative.cpp create mode 100644 lib/Parse/Parser.cpp create mode 100644 lib/Rewrite/CMakeLists.txt create mode 100644 lib/Rewrite/DeltaTree.cpp create mode 100644 lib/Rewrite/HTMLRewrite.cpp create mode 100644 lib/Rewrite/Makefile create mode 100644 lib/Rewrite/RewriteRope.cpp create mode 100644 lib/Rewrite/Rewriter.cpp create mode 100644 lib/Rewrite/TokenRewriter.cpp create mode 100644 lib/Sema/CMakeLists.txt create mode 100644 lib/Sema/CXXFieldCollector.h create mode 100644 lib/Sema/IdentifierResolver.cpp create mode 100644 lib/Sema/IdentifierResolver.h create mode 100644 lib/Sema/JumpDiagnostics.cpp create mode 100644 lib/Sema/Makefile create mode 100644 lib/Sema/ParseAST.cpp create mode 100644 lib/Sema/Sema.cpp create mode 100644 lib/Sema/Sema.h create mode 100644 lib/Sema/SemaAccess.cpp create mode 100644 lib/Sema/SemaAttr.cpp create mode 100644 lib/Sema/SemaCXXScopeSpec.cpp create mode 100644 lib/Sema/SemaChecking.cpp create mode 100644 lib/Sema/SemaDecl.cpp create mode 100644 lib/Sema/SemaDeclAttr.cpp create mode 100644 lib/Sema/SemaDeclCXX.cpp create mode 100644 lib/Sema/SemaDeclObjC.cpp create mode 100644 lib/Sema/SemaExpr.cpp create mode 100644 lib/Sema/SemaExprCXX.cpp create mode 100644 lib/Sema/SemaExprObjC.cpp create mode 100644 lib/Sema/SemaInherit.cpp create mode 100644 lib/Sema/SemaInherit.h create mode 100644 lib/Sema/SemaInit.cpp create mode 100644 lib/Sema/SemaLookup.cpp create mode 100644 lib/Sema/SemaNamedCast.cpp create mode 100644 lib/Sema/SemaOverload.cpp create mode 100644 lib/Sema/SemaOverload.h create mode 100644 lib/Sema/SemaStmt.cpp create mode 100644 lib/Sema/SemaTemplate.cpp create mode 100644 lib/Sema/SemaTemplateInstantiate.cpp create mode 100644 lib/Sema/SemaTemplateInstantiateDecl.cpp create mode 100644 lib/Sema/SemaTemplateInstantiateExpr.cpp create mode 100644 lib/Sema/SemaTemplateInstantiateStmt.cpp create mode 100644 lib/Sema/SemaType.cpp create mode 100644 test/Analysis/CFDateGC.m create mode 100644 test/Analysis/CFNumber.c create mode 100644 test/Analysis/CFRetainRelease_NSAssertionHandler.m create mode 100644 test/Analysis/CGColorSpace.c create mode 100644 test/Analysis/CheckNSError.m create mode 100644 test/Analysis/MissingDealloc.m create mode 100644 test/Analysis/NSPanel.m create mode 100644 test/Analysis/NSString.m create mode 100644 test/Analysis/NSWindow.m create mode 100644 test/Analysis/NoReturn.m create mode 100644 test/Analysis/ObjCProperties.m create mode 100644 test/Analysis/ObjCRetSigs.m create mode 100644 test/Analysis/PR2599.m create mode 100644 test/Analysis/PR2978.m create mode 100644 test/Analysis/PR3991.m create mode 100644 test/Analysis/array-struct.c create mode 100644 test/Analysis/basicstore_wine_crash.c create mode 100644 test/Analysis/casts.c create mode 100644 test/Analysis/casts.m create mode 100644 test/Analysis/cfref_PR2519.c create mode 100644 test/Analysis/cfref_rdar6080742.c create mode 100644 test/Analysis/complex.c create mode 100644 test/Analysis/conditional-op-missing-lhs.c create mode 100644 test/Analysis/dead-stores.c create mode 100644 test/Analysis/dead-stores.m create mode 100644 test/Analysis/delegates.m create mode 100644 test/Analysis/exercise-ps.c create mode 100644 test/Analysis/fields.c create mode 100644 test/Analysis/func.c create mode 100644 test/Analysis/misc-ps-64.m create mode 100644 test/Analysis/misc-ps-basic-store.m create mode 100644 test/Analysis/misc-ps-eager-assume.m create mode 100644 test/Analysis/misc-ps-ranges.m create mode 100644 test/Analysis/misc-ps-region-store.m create mode 100644 test/Analysis/misc-ps.m create mode 100644 test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m create mode 100644 test/Analysis/no-exit-cfg.c create mode 100644 test/Analysis/no-outofbounds-basicstore.c create mode 100644 test/Analysis/null-deref-ps-region.c create mode 100644 test/Analysis/null-deref-ps.c create mode 100644 test/Analysis/outofbound.c create mode 100644 test/Analysis/override-werror.c create mode 100644 test/Analysis/pr4209.m create mode 100644 test/Analysis/pr_2542_rdar_6793404.m create mode 100644 test/Analysis/pr_4164.c create mode 100644 test/Analysis/ptr-arith.c create mode 100644 test/Analysis/rdar-6442306-1.m create mode 100644 test/Analysis/rdar-6539791.c create mode 100644 test/Analysis/rdar-6540084.m create mode 100644 test/Analysis/rdar-6541136-region.c create mode 100644 test/Analysis/rdar-6541136.c create mode 100644 test/Analysis/rdar-6562655.m create mode 100644 test/Analysis/rdar-6582778-basic-store.c create mode 100644 test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m create mode 100644 test/Analysis/refcnt_naming.m create mode 100644 test/Analysis/region-1.m create mode 100644 test/Analysis/region-only-test.c create mode 100644 test/Analysis/retain-release-basic-store.m create mode 100644 test/Analysis/retain-release-gc-only.m create mode 100644 test/Analysis/retain-release-region-store.m create mode 100644 test/Analysis/retain-release.m create mode 100644 test/Analysis/stack-addr-ps.c create mode 100644 test/Analysis/uninit-msg-expr.m create mode 100644 test/Analysis/uninit-ps-rdar6145427.m create mode 100644 test/Analysis/uninit-vals-ps-region.c create mode 100644 test/Analysis/uninit-vals-ps.c create mode 100644 test/Analysis/uninit-vals.c create mode 100644 test/Analysis/uninit-vals.m create mode 100644 test/Analysis/unused-ivars.m create mode 100644 test/Analysis/xfail-no-outofbounds.c create mode 100644 test/Analysis/xfail_regionstore_wine_crash.c create mode 100644 test/CodeGen/2007-11-29-ArraySizeFromInitializer.c create mode 100644 test/CodeGen/2008-02-07-bitfield-bug.c create mode 100644 test/CodeGen/2008-02-08-bitfield-bug.c create mode 100644 test/CodeGen/2008-02-26-inline-asm-bug.c create mode 100644 test/CodeGen/2008-07-17-no-emit-on-error.c create mode 100644 test/CodeGen/2008-07-21-mixed-var-fn-decl.c create mode 100644 test/CodeGen/2008-07-22-bitfield-init-after-zero-len-array.c create mode 100644 test/CodeGen/2008-07-22-packed-bitfield-access.c create mode 100644 test/CodeGen/2008-07-29-override-alias-decl.c create mode 100644 test/CodeGen/2008-07-30-implicit-initialization.c create mode 100644 test/CodeGen/2008-07-30-redef-of-bitcasted-decl.c create mode 100644 test/CodeGen/2008-07-31-asm-labels.c create mode 100644 test/CodeGen/2008-07-31-promotion-of-compound-pointer-arithmetic.c create mode 100644 test/CodeGen/2008-08-04-void-pointer-arithmetic.c create mode 100644 test/CodeGen/2008-08-19-cast-of-typedef.c create mode 100644 test/CodeGen/2008-08-25-incompatible-cond-expr.m create mode 100644 test/CodeGen/2008-09-22-bad-switch-type.c create mode 100644 test/CodeGen/2008-12-02-logical-or-fold.c create mode 100644 test/CodeGen/2009-01-21-invalid-debug-info.m create mode 100644 test/CodeGen/2009-03-22-increment-bitfield.c create mode 100644 test/CodeGen/2009-04-23-dbg.c create mode 100644 test/CodeGen/2009-05-22-callingconv.c create mode 100644 test/CodeGen/2009-05-28-const-typedef.c create mode 100644 test/CodeGen/2009-06-01-addrofknr.c create mode 100644 test/CodeGen/OpaqueStruct.c create mode 100644 test/CodeGen/PR2001-bitfield-reload.c create mode 100644 test/CodeGen/PR2413-void-address-cast-error.c create mode 100644 test/CodeGen/PR2643-null-store-to-bitfield.c create mode 100644 test/CodeGen/PR2743-reference-missing-static.c create mode 100644 test/CodeGen/PR3130-cond-constant.c create mode 100644 test/CodeGen/PR3589-freestanding-libcalls.c create mode 100644 test/CodeGen/PR3613-static-decl.c create mode 100644 test/CodeGen/PR3709-int-to-pointer-sign.c create mode 100644 test/CodeGen/PR3869-indirect-goto-long.c create mode 100644 test/CodeGen/address-space-cast.c create mode 100644 test/CodeGen/address-space.c create mode 100644 test/CodeGen/alias.c create mode 100644 test/CodeGen/align-local.c create mode 100644 test/CodeGen/alignof.c create mode 100644 test/CodeGen/array.c create mode 100644 test/CodeGen/asm-2.c create mode 100644 test/CodeGen/asm.c create mode 100644 test/CodeGen/atomic.c create mode 100644 test/CodeGen/attr-cleanup.c create mode 100644 test/CodeGen/attr-nodebug.c create mode 100644 test/CodeGen/attr-noinline.c create mode 100644 test/CodeGen/attr-used.c create mode 100644 test/CodeGen/attributes.c create mode 100644 test/CodeGen/bitfield-assign.c create mode 100644 test/CodeGen/bitfield-init.c create mode 100644 test/CodeGen/bitfield-promote.c create mode 100644 test/CodeGen/bitfield.c create mode 100644 test/CodeGen/blocks-1.c create mode 100644 test/CodeGen/blocks-2.c create mode 100644 test/CodeGen/blocks-seq.c create mode 100644 test/CodeGen/blocks.c create mode 100644 test/CodeGen/bool-bitfield.c create mode 100644 test/CodeGen/bool-convert.c create mode 100644 test/CodeGen/bool-init.c create mode 100644 test/CodeGen/boolassign.c create mode 100644 test/CodeGen/builtin-count-zeros.c create mode 100644 test/CodeGen/builtin-memfns.c create mode 100644 test/CodeGen/builtin-nanf.c create mode 100644 test/CodeGen/builtin-rename.c create mode 100644 test/CodeGen/builtin-stackaddress.c create mode 100644 test/CodeGen/builtin-unwind-init.c create mode 100644 test/CodeGen/builtinmemcpy.c create mode 100644 test/CodeGen/builtins-ffs_parity_popcount.c create mode 100644 test/CodeGen/builtins-powi.c create mode 100644 test/CodeGen/builtins-x86.c create mode 100644 test/CodeGen/builtins.c create mode 100644 test/CodeGen/builtinshufflevector.c create mode 100644 test/CodeGen/c-strings.c create mode 100644 test/CodeGen/cast-to-union.c create mode 100644 test/CodeGen/cast.c create mode 100644 test/CodeGen/cfstring.c create mode 100644 test/CodeGen/cfstring2.c create mode 100644 test/CodeGen/cleanup-stack.c create mode 100644 test/CodeGen/complex.c create mode 100644 test/CodeGen/compound-literal.c create mode 100644 test/CodeGen/compound-type.c create mode 100644 test/CodeGen/compound.c create mode 100644 test/CodeGen/conditional-gnu-ext.c create mode 100644 test/CodeGen/conditional.c create mode 100644 test/CodeGen/const-init.c create mode 100644 test/CodeGen/const-label-addr.c create mode 100644 test/CodeGen/constant-comparison.c create mode 100644 test/CodeGen/constructor-attribute.c create mode 100644 test/CodeGen/cxx-condition.cpp create mode 100644 test/CodeGen/cxx-default-arg.cpp create mode 100644 test/CodeGen/cxx-value-init.cpp create mode 100644 test/CodeGen/darwin-string-literals.c create mode 100644 test/CodeGen/debug-info.c create mode 100644 test/CodeGen/designated-initializers.c create mode 100644 test/CodeGen/dllimport-dllexport.c create mode 100644 test/CodeGen/dostmt.c create mode 100644 test/CodeGen/emit-all-decls.c create mode 100644 test/CodeGen/empty-union-init.c create mode 100644 test/CodeGen/enum.c create mode 100644 test/CodeGen/exprs.c create mode 100644 test/CodeGen/ext-vector-shuffle.c create mode 100644 test/CodeGen/ext-vector.c create mode 100644 test/CodeGen/extern-block-var.c create mode 100644 test/CodeGen/flexible-array-init.c create mode 100644 test/CodeGen/func-decl-cleanup.c create mode 100644 test/CodeGen/func-return-member.c create mode 100644 test/CodeGen/function-attributes.c create mode 100644 test/CodeGen/function-decay.m create mode 100644 test/CodeGen/functions.c create mode 100644 test/CodeGen/global-decls.c create mode 100644 test/CodeGen/global-init.c create mode 100644 test/CodeGen/global-with-initialiser.c create mode 100644 test/CodeGen/globalinit.c create mode 100644 test/CodeGen/illegal-UTF8.m create mode 100644 test/CodeGen/incomplete-function-type.c create mode 100644 test/CodeGen/indirect-goto.c create mode 100644 test/CodeGen/init-with-member-expr.c create mode 100644 test/CodeGen/init.c create mode 100644 test/CodeGen/inline.c create mode 100644 test/CodeGen/int-to-pointer.c create mode 100644 test/CodeGen/kr-func-promote.c create mode 100644 test/CodeGen/kr-style-block.c create mode 100644 test/CodeGen/libcalls.c create mode 100644 test/CodeGen/lineno-dbginfo.c create mode 100644 test/CodeGen/linkage-redecl.c create mode 100644 test/CodeGen/long-double-x86.c create mode 100644 test/CodeGen/mandel.c create mode 100644 test/CodeGen/mangle.c create mode 100644 test/CodeGen/merge-attrs.c create mode 100644 test/CodeGen/merge-statics.c create mode 100644 test/CodeGen/mmintrin-test.c create mode 100644 test/CodeGen/no-common.c create mode 100644 test/CodeGen/offsetof.c create mode 100644 test/CodeGen/opaque-pointer.c create mode 100644 test/CodeGen/overloadable.c create mode 100644 test/CodeGen/parameter-passing.c create mode 100644 test/CodeGen/pascal-string.c create mode 100644 test/CodeGen/pointer-arithmetic.c create mode 100644 test/CodeGen/pointer-cmp-type.c create mode 100644 test/CodeGen/pointer-to-int.c create mode 100644 test/CodeGen/private-extern.c create mode 100644 test/CodeGen/rdr-6098585-default-after-caserange.c create mode 100644 test/CodeGen/rdr-6098585-default-fallthrough-to-caserange.c create mode 100644 test/CodeGen/rdr-6098585-empty-case-range.c create mode 100644 test/CodeGen/rdr-6098585-fallthrough-to-empty-range.c create mode 100644 test/CodeGen/rdr-6098585-unsigned-caserange.c create mode 100644 test/CodeGen/rdr-6732143-dangling-block-reference.m create mode 100644 test/CodeGen/regparm.c create mode 100644 test/CodeGen/shared-string-literals.c create mode 100644 test/CodeGen/sizeof-vla.c create mode 100644 test/CodeGen/statements.c create mode 100644 test/CodeGen/static-forward-decl-fun.c create mode 100644 test/CodeGen/static-forward-decl.c create mode 100644 test/CodeGen/static-local-union.c create mode 100644 test/CodeGen/static-order.c create mode 100644 test/CodeGen/staticinit.c create mode 100644 test/CodeGen/stdcall-fastcall.c create mode 100644 test/CodeGen/string-init.c create mode 100644 test/CodeGen/string-literal.c create mode 100644 test/CodeGen/struct-comma.c create mode 100644 test/CodeGen/struct-copy.c create mode 100644 test/CodeGen/struct-init.c create mode 100644 test/CodeGen/struct-passing.c create mode 100644 test/CodeGen/struct-x86-darwin.c create mode 100644 test/CodeGen/struct.c create mode 100644 test/CodeGen/switch.c create mode 100644 test/CodeGen/tentative-decls.c create mode 100644 test/CodeGen/thread-specifier.c create mode 100644 test/CodeGen/trapv.c create mode 100644 test/CodeGen/typedef-func.c create mode 100644 test/CodeGen/typedef.c create mode 100644 test/CodeGen/types.c create mode 100644 test/CodeGen/uint128_t.c create mode 100644 test/CodeGen/union-init.c create mode 100644 test/CodeGen/union.c create mode 100644 test/CodeGen/unwind-attr.c create mode 100644 test/CodeGen/var-align.c create mode 100644 test/CodeGen/variable-array.c create mode 100644 test/CodeGen/vector.c create mode 100644 test/CodeGen/visibility.c create mode 100644 test/CodeGen/vla.c create mode 100644 test/CodeGen/volatile-1.c create mode 100644 test/CodeGen/volatile.c create mode 100644 test/CodeGen/weak-global.c create mode 100644 test/CodeGen/weak-incomplete.c create mode 100644 test/CodeGen/whilestmt.c create mode 100644 test/CodeGen/writable-strings.c create mode 100644 test/CodeGen/x86.c create mode 100644 test/CodeGen/x86_32-arguments.c create mode 100644 test/CodeGen/x86_64-arguments.c create mode 100644 test/CodeGenCXX/__null.cpp create mode 100644 test/CodeGenCXX/const-init.cpp create mode 100644 test/CodeGenCXX/explicit-instantiation.cpp create mode 100644 test/CodeGenCXX/expr.cpp create mode 100644 test/CodeGenCXX/extern-c.cpp create mode 100644 test/CodeGenCXX/mangle.cpp create mode 100644 test/CodeGenCXX/member-functions.cpp create mode 100644 test/CodeGenCXX/new.cpp create mode 100644 test/CodeGenCXX/reference-field.cpp create mode 100644 test/CodeGenCXX/references.cpp create mode 100644 test/CodeGenObjC/2008-10-23-invalid-icmp.m create mode 100644 test/CodeGenObjC/attr-strong.c create mode 100644 test/CodeGenObjC/bitfield-1.m create mode 100644 test/CodeGenObjC/bitfield-ivar-metadata.m create mode 100644 test/CodeGenObjC/bitfield-ivar-offsets.m create mode 100644 test/CodeGenObjC/blocks-1.m create mode 100644 test/CodeGenObjC/blocks-2.m create mode 100644 test/CodeGenObjC/blocks.m create mode 100644 test/CodeGenObjC/category-super-class-meth.m create mode 100644 test/CodeGenObjC/class-getter-dotsyntax.m create mode 100644 test/CodeGenObjC/class-obj-hidden-visibility.m create mode 100644 test/CodeGenObjC/class-type.m create mode 100644 test/CodeGenObjC/compatibility-alias.m create mode 100644 test/CodeGenObjC/constant-strings.m create mode 100644 test/CodeGenObjC/continuation-class.m create mode 100644 test/CodeGenObjC/debug-info.m create mode 100644 test/CodeGenObjC/dot-syntax-1.m create mode 100644 test/CodeGenObjC/dot-syntax.m create mode 100644 test/CodeGenObjC/encode-test-1.m create mode 100644 test/CodeGenObjC/encode-test-2.m create mode 100644 test/CodeGenObjC/encode-test-3.m create mode 100644 test/CodeGenObjC/encode-test-4.m create mode 100644 test/CodeGenObjC/encode-test-5.m create mode 100644 test/CodeGenObjC/encode-test.m create mode 100644 test/CodeGenObjC/forward-class-impl-metadata.m create mode 100644 test/CodeGenObjC/hidden-synthesized-ivar.m create mode 100644 test/CodeGenObjC/hidden.m create mode 100644 test/CodeGenObjC/image-info.m create mode 100644 test/CodeGenObjC/implicit-objc_msgSend.m create mode 100644 test/CodeGenObjC/implicit-property.m create mode 100644 test/CodeGenObjC/interface-layout-64.m create mode 100644 test/CodeGenObjC/interface.m create mode 100644 test/CodeGenObjC/ivar-layout-64.m create mode 100644 test/CodeGenObjC/ivars.m create mode 100644 test/CodeGenObjC/link-errors.m create mode 100644 test/CodeGenObjC/message-arrays.m create mode 100644 test/CodeGenObjC/messages-2.m create mode 100644 test/CodeGenObjC/messages.m create mode 100644 test/CodeGenObjC/metadata-symbols-32.m create mode 100644 test/CodeGenObjC/metadata-symbols-64.m create mode 100644 test/CodeGenObjC/metadata_symbols.m create mode 100644 test/CodeGenObjC/newproperty-nested-synthesis-1.m create mode 100644 test/CodeGenObjC/no-category-class.m create mode 100644 test/CodeGenObjC/non-lazy-classes.m create mode 100644 test/CodeGenObjC/objc-align.m create mode 100644 test/CodeGenObjC/objc2-assign-global.m create mode 100644 test/CodeGenObjC/objc2-no-strong-cast.m create mode 100644 test/CodeGenObjC/objc2-no-write-barrier.m create mode 100644 test/CodeGenObjC/objc2-property-encode.m create mode 100644 test/CodeGenObjC/objc2-protocol-enc.m create mode 100644 test/CodeGenObjC/objc2-retain-codegen.m create mode 100644 test/CodeGenObjC/objc2-strong-cast-1.m create mode 100644 test/CodeGenObjC/objc2-strong-cast-2.m create mode 100644 test/CodeGenObjC/objc2-strong-cast.m create mode 100644 test/CodeGenObjC/objc2-weak-compare.m create mode 100644 test/CodeGenObjC/objc2-weak-ivar.m create mode 100644 test/CodeGenObjC/overloadable.m create mode 100644 test/CodeGenObjC/predefined-expr-in-method.m create mode 100644 test/CodeGenObjC/property-aggr-type.m create mode 100644 test/CodeGenObjC/property-agrr-getter.m create mode 100644 test/CodeGenObjC/property-getter-dot-syntax.m create mode 100644 test/CodeGenObjC/property-incr-decr-1.m create mode 100644 test/CodeGenObjC/property-setter-attr.m create mode 100644 test/CodeGenObjC/property.m create mode 100644 test/CodeGenObjC/protocol-definition-hidden-visibility.m create mode 100644 test/CodeGenObjC/protocol-property-synth.m create mode 100644 test/CodeGenObjC/protocols-lazy.m create mode 100644 test/CodeGenObjC/runtime-fns.m create mode 100644 test/CodeGenObjC/super-classmethod-category.m create mode 100644 test/CodeGenObjC/super-dotsyntax-property.m create mode 100644 test/CodeGenObjC/synchronized.m create mode 100644 test/CodeGenObjC/synthesize_ivar-cont-class.m create mode 100644 test/CodeGenObjC/synthesize_ivar.m create mode 100644 test/CodeGenObjC/try.m create mode 100644 test/CodeGenObjC/unname-bf-metadata.m create mode 100644 test/Coverage/ast-printing.c create mode 100644 test/Coverage/ast-printing.cpp create mode 100644 test/Coverage/ast-printing.m create mode 100644 test/Coverage/c-language-features.inc create mode 100644 test/Coverage/codegen-gnu.m create mode 100644 test/Coverage/codegen-next.m create mode 100644 test/Coverage/codegen.c create mode 100644 test/Coverage/cxx-language-features.inc create mode 100644 test/Coverage/html-diagnostics.c create mode 100644 test/Coverage/html-print.c create mode 100644 test/Coverage/objc-language-features.inc create mode 100644 test/Coverage/parse-callbacks.c create mode 100644 test/Coverage/parse-callbacks.m create mode 100644 test/Coverage/targets.c create mode 100644 test/Coverage/verbose.c create mode 100644 test/Driver/Xarch.c create mode 100644 test/Driver/analyze.c create mode 100644 test/Driver/bindings.c create mode 100644 test/Driver/ccc-add-args.c create mode 100644 test/Driver/clang-translation.c create mode 100644 test/Driver/clang_cpp.c create mode 100644 test/Driver/clang_f_opts.c create mode 100644 test/Driver/darwin-cc.c create mode 100644 test/Driver/darwin-ld.c create mode 100644 test/Driver/darwin-version.c create mode 100644 test/Driver/dragonfly.c create mode 100644 test/Driver/emit-llvm.c create mode 100644 test/Driver/flags.c create mode 100644 test/Driver/freebsd.c create mode 100644 test/Driver/hello.c create mode 100644 test/Driver/immediate-options.c create mode 100644 test/Driver/lto.c create mode 100644 test/Driver/parsing.c create mode 100644 test/Driver/phases.c create mode 100644 test/Driver/preprocessor.c create mode 100644 test/Driver/pth.c create mode 100644 test/Driver/qa_override.c create mode 100644 test/Driver/std.c create mode 100644 test/Driver/unknown-gcc-arch.c create mode 100644 test/Driver/x86_features.c create mode 100644 test/FixIt/fixit-at.c create mode 100644 test/FixIt/fixit-c90.c create mode 100644 test/FixIt/fixit-errors-1.c create mode 100644 test/FixIt/fixit-errors.c create mode 100644 test/FixIt/fixit-objc.m create mode 100644 test/FixIt/fixit.c create mode 100644 test/FixIt/fixit.cpp create mode 100644 test/Frontend/darwin-version.c create mode 100644 test/Frontend/dependency-gen.c create mode 100644 test/Frontend/mmacosx-version-min-test.c create mode 100644 test/Frontend/rewrite-macros.c create mode 100644 test/Frontend/stdin.c create mode 100644 test/Lexer/11-27-2007-FloatLiterals.c create mode 100644 test/Lexer/badstring_in_if0.c create mode 100644 test/Lexer/block_cmt_end.c create mode 100644 test/Lexer/c90.c create mode 100644 test/Lexer/comment-escape.c create mode 100644 test/Lexer/constants.c create mode 100644 test/Lexer/counter.c create mode 100644 test/Lexer/cxx0x_keyword.cpp create mode 100644 test/Lexer/cxx0x_keyword_as_cxx98.cpp create mode 100644 test/Lexer/digraph.c create mode 100644 test/Lexer/dollar-idents.c create mode 100644 test/Lexer/escape_newline.c create mode 100644 test/Lexer/multiple-include.c create mode 100644 test/Lexer/numeric-literal-trash.c create mode 100644 test/Lexer/pragma-mark.c create mode 100644 test/Lexer/rdr-6096838-2.c create mode 100644 test/Lexer/rdr-6096838.c create mode 100644 test/Lexer/token-concat.c create mode 100644 test/Lexer/unknown-char.c create mode 100644 test/Makefile create mode 100644 test/Misc/caret-diags-macros.c create mode 100644 test/Misc/caret-diags-scratch-buffer.c create mode 100644 test/Misc/diag-checker.c create mode 100644 test/Misc/diag-mapping.c create mode 100644 test/Misc/diag-mapping2.c create mode 100644 test/Misc/emit-html-insert.c create mode 100644 test/Misc/emit-html.c create mode 100644 test/Misc/message-length.c create mode 100644 test/Misc/predefines.c create mode 100644 test/PCH/asm.c create mode 100644 test/PCH/asm.h create mode 100644 test/PCH/attrs.c create mode 100644 test/PCH/attrs.h create mode 100644 test/PCH/blocks.c create mode 100644 test/PCH/blocks.h create mode 100644 test/PCH/builtins.c create mode 100644 test/PCH/builtins.h create mode 100644 test/PCH/enum.c create mode 100644 test/PCH/enum.h create mode 100644 test/PCH/exprs.c create mode 100644 test/PCH/exprs.h create mode 100644 test/PCH/ext_vector.c create mode 100644 test/PCH/ext_vector.h create mode 100644 test/PCH/external-defs.c create mode 100644 test/PCH/external-defs.h create mode 100644 test/PCH/functions.c create mode 100644 test/PCH/functions.h create mode 100644 test/PCH/fuzzy-pch.c create mode 100644 test/PCH/fuzzy-pch.h create mode 100644 test/PCH/line-directive.c create mode 100644 test/PCH/line-directive.h create mode 100644 test/PCH/method_pool.h create mode 100644 test/PCH/method_pool.m create mode 100644 test/PCH/multiple_decls.c create mode 100644 test/PCH/multiple_decls.h create mode 100644 test/PCH/nonvisible-external-defs.c create mode 100644 test/PCH/nonvisible-external-defs.h create mode 100644 test/PCH/objc_exprs.h create mode 100644 test/PCH/objc_exprs.m create mode 100644 test/PCH/objc_import.h create mode 100644 test/PCH/objc_import.m create mode 100644 test/PCH/objc_methods.h create mode 100644 test/PCH/objc_methods.m create mode 100644 test/PCH/objc_property.h create mode 100644 test/PCH/objc_property.m create mode 100644 test/PCH/preprocess.c create mode 100644 test/PCH/preprocess.h create mode 100644 test/PCH/stmts.c create mode 100644 test/PCH/stmts.h create mode 100644 test/PCH/struct.c create mode 100644 test/PCH/struct.h create mode 100644 test/PCH/tentative-defs.c create mode 100644 test/PCH/tentative-defs.h create mode 100644 test/PCH/types.c create mode 100644 test/PCH/types.h create mode 100644 test/PCH/va_arg.c create mode 100644 test/PCH/va_arg.h create mode 100644 test/PCH/variables.c create mode 100644 test/PCH/variables.h create mode 100755 test/Parser/2008-10-31-parse-noop-failure.c create mode 100644 test/Parser/CompoundStmtScope.c create mode 100644 test/Parser/MicrosoftExtensions.c create mode 100644 test/Parser/argument_qualified.c create mode 100644 test/Parser/argument_redef.c create mode 100644 test/Parser/argument_scope.c create mode 100644 test/Parser/asm.c create mode 100644 test/Parser/attributes.c create mode 100644 test/Parser/bad-control.c create mode 100644 test/Parser/block-block-storageclass.c create mode 100644 test/Parser/block-pointer-decl.c create mode 100644 test/Parser/builtin_classify_type.c create mode 100644 test/Parser/builtin_types_compatible.c create mode 100644 test/Parser/c-namespace.c create mode 100644 test/Parser/char-literal-printing.c create mode 100644 test/Parser/check-objc2-syntax-1.m create mode 100644 test/Parser/check-syntax-1.m create mode 100644 test/Parser/check_cast.c create mode 100644 test/Parser/compound_literal.c create mode 100644 test/Parser/control-scope.c create mode 100644 test/Parser/cxx-ambig-paren-expr.cpp create mode 100644 test/Parser/cxx-bool.cpp create mode 100644 test/Parser/cxx-casting.cpp create mode 100644 test/Parser/cxx-class.cpp create mode 100644 test/Parser/cxx-condition.cpp create mode 100644 test/Parser/cxx-decl.cpp create mode 100644 test/Parser/cxx-exception-spec.cpp create mode 100644 test/Parser/cxx-friend.cpp create mode 100644 test/Parser/cxx-namespace-alias.cpp create mode 100644 test/Parser/cxx-reference.cpp create mode 100644 test/Parser/cxx-template-decl.cpp create mode 100644 test/Parser/cxx-throw.cpp create mode 100644 test/Parser/cxx-try.cpp create mode 100644 test/Parser/cxx-typeid.cpp create mode 100644 test/Parser/cxx-typeof.cpp create mode 100644 test/Parser/cxx-using-directive.cpp create mode 100644 test/Parser/cxx-variadic-func.cpp create mode 100644 test/Parser/cxx0x-rvalue-reference.cpp create mode 100644 test/Parser/declarators.c create mode 100644 test/Parser/designator.c create mode 100644 test/Parser/encode.m create mode 100644 test/Parser/enhanced-proto-1.m create mode 100644 test/Parser/expressions.c create mode 100644 test/Parser/expressions.m create mode 100644 test/Parser/extension.c create mode 100644 test/Parser/function-decls.c create mode 100644 test/Parser/goto-ident.c create mode 100644 test/Parser/if-scope-c90.c create mode 100644 test/Parser/if-scope-c99.c create mode 100644 test/Parser/implicit-casts.c create mode 100644 test/Parser/method-prototype-1.m create mode 100644 test/Parser/namelookup-bug-1.c create mode 100644 test/Parser/namelookup-bug-2.c create mode 100644 test/Parser/objc-alias-printing.m create mode 100644 test/Parser/objc-category-neg-1.m create mode 100644 test/Parser/objc-forcollection-1.m create mode 100644 test/Parser/objc-forcollection-neg-2.m create mode 100644 test/Parser/objc-forcollection-neg.m create mode 100644 test/Parser/objc-foreach-syntax.m create mode 100644 test/Parser/objc-init.m create mode 100644 test/Parser/objc-interfaces.m create mode 100644 test/Parser/objc-messaging-1.m create mode 100644 test/Parser/objc-messaging-neg-1.m create mode 100644 test/Parser/objc-missing-impl.m create mode 100644 test/Parser/objc-property-syntax.m create mode 100644 test/Parser/objc-quirks.m create mode 100644 test/Parser/objc-try-catch-1.m create mode 100644 test/Parser/objc-type-printing.m create mode 100644 test/Parser/parmvardecl_conversion.c create mode 100644 test/Parser/pointer-arithmetic.c create mode 100644 test/Parser/pointer_promotion.c create mode 100644 test/Parser/pragma-pack.c create mode 100644 test/Parser/prefix-attributes.m create mode 100644 test/Parser/promote_types_in_proto.c create mode 100644 test/Parser/recovery.c create mode 100644 test/Parser/selector-1.m create mode 100644 test/Parser/statements.c create mode 100644 test/Parser/struct-recursion.c create mode 100644 test/Parser/traditional_arg_scope.c create mode 100644 test/Parser/typeof.c create mode 100644 test/Parser/types.c create mode 100644 test/Preprocessor/_Pragma-dependency.c create mode 100644 test/Preprocessor/_Pragma-location.c create mode 100644 test/Preprocessor/_Pragma-physloc.c create mode 100644 test/Preprocessor/_Pragma-syshdr2.c create mode 100644 test/Preprocessor/_Pragma.c create mode 100644 test/Preprocessor/assembler-with-cpp.c create mode 100644 test/Preprocessor/builtin_line.c create mode 100644 test/Preprocessor/c90.c create mode 100644 test/Preprocessor/c99-6_10_3_3_p4.c create mode 100644 test/Preprocessor/c99-6_10_3_4_p5.c create mode 100644 test/Preprocessor/c99-6_10_3_4_p6.c create mode 100644 test/Preprocessor/c99-6_10_3_4_p7.c create mode 100644 test/Preprocessor/c99-6_10_3_4_p9.c create mode 100644 test/Preprocessor/clang_headers.c create mode 100644 test/Preprocessor/comment_save.c create mode 100644 test/Preprocessor/comment_save_if.c create mode 100644 test/Preprocessor/comment_save_macro.c create mode 100644 test/Preprocessor/cxx_and.cpp create mode 100644 test/Preprocessor/cxx_bitand.cpp create mode 100644 test/Preprocessor/cxx_bitor.cpp create mode 100644 test/Preprocessor/cxx_compl.cpp create mode 100644 test/Preprocessor/cxx_not.cpp create mode 100644 test/Preprocessor/cxx_not_eq.cpp create mode 100644 test/Preprocessor/cxx_oper_keyword.cpp create mode 100644 test/Preprocessor/cxx_oper_spelling.cpp create mode 100644 test/Preprocessor/cxx_or.cpp create mode 100644 test/Preprocessor/cxx_true.cpp create mode 100644 test/Preprocessor/cxx_xor.cpp create mode 100644 test/Preprocessor/dependencies-and-pp.c create mode 100644 test/Preprocessor/disabled-cond-diags.c create mode 100644 test/Preprocessor/dump-macros-spacing.c create mode 100644 test/Preprocessor/dump-options.c create mode 100644 test/Preprocessor/dump_macros.c create mode 100644 test/Preprocessor/dumptokens_phyloc.c create mode 100644 test/Preprocessor/expr_comma.c create mode 100644 test/Preprocessor/expr_invalid_tok.c create mode 100644 test/Preprocessor/expr_liveness.c create mode 100644 test/Preprocessor/expr_multichar.c create mode 100644 test/Preprocessor/expr_usual_conversions.c create mode 100644 test/Preprocessor/extension-warning.c create mode 100644 test/Preprocessor/file_to_include.h create mode 100644 test/Preprocessor/function_macro_file.c create mode 100644 test/Preprocessor/function_macro_file.h create mode 100644 test/Preprocessor/hash_line.c create mode 100644 test/Preprocessor/hash_space.c create mode 100644 test/Preprocessor/header_lookup1.c create mode 100644 test/Preprocessor/if_warning.c create mode 100644 test/Preprocessor/ifdef-recover.c create mode 100644 test/Preprocessor/import_self.c create mode 100644 test/Preprocessor/include-directive1.c create mode 100644 test/Preprocessor/include-directive2.c create mode 100644 test/Preprocessor/include-directive3.c create mode 100644 test/Preprocessor/include-macros.c create mode 100644 test/Preprocessor/include-pth.c create mode 100644 test/Preprocessor/indent_macro.c create mode 100644 test/Preprocessor/line-directive.c create mode 100644 test/Preprocessor/macro-multiline.c create mode 100644 test/Preprocessor/macro_arg_keyword.c create mode 100644 test/Preprocessor/macro_disable.c create mode 100644 test/Preprocessor/macro_disable2.c create mode 100644 test/Preprocessor/macro_disable3.c create mode 100644 test/Preprocessor/macro_disable4.c create mode 100644 test/Preprocessor/macro_expand.c create mode 100644 test/Preprocessor/macro_expandloc.c create mode 100644 test/Preprocessor/macro_expandloc2.c create mode 100644 test/Preprocessor/macro_fn.c create mode 100644 test/Preprocessor/macro_fn_comma_swallow.c create mode 100644 test/Preprocessor/macro_fn_disable_expand.c create mode 100644 test/Preprocessor/macro_fn_lparen_scan.c create mode 100644 test/Preprocessor/macro_fn_lparen_scan2.c create mode 100644 test/Preprocessor/macro_fn_placemarker.c create mode 100644 test/Preprocessor/macro_fn_preexpand.c create mode 100644 test/Preprocessor/macro_fn_varargs_iso.c create mode 100644 test/Preprocessor/macro_fn_varargs_named.c create mode 100644 test/Preprocessor/macro_misc.c create mode 100644 test/Preprocessor/macro_not_define.c create mode 100644 test/Preprocessor/macro_paste_bad.c create mode 100644 test/Preprocessor/macro_paste_bcpl_comment.c create mode 100644 test/Preprocessor/macro_paste_c_block_comment.c create mode 100644 test/Preprocessor/macro_paste_commaext.c create mode 100644 test/Preprocessor/macro_paste_empty.c create mode 100644 test/Preprocessor/macro_paste_hard.c create mode 100644 test/Preprocessor/macro_paste_hashhash.c create mode 100644 test/Preprocessor/macro_paste_mscomment.c create mode 100644 test/Preprocessor/macro_paste_none.c create mode 100644 test/Preprocessor/macro_paste_simple.c create mode 100644 test/Preprocessor/macro_paste_spacing.c create mode 100644 test/Preprocessor/macro_paste_spacing2.c create mode 100644 test/Preprocessor/macro_rescan.c create mode 100644 test/Preprocessor/macro_rescan2.c create mode 100644 test/Preprocessor/macro_rescan_varargs.c create mode 100644 test/Preprocessor/macro_rparen_scan.c create mode 100644 test/Preprocessor/macro_rparen_scan2.c create mode 100644 test/Preprocessor/macro_space.c create mode 100644 test/Preprocessor/mi_opt.c create mode 100644 test/Preprocessor/mi_opt.h create mode 100644 test/Preprocessor/objc-pp.m create mode 100644 test/Preprocessor/optimize.c create mode 100644 test/Preprocessor/output_paste_avoid.c create mode 100644 test/Preprocessor/overflow.c create mode 100644 test/Preprocessor/pic.c create mode 100644 test/Preprocessor/pr2086.c create mode 100644 test/Preprocessor/pr2086.h create mode 100644 test/Preprocessor/pragma_microsoft.c create mode 100644 test/Preprocessor/pragma_poison.c create mode 100644 test/Preprocessor/pragma_unknown.c create mode 100644 test/Preprocessor/print_line_track.c create mode 100644 test/Preprocessor/skipping_unclean.c create mode 100644 test/Preprocessor/stringize_misc.c create mode 100644 test/Preprocessor/stringize_space.c create mode 100644 test/Preprocessor/stringize_space2.c create mode 100644 test/Preprocessor/undef-error.c create mode 100644 test/Preprocessor/unterminated.c create mode 100644 test/Preprocessor/x86_target_features.c create mode 100644 test/Rewriter/block-test.c create mode 100644 test/Rewriter/crash.m create mode 100644 test/Rewriter/finally.m create mode 100644 test/Rewriter/id-test-3.m create mode 100644 test/Rewriter/ivar-encoding-1.m create mode 100644 test/Rewriter/ivar-encoding-2.m create mode 100644 test/Rewriter/metadata-test-1.m create mode 100644 test/Rewriter/metadata-test-2.m create mode 100644 test/Rewriter/method-encoding-1.m create mode 100644 test/Rewriter/objc-encoding-bug-1.m create mode 100644 test/Rewriter/objc-ivar-receiver-1.m create mode 100644 test/Rewriter/objc-string-concat-1.m create mode 100644 test/Rewriter/objc-super-test.m create mode 100644 test/Rewriter/objc-synchronized-1.m create mode 100644 test/Rewriter/properties.m create mode 100644 test/Rewriter/protocol-rewrite-1.m create mode 100644 test/Rewriter/rewrite-api-bug.m create mode 100644 test/Rewriter/rewrite-foreach-1.m create mode 100644 test/Rewriter/rewrite-foreach-2.m create mode 100644 test/Rewriter/rewrite-foreach-3.m create mode 100644 test/Rewriter/rewrite-foreach-4.m create mode 100644 test/Rewriter/rewrite-foreach-5.m create mode 100644 test/Rewriter/rewrite-foreach-6.m create mode 100644 test/Rewriter/rewrite-nest.m create mode 100644 test/Rewriter/rewrite-protocol-type-1.m create mode 100644 test/Rewriter/rewrite-try-catch.m create mode 100644 test/Rewriter/static-type-protocol-1.m create mode 100644 test/Rewriter/undecl-objc-h.m create mode 100644 test/Rewriter/undeclared-method-1.m create mode 100644 test/Rewriter/undef-field-reference-1.m create mode 100644 test/Rewriter/va-method.m create mode 100644 test/Sema/128bitint.c create mode 100644 test/Sema/PR2727.c create mode 100644 test/Sema/PR2728.c create mode 100644 test/Sema/PR2919-builtin-types-compat-strips-crv.c create mode 100644 test/Sema/PR2923.c create mode 100644 test/Sema/PR2963-enum-constant.c create mode 100644 test/Sema/address-constant.c create mode 100644 test/Sema/address_spaces.c create mode 100644 test/Sema/align-x86.c create mode 100644 test/Sema/annotate.c create mode 100644 test/Sema/anonymous-struct-union.c create mode 100644 test/Sema/arg-duplicate.c create mode 100644 test/Sema/arg-scope-c99.c create mode 100644 test/Sema/arg-scope.c create mode 100644 test/Sema/array-constraint.c create mode 100644 test/Sema/array-declared-as-incorrect-type.c create mode 100644 test/Sema/array-init.c create mode 100644 test/Sema/asm.c create mode 100644 test/Sema/assign-null.c create mode 100644 test/Sema/assign.c create mode 100644 test/Sema/ast-print.c create mode 100644 test/Sema/attr-aligned.c create mode 100644 test/Sema/attr-cleanup.c create mode 100644 test/Sema/attr-deprecated.c create mode 100644 test/Sema/attr-mode.c create mode 100644 test/Sema/attr-nodebug.c create mode 100644 test/Sema/attr-noinline.c create mode 100644 test/Sema/attr-noreturn.c create mode 100644 test/Sema/attr-regparm.c create mode 100644 test/Sema/attr-unused.c create mode 100644 test/Sema/attr-used.c create mode 100644 test/Sema/attr-warn_unused_result.c create mode 100644 test/Sema/attr-weak.c create mode 100644 test/Sema/bitfield-layout.c create mode 100644 test/Sema/bitfield.c create mode 100644 test/Sema/block-args.c create mode 100644 test/Sema/block-as-object.m create mode 100644 test/Sema/block-byref-args.c create mode 100644 test/Sema/block-call.c create mode 100644 test/Sema/block-explicit-return-type.c create mode 100644 test/Sema/block-labels.c create mode 100644 test/Sema/block-literal.c create mode 100644 test/Sema/block-misc.c create mode 100644 test/Sema/block-printf-attribute-1.c create mode 100644 test/Sema/block-return.c create mode 100644 test/Sema/block-sentinel-attribute.c create mode 100644 test/Sema/block-storageclass.c create mode 100644 test/Sema/builtin-object-size.c create mode 100644 test/Sema/builtin-prefetch.c create mode 100644 test/Sema/builtin-stackaddress.c create mode 100644 test/Sema/builtins.c create mode 100644 test/Sema/c89-2.c create mode 100644 test/Sema/c89.c create mode 100644 test/Sema/callingconv.c create mode 100644 test/Sema/carbon-pth.c create mode 100644 test/Sema/carbon.c create mode 100644 test/Sema/cast-to-union.c create mode 100644 test/Sema/cast.c create mode 100644 test/Sema/check-increment.c create mode 100644 test/Sema/compare.c create mode 100644 test/Sema/complex-int.c create mode 100644 test/Sema/complex-promotion.c create mode 100644 test/Sema/compound-literal.c create mode 100644 test/Sema/conditional-expr.c create mode 100644 test/Sema/conditional.c create mode 100644 test/Sema/const-eval.c create mode 100644 test/Sema/const-ptr-int-ptr-cast.c create mode 100644 test/Sema/constant-builtins-2.c create mode 100644 test/Sema/constant-builtins.c create mode 100644 test/Sema/constructor-attribute.c create mode 100644 test/Sema/darwin-align-cast.c create mode 100644 test/Sema/decl-invalid.c create mode 100644 test/Sema/decl-type-merging.c create mode 100644 test/Sema/declspec.c create mode 100644 test/Sema/default.c create mode 100644 test/Sema/default1.c create mode 100644 test/Sema/deref.c create mode 100644 test/Sema/designated-initializers.c create mode 100644 test/Sema/dllimport-dllexport.c create mode 100644 test/Sema/enum.c create mode 100644 test/Sema/expr-address-of.c create mode 100644 test/Sema/expr-comma-c89.c create mode 100644 test/Sema/expr-comma.c create mode 100644 test/Sema/exprs.c create mode 100644 test/Sema/ext_vector_components.c create mode 100644 test/Sema/flexible-array-init.c create mode 100644 test/Sema/floating-point-compare.c create mode 100644 test/Sema/for.c create mode 100644 test/Sema/format-attribute.c create mode 100644 test/Sema/format-string-percentm.c create mode 100644 test/Sema/format-strings.c create mode 100644 test/Sema/function-pointer-sentinel-attribute.c create mode 100644 test/Sema/function-ptr.c create mode 100644 test/Sema/function-redecl.c create mode 100644 test/Sema/function-sentinel-attr.c create mode 100644 test/Sema/function.c create mode 100644 test/Sema/gnu89.c create mode 100644 test/Sema/heinous-extensions-off.c create mode 100644 test/Sema/heinous-extensions-on.c create mode 100644 test/Sema/i-c-e.c create mode 100644 test/Sema/if-empty-body.c create mode 100644 test/Sema/illegal-types.c create mode 100644 test/Sema/implicit-builtin-decl.c create mode 100644 test/Sema/implicit-builtin-freestanding.c create mode 100644 test/Sema/implicit-builtin-redecl.c create mode 100644 test/Sema/implicit-cast.c create mode 100644 test/Sema/implicit-decl.c create mode 100644 test/Sema/implicit-def.c create mode 100644 test/Sema/implicit-int.c create mode 100644 test/Sema/incompatible-sign.c create mode 100644 test/Sema/incomplete-call.c create mode 100644 test/Sema/incomplete-decl.c create mode 100644 test/Sema/indirect-goto.c create mode 100644 test/Sema/init-struct-qualified.c create mode 100644 test/Sema/init.c create mode 100644 test/Sema/inline.c create mode 100644 test/Sema/int-arith-convert.c create mode 100644 test/Sema/invalid-decl.c create mode 100644 test/Sema/invalid-init-diag.c create mode 100644 test/Sema/invalid-struct-init.c create mode 100644 test/Sema/knr-def-call.c create mode 100644 test/Sema/knr-variadic-def.c create mode 100644 test/Sema/member-reference.c create mode 100644 test/Sema/merge-decls.c create mode 100644 test/Sema/ms-fuzzy-asm.c create mode 100644 test/Sema/nested-redef.c create mode 100644 test/Sema/nonnull.c create mode 100644 test/Sema/offsetof.c create mode 100644 test/Sema/overloadable-complex.c create mode 100644 test/Sema/overloadable.c create mode 100644 test/Sema/pointer-addition.c create mode 100644 test/Sema/pointer-subtract-compat.c create mode 100644 test/Sema/pragma-pack-2.c create mode 100644 test/Sema/pragma-pack-3.c create mode 100644 test/Sema/pragma-pack.c create mode 100644 test/Sema/pragma-unused.c create mode 100644 test/Sema/predef.c create mode 100644 test/Sema/predefined-function.c create mode 100644 test/Sema/private-extern.c create mode 100644 test/Sema/rdar6248119.m create mode 100644 test/Sema/rdr6094103-unordered-compare-promote.c create mode 100644 test/Sema/recover-goto.c create mode 100644 test/Sema/redefinition.c create mode 100644 test/Sema/return-silent.c create mode 100644 test/Sema/return.c create mode 100644 test/Sema/scope-check.c create mode 100644 test/Sema/self-comparison.c create mode 100644 test/Sema/sentinel-attribute.c create mode 100644 test/Sema/shift.c create mode 100644 test/Sema/statements.c create mode 100644 test/Sema/static-init.c create mode 100644 test/Sema/stdcall-fastcall.c create mode 100644 test/Sema/struct-cast.c create mode 100644 test/Sema/struct-compat.c create mode 100644 test/Sema/struct-decl.c create mode 100644 test/Sema/struct-packed-align.c create mode 100644 test/Sema/surpress-deprecated.c create mode 100644 test/Sema/switch.c create mode 100644 test/Sema/tentative-decls.c create mode 100644 test/Sema/text-diag.c create mode 100644 test/Sema/thread-specifier.c create mode 100644 test/Sema/transparent-union-pointer.c create mode 100644 test/Sema/transparent-union.c create mode 100644 test/Sema/type-spec-struct-union.c create mode 100644 test/Sema/typecheck-binop.c create mode 100644 test/Sema/typedef-prototype.c create mode 100644 test/Sema/typedef-redef.c create mode 100644 test/Sema/typedef-retain.c create mode 100644 test/Sema/typedef-variable-type.c create mode 100644 test/Sema/types.c create mode 100644 test/Sema/ucn-cstring.c create mode 100644 test/Sema/unnamed-bitfield-init.c create mode 100644 test/Sema/unused-expr.c create mode 100644 test/Sema/usual-float.c create mode 100644 test/Sema/va_arg_x86_32.c create mode 100644 test/Sema/va_arg_x86_64.c create mode 100644 test/Sema/var-redecl.c create mode 100644 test/Sema/varargs-x86-64.c create mode 100644 test/Sema/varargs.c create mode 100644 test/Sema/variadic-block.c create mode 100644 test/Sema/vector-assign.c create mode 100644 test/Sema/vector-cast.c create mode 100644 test/Sema/vector-init.c create mode 100644 test/Sema/vla.c create mode 100644 test/Sema/void_arg.c create mode 100644 test/Sema/warn-freestanding-complex.c create mode 100644 test/Sema/warn-missing-prototypes.c create mode 100644 test/Sema/wchar.c create mode 100644 test/SemaCXX/__null.cpp create mode 100644 test/SemaCXX/abstract.cpp create mode 100644 test/SemaCXX/access-base-class.cpp create mode 100644 test/SemaCXX/access.cpp create mode 100644 test/SemaCXX/addr-of-overloaded-function.cpp create mode 100644 test/SemaCXX/address-of.cpp create mode 100644 test/SemaCXX/aggregate-initialization.cpp create mode 100644 test/SemaCXX/anonymous-union.cpp create mode 100644 test/SemaCXX/attr-unavailable.cpp create mode 100644 test/SemaCXX/basic_lookup_argdep.cpp create mode 100644 test/SemaCXX/blocks.cpp create mode 100644 test/SemaCXX/bool.cpp create mode 100644 test/SemaCXX/carbon.cpp create mode 100644 test/SemaCXX/class-names.cpp create mode 100644 test/SemaCXX/class.cpp create mode 100644 test/SemaCXX/complex-overload.cpp create mode 100644 test/SemaCXX/composite-pointer-type.cpp create mode 100644 test/SemaCXX/condition.cpp create mode 100644 test/SemaCXX/conditional-expr.cpp create mode 100644 test/SemaCXX/const-cast.cpp create mode 100644 test/SemaCXX/constant-expression.cpp create mode 100644 test/SemaCXX/constructor-initializer.cpp create mode 100644 test/SemaCXX/constructor-recovery.cpp create mode 100644 test/SemaCXX/constructor.cpp create mode 100644 test/SemaCXX/conversion-function.cpp create mode 100644 test/SemaCXX/convert-to-bool.cpp create mode 100644 test/SemaCXX/converting-constructor.cpp create mode 100644 test/SemaCXX/copy-assignment.cpp create mode 100644 test/SemaCXX/copy-initialization.cpp create mode 100644 test/SemaCXX/dcl_ambig_res.cpp create mode 100644 test/SemaCXX/dcl_init_aggr.cpp create mode 100644 test/SemaCXX/decl-expr-ambiguity.cpp create mode 100644 test/SemaCXX/default1.cpp create mode 100644 test/SemaCXX/default2.cpp create mode 100644 test/SemaCXX/deleted-function.cpp create mode 100644 test/SemaCXX/dependent-types.cpp create mode 100644 test/SemaCXX/derived-to-base-ambig.cpp create mode 100644 test/SemaCXX/destructor.cpp create mode 100644 test/SemaCXX/direct-initializer.cpp create mode 100644 test/SemaCXX/do-while-scope.cpp create mode 100644 test/SemaCXX/dynamic-cast.cpp create mode 100644 test/SemaCXX/elaborated-type-specifier.cpp create mode 100644 test/SemaCXX/enum.cpp create mode 100644 test/SemaCXX/exception-spec.cpp create mode 100644 test/SemaCXX/exceptions.cpp create mode 100644 test/SemaCXX/expressions.cpp create mode 100644 test/SemaCXX/fntype-decl.cpp create mode 100644 test/SemaCXX/friend.cpp create mode 100644 test/SemaCXX/function-redecl.cpp create mode 100644 test/SemaCXX/function-type-qual.cpp create mode 100644 test/SemaCXX/functional-cast.cpp create mode 100644 test/SemaCXX/i-c-e-cxx.cpp create mode 100644 test/SemaCXX/implicit-int.cpp create mode 100644 test/SemaCXX/inherit.cpp create mode 100644 test/SemaCXX/inline.cpp create mode 100644 test/SemaCXX/linkage-spec.cpp create mode 100644 test/SemaCXX/member-expr-static.cpp create mode 100644 test/SemaCXX/member-expr.cpp create mode 100644 test/SemaCXX/member-location.cpp create mode 100644 test/SemaCXX/member-name-lookup.cpp create mode 100644 test/SemaCXX/member-pointer-size.cpp create mode 100644 test/SemaCXX/member-pointer.cpp create mode 100644 test/SemaCXX/ms-exception-spec.cpp create mode 100644 test/SemaCXX/namespace-alias.cpp create mode 100644 test/SemaCXX/namespace.cpp create mode 100644 test/SemaCXX/nested-name-spec.cpp create mode 100644 test/SemaCXX/new-delete.cpp create mode 100644 test/SemaCXX/no-implicit-builtin-decls.cpp create mode 100644 test/SemaCXX/nullptr.cpp create mode 100644 test/SemaCXX/offsetof.cpp create mode 100644 test/SemaCXX/overload-call-copycon.cpp create mode 100644 test/SemaCXX/overload-call.cpp create mode 100644 test/SemaCXX/overload-decl.cpp create mode 100644 test/SemaCXX/overload-member-call.cpp create mode 100644 test/SemaCXX/overloaded-builtin-operators.cpp create mode 100644 test/SemaCXX/overloaded-operator-decl.cpp create mode 100644 test/SemaCXX/overloaded-operator.cpp create mode 100644 test/SemaCXX/qualification-conversion.cpp create mode 100644 test/SemaCXX/qualified-id-lookup.cpp create mode 100644 test/SemaCXX/qualified-names-diag.cpp create mode 100644 test/SemaCXX/qualified-names-print.cpp create mode 100644 test/SemaCXX/references.cpp create mode 100644 test/SemaCXX/reinterpret-cast.cpp create mode 100644 test/SemaCXX/reinterpret-fn-obj-pedantic.cpp create mode 100644 test/SemaCXX/return-stack-addr.cpp create mode 100644 test/SemaCXX/rval-references.cpp create mode 100644 test/SemaCXX/statements.cpp create mode 100644 test/SemaCXX/static-assert.cpp create mode 100644 test/SemaCXX/static-cast.cpp create mode 100644 test/SemaCXX/static-initializers.cpp create mode 100644 test/SemaCXX/struct-class-redecl.cpp create mode 100644 test/SemaCXX/template-specialization.cpp create mode 100644 test/SemaCXX/this.cpp create mode 100644 test/SemaCXX/trivial-constructor.cpp create mode 100644 test/SemaCXX/trivial-destructor.cpp create mode 100644 test/SemaCXX/type-convert-construct.cpp create mode 100644 test/SemaCXX/type-definition-in-specifier.cpp create mode 100644 test/SemaCXX/type-dependent-exprs.cpp create mode 100644 test/SemaCXX/type-traits.cpp create mode 100644 test/SemaCXX/typedef-redecl.cpp create mode 100644 test/SemaCXX/typeid.cpp create mode 100644 test/SemaCXX/types_compatible_p.cpp create mode 100644 test/SemaCXX/unused.cpp create mode 100644 test/SemaCXX/user-defined-conversions.cpp create mode 100644 test/SemaCXX/using-directive.cpp create mode 100644 test/SemaCXX/vararg-non-pod.cpp create mode 100644 test/SemaCXX/virtual-override.cpp create mode 100644 test/SemaCXX/virtuals.cpp create mode 100644 test/SemaCXX/warn-for-var-in-else.cpp create mode 100644 test/SemaCXX/wchar_t.cpp create mode 100644 test/SemaObjC/ContClassPropertyLookup.m create mode 100644 test/SemaObjC/DoubleMethod.m create mode 100644 test/SemaObjC/access-property-getter.m create mode 100644 test/SemaObjC/alias-test-1.m create mode 100644 test/SemaObjC/alias-test-2.m create mode 100644 test/SemaObjC/argument-checking.m create mode 100644 test/SemaObjC/at-defs.m create mode 100644 test/SemaObjC/attr-cleanup.m create mode 100644 test/SemaObjC/attr-deprecated.m create mode 100644 test/SemaObjC/attr-objc-exception.m create mode 100644 test/SemaObjC/attr-objc-gc.m create mode 100644 test/SemaObjC/bad-receiver-1.m create mode 100644 test/SemaObjC/block-attr.m create mode 100644 test/SemaObjC/block-ivar.m create mode 100644 test/SemaObjC/blocks.m create mode 100644 test/SemaObjC/call-super-2.m create mode 100644 test/SemaObjC/catch-stmt.m create mode 100644 test/SemaObjC/category-1.m create mode 100644 test/SemaObjC/category-method-lookup-2.m create mode 100644 test/SemaObjC/category-method-lookup.m create mode 100644 test/SemaObjC/check-dup-decl-methods-1.m create mode 100644 test/SemaObjC/check-dup-objc-decls-1.m create mode 100644 test/SemaObjC/class-bitfield.m create mode 100644 test/SemaObjC/class-conforming-protocol-1.m create mode 100644 test/SemaObjC/class-conforming-protocol-2.m create mode 100644 test/SemaObjC/class-def-test-1.m create mode 100644 test/SemaObjC/class-extension-dup-methods.m create mode 100644 test/SemaObjC/class-impl-1.m create mode 100644 test/SemaObjC/class-method-lookup.m create mode 100644 test/SemaObjC/class-method-self.m create mode 100644 test/SemaObjC/class-property-access.m create mode 100644 test/SemaObjC/class-proto-1.m create mode 100644 test/SemaObjC/cocoa-pth.m create mode 100644 test/SemaObjC/cocoa.m create mode 100644 test/SemaObjC/compare-qualified-id.m create mode 100644 test/SemaObjC/compatible-protocol-qualified-types.m create mode 100644 test/SemaObjC/comptypes-1.m create mode 100644 test/SemaObjC/comptypes-2.m create mode 100644 test/SemaObjC/comptypes-3.m create mode 100644 test/SemaObjC/comptypes-4.m create mode 100644 test/SemaObjC/comptypes-5.m create mode 100644 test/SemaObjC/comptypes-6.m create mode 100644 test/SemaObjC/comptypes-7.m create mode 100644 test/SemaObjC/comptypes-8.m create mode 100644 test/SemaObjC/comptypes-9.m create mode 100644 test/SemaObjC/comptypes-a.m create mode 100644 test/SemaObjC/comptypes-legal.m create mode 100644 test/SemaObjC/conditional-expr-2.m create mode 100644 test/SemaObjC/conditional-expr-3.m create mode 100644 test/SemaObjC/conditional-expr-4.m create mode 100644 test/SemaObjC/conditional-expr.m create mode 100644 test/SemaObjC/conflicting-ivar-test-1.m create mode 100644 test/SemaObjC/continuation-class-err.m create mode 100644 test/SemaObjC/duplicate-ivar-check.m create mode 100644 test/SemaObjC/enhanced-proto-2.m create mode 100644 test/SemaObjC/error-property-gc-attr.m create mode 100644 test/SemaObjC/exprs.m create mode 100644 test/SemaObjC/foreach.m create mode 100644 test/SemaObjC/format-arg-attribute.m create mode 100644 test/SemaObjC/format-strings-objc.m create mode 100644 test/SemaObjC/forward-class-1.m create mode 100644 test/SemaObjC/forward-class-receiver.m create mode 100644 test/SemaObjC/gcc-cast-ext.m create mode 100644 test/SemaObjC/id.m create mode 100644 test/SemaObjC/id_builtin.m create mode 100644 test/SemaObjC/ignore-weakimport-method.m create mode 100644 test/SemaObjC/incompatible-protocol-qualified-types.m create mode 100644 test/SemaObjC/inst-method-lookup-in-root.m create mode 100644 test/SemaObjC/interface-1.m create mode 100644 test/SemaObjC/interface-layout-2.m create mode 100644 test/SemaObjC/interface-layout.m create mode 100644 test/SemaObjC/interface-scope-2.m create mode 100644 test/SemaObjC/interface-scope.m create mode 100644 test/SemaObjC/interface-tu-variable.m create mode 100644 test/SemaObjC/invalid-code.m create mode 100644 test/SemaObjC/invalid-objc-decls-1.m create mode 100644 test/SemaObjC/invalid-receiver.m create mode 100644 test/SemaObjC/invalid-typename.m create mode 100644 test/SemaObjC/ivar-access-package.m create mode 100644 test/SemaObjC/ivar-access-tests.m create mode 100644 test/SemaObjC/ivar-lookup.m create mode 100644 test/SemaObjC/ivar-ref-misuse.m create mode 100644 test/SemaObjC/ivar-sem-check-1.m create mode 100644 test/SemaObjC/ivar-sem-check-2.m create mode 100644 test/SemaObjC/legacy-implementation-1.m create mode 100644 test/SemaObjC/message.m create mode 100644 test/SemaObjC/method-arg-decay.m create mode 100644 test/SemaObjC/method-attributes.m create mode 100644 test/SemaObjC/method-bad-param.m create mode 100644 test/SemaObjC/method-conflict.m create mode 100644 test/SemaObjC/method-def-1.m create mode 100644 test/SemaObjC/method-def-2.m create mode 100644 test/SemaObjC/method-encoding-2.m create mode 100644 test/SemaObjC/method-lookup-2.m create mode 100644 test/SemaObjC/method-lookup-3.m create mode 100644 test/SemaObjC/method-lookup-4.m create mode 100644 test/SemaObjC/method-lookup.m create mode 100644 test/SemaObjC/method-no-context.m create mode 100644 test/SemaObjC/method-not-defined.m create mode 100644 test/SemaObjC/method-sentinel-attr.m create mode 100644 test/SemaObjC/method-typecheck-1.m create mode 100644 test/SemaObjC/method-typecheck-2.m create mode 100644 test/SemaObjC/method-undef-category-warn-1.m create mode 100644 test/SemaObjC/method-undef-extension-warn-1.m create mode 100644 test/SemaObjC/method-undefined-warn-1.m create mode 100644 test/SemaObjC/missing-method-context.m create mode 100644 test/SemaObjC/newproperty-class-method-1.m create mode 100644 test/SemaObjC/no-gc-weak-test.m create mode 100644 test/SemaObjC/no-warn-synth-protocol-meth.m create mode 100644 test/SemaObjC/no-warn-unimpl-method.m create mode 100644 test/SemaObjC/nsobject-attribute-1.m create mode 100644 test/SemaObjC/nsobject-attribute.m create mode 100644 test/SemaObjC/objc-string-constant.m create mode 100644 test/SemaObjC/objc2-merge-gc-attribue-decl.m create mode 100644 test/SemaObjC/objc2-warn-weak-decl.m create mode 100644 test/SemaObjC/property-10.m create mode 100644 test/SemaObjC/property-11.m create mode 100644 test/SemaObjC/property-12.m create mode 100644 test/SemaObjC/property-13.m create mode 100644 test/SemaObjC/property-2.m create mode 100644 test/SemaObjC/property-3.m create mode 100644 test/SemaObjC/property-4.m create mode 100644 test/SemaObjC/property-5.m create mode 100644 test/SemaObjC/property-6.m create mode 100644 test/SemaObjC/property-7.m create mode 100644 test/SemaObjC/property-8.m create mode 100644 test/SemaObjC/property-9-impl-method.m create mode 100644 test/SemaObjC/property-9.m create mode 100644 test/SemaObjC/property-category-1.m create mode 100644 test/SemaObjC/property-category-2.m create mode 100644 test/SemaObjC/property-category-3.m create mode 100644 test/SemaObjC/property-error-readonly-assign.m create mode 100644 test/SemaObjC/property-impl-misuse.m create mode 100644 test/SemaObjC/property-inherited.m create mode 100644 test/SemaObjC/property-ivar-mismatch.m create mode 100644 test/SemaObjC/property-method-lookup-impl.m create mode 100644 test/SemaObjC/property-missing.m create mode 100644 test/SemaObjC/property-nonfragile-abi.m create mode 100644 test/SemaObjC/property-noprotocol-warning.m create mode 100644 test/SemaObjC/property-redundant-decl-accessor.m create mode 100644 test/SemaObjC/property-typecheck-1.m create mode 100644 test/SemaObjC/property-user-setter.m create mode 100644 test/SemaObjC/property-weak.m create mode 100644 test/SemaObjC/property.m create mode 100644 test/SemaObjC/props-on-prots.m create mode 100644 test/SemaObjC/protocol-archane.m create mode 100644 test/SemaObjC/protocol-attribute.m create mode 100644 test/SemaObjC/protocol-expr-1.m create mode 100644 test/SemaObjC/protocol-expr-neg-1.m create mode 100644 test/SemaObjC/protocol-id-test-1.m create mode 100644 test/SemaObjC/protocol-id-test-2.m create mode 100644 test/SemaObjC/protocol-id-test-3.m create mode 100644 test/SemaObjC/protocol-implementation-inherited.m create mode 100644 test/SemaObjC/protocol-lookup-2.m create mode 100644 test/SemaObjC/protocol-lookup.m create mode 100644 test/SemaObjC/protocol-qualified-class-unsupported.m create mode 100644 test/SemaObjC/protocol-typecheck.m create mode 100644 test/SemaObjC/protocols.m create mode 100644 test/SemaObjC/rdr-6211479-array-property.m create mode 100644 test/SemaObjC/scope-check.m create mode 100644 test/SemaObjC/selector-1.m create mode 100644 test/SemaObjC/selector-error.m create mode 100644 test/SemaObjC/selector-overload.m create mode 100644 test/SemaObjC/sizeof-interface.m create mode 100644 test/SemaObjC/static-ivar-ref-1.m create mode 100644 test/SemaObjC/stmts.m create mode 100644 test/SemaObjC/string.m create mode 100644 test/SemaObjC/super-cat-prot.m create mode 100644 test/SemaObjC/super-property-message-expr.m create mode 100644 test/SemaObjC/super-property-notation.m create mode 100644 test/SemaObjC/super.m create mode 100644 test/SemaObjC/synchronized.m create mode 100644 test/SemaObjC/synthesize-setter-contclass.m create mode 100644 test/SemaObjC/synthesized-ivar.m create mode 100644 test/SemaObjC/try-catch.m create mode 100644 test/SemaObjC/typedef-class.m create mode 100644 test/SemaObjC/ucn-objc-string.m create mode 100644 test/SemaObjC/undef-class-messagin-error.m create mode 100644 test/SemaObjC/undef-protocol-methods-1.m create mode 100644 test/SemaObjC/undef-superclass-1.m create mode 100644 test/SemaObjC/undefined-protocol-type-1.m create mode 100644 test/SemaObjC/unused.m create mode 100644 test/SemaObjC/va-method-1.m create mode 100644 test/SemaObjC/warn-selector-selection.m create mode 100644 test/SemaObjC/warn-weak-field.m create mode 100644 test/SemaObjC/weak-attr-ivar.m create mode 100644 test/SemaObjC/writable-property-in-superclass.m create mode 100644 test/SemaObjCXX/blocks.mm create mode 100644 test/SemaObjCXX/cocoa.mm create mode 100644 test/SemaObjCXX/linkage-spec.mm create mode 100644 test/SemaObjCXX/objc-decls-inside-namespace.mm create mode 100644 test/SemaObjCXX/overload.mm create mode 100644 test/SemaObjCXX/protocol-lookup.mm create mode 100644 test/SemaObjCXX/reserved-keyword-selectors.mm create mode 100644 test/SemaObjCXX/vararg-non-pod.mm create mode 100644 test/SemaObjCXX/void_to_obj.mm create mode 100644 test/SemaTemplate/class-template-decl.cpp create mode 100644 test/SemaTemplate/class-template-id-2.cpp create mode 100644 test/SemaTemplate/class-template-id.cpp create mode 100644 test/SemaTemplate/class-template-spec.cpp create mode 100644 test/SemaTemplate/current-instantiation.cpp create mode 100644 test/SemaTemplate/default-arguments.cpp create mode 100644 test/SemaTemplate/dependent-type-identity.cpp create mode 100644 test/SemaTemplate/enum-argument.cpp create mode 100644 test/SemaTemplate/example-dynarray.cpp create mode 100644 test/SemaTemplate/fibonacci.cpp create mode 100644 test/SemaTemplate/fun-template-def.cpp create mode 100644 test/SemaTemplate/injected-class-name.cpp create mode 100644 test/SemaTemplate/instantiate-array.cpp create mode 100644 test/SemaTemplate/instantiate-c99.cpp create mode 100644 test/SemaTemplate/instantiate-call.cpp create mode 100644 test/SemaTemplate/instantiate-cast.cpp create mode 100644 test/SemaTemplate/instantiate-clang.cpp create mode 100644 test/SemaTemplate/instantiate-complete.cpp create mode 100644 test/SemaTemplate/instantiate-declref.cpp create mode 100644 test/SemaTemplate/instantiate-enum.cpp create mode 100644 test/SemaTemplate/instantiate-expr-1.cpp create mode 100644 test/SemaTemplate/instantiate-expr-2.cpp create mode 100644 test/SemaTemplate/instantiate-expr-3.cpp create mode 100644 test/SemaTemplate/instantiate-expr-4.cpp create mode 100644 test/SemaTemplate/instantiate-expr-basic.cpp create mode 100644 test/SemaTemplate/instantiate-field.cpp create mode 100644 test/SemaTemplate/instantiate-function-1.cpp create mode 100644 test/SemaTemplate/instantiate-function-1.mm create mode 100644 test/SemaTemplate/instantiate-function-2.cpp create mode 100644 test/SemaTemplate/instantiate-member-class.cpp create mode 100644 test/SemaTemplate/instantiate-method.cpp create mode 100644 test/SemaTemplate/instantiate-static-var.cpp create mode 100644 test/SemaTemplate/instantiate-subscript.cpp create mode 100644 test/SemaTemplate/instantiate-template-template-parm.cpp create mode 100644 test/SemaTemplate/instantiate-try-catch.cpp create mode 100644 test/SemaTemplate/instantiate-type.cpp create mode 100644 test/SemaTemplate/instantiate-typedef.cpp create mode 100644 test/SemaTemplate/instantiation-backtrace.cpp create mode 100644 test/SemaTemplate/instantiation-default-1.cpp create mode 100644 test/SemaTemplate/instantiation-default-2.cpp create mode 100644 test/SemaTemplate/instantiation-default-3.cpp create mode 100644 test/SemaTemplate/instantiation-depth.cpp create mode 100644 test/SemaTemplate/metafun-apply.cpp create mode 100644 test/SemaTemplate/nested-name-spec-template.cpp create mode 100644 test/SemaTemplate/nested-template.cpp create mode 100644 test/SemaTemplate/qualified-names-diag.cpp create mode 100644 test/SemaTemplate/right-angle-brackets-0x.cpp create mode 100644 test/SemaTemplate/right-angle-brackets-98.cpp create mode 100644 test/SemaTemplate/temp.cpp create mode 100644 test/SemaTemplate/temp_arg.cpp create mode 100644 test/SemaTemplate/temp_arg_nontype.cpp create mode 100644 test/SemaTemplate/temp_arg_template.cpp create mode 100644 test/SemaTemplate/temp_arg_type.cpp create mode 100644 test/SemaTemplate/temp_class_spec.cpp create mode 100644 test/SemaTemplate/temp_explicit.cpp create mode 100644 test/SemaTemplate/temp_explicit_cxx0x.cpp create mode 100644 test/SemaTemplate/temp_param.cpp create mode 100644 test/SemaTemplate/typename-specifier-2.cpp create mode 100644 test/SemaTemplate/typename-specifier.cpp create mode 100755 test/TestRunner.sh create mode 100644 tools/CMakeLists.txt create mode 100644 tools/Makefile create mode 100644 tools/clang-cc/CMakeLists.txt create mode 100644 tools/clang-cc/Makefile create mode 100644 tools/clang-cc/clang-cc.cpp create mode 100644 tools/driver/CMakeLists.txt create mode 100644 tools/driver/Makefile create mode 100644 tools/driver/driver.cpp create mode 100644 tools/scan-view/Reporter.py create mode 100644 tools/scan-view/Resources/FileRadar.scpt create mode 100644 tools/scan-view/Resources/GetRadarVersion.scpt create mode 100644 tools/scan-view/Resources/bugcatcher.ico create mode 100644 tools/scan-view/ScanView.py create mode 100755 tools/scan-view/scan-view create mode 100644 tools/scan-view/startfile.py create mode 100755 utils/ABITest/ABITestGen.py create mode 100644 utils/ABITest/Enumeration.py create mode 100644 utils/ABITest/Makefile.test.common create mode 100644 utils/ABITest/TypeGen.py create mode 100755 utils/ABITest/build-and-summarize-all.sh create mode 100755 utils/ABITest/build-and-summarize.sh create mode 100755 utils/ABITest/build.sh create mode 100644 utils/ABITest/layout/Makefile create mode 100644 utils/ABITest/return-types-32/Makefile create mode 100644 utils/ABITest/return-types-64/Makefile create mode 100644 utils/ABITest/single-args-32/Makefile create mode 100644 utils/ABITest/single-args-64/Makefile create mode 100755 utils/ABITest/summarize.sh create mode 100755 utils/CaptureCmd create mode 100755 utils/CmpDriver create mode 100755 utils/FindSpecRefs create mode 100755 utils/SummarizeErrors create mode 100644 utils/builtin-defines.c create mode 100755 utils/ccc-analyzer create mode 100755 utils/pch-test.pl create mode 100755 utils/scan-build create mode 100644 utils/scanview.css create mode 100644 utils/sorttable.js create mode 100644 utils/test/Makefile.multi create mode 100755 utils/test/MultiTestRunner.py create mode 100644 utils/test/ProgressBar.py create mode 100755 utils/test/TestRunner.py create mode 100755 utils/token-delta.py create mode 100755 utils/ubiviz create mode 100644 win32/clangAST/clangAST.vcproj create mode 100644 win32/clangAnalysis/clangAnalysis.vcproj create mode 100644 win32/clangBasic/clangBasic.vcproj create mode 100644 win32/clangCodeGen/clangCodeGen.vcproj create mode 100644 win32/clangDriver/clangDriver.vcproj create mode 100644 win32/clangLex/clangLex.vcproj create mode 100644 win32/clangLibDriver/clangLibDriver.vcproj create mode 100644 win32/clangParse/clangParse.vcproj create mode 100644 win32/clangRewrite/clangRewrite.vcproj create mode 100644 win32/clangSema/clangSema.vcproj create mode 100644 www/CheckerNotes.html create mode 100644 www/OpenProjects.html create mode 100644 www/StaticAnalysis.html create mode 100644 www/StaticAnalysisUsage.html create mode 100644 www/carbon-compile.png create mode 100644 www/clang_video-05-25-2007.html create mode 100644 www/clang_video-07-25-2007.html create mode 100644 www/comparison.html create mode 100644 www/content.css create mode 100644 www/cxx_status.html create mode 100644 www/demo/DemoInfo.html create mode 100644 www/demo/cathead.png create mode 100644 www/demo/index.cgi create mode 100644 www/demo/syntax.css create mode 100644 www/demo/what is this directory.txt create mode 100644 www/diagnostics.html create mode 100644 www/distclang_status.html create mode 100644 www/feature-compile1.png create mode 100644 www/feature-compile2.png create mode 100644 www/feature-memory1.png create mode 100644 www/features.html create mode 100644 www/get_involved.html create mode 100644 www/get_started.html create mode 100644 www/hacking.html create mode 100644 www/index.html create mode 100644 www/latest_checker.html.incl create mode 100644 www/menu.css create mode 100644 www/menu.html.incl create mode 100644 www/performance-2008-10-31.html create mode 100644 www/performance.html create mode 100644 www/timing-data/2008-10-31/176.gcc-01.txt create mode 100644 www/timing-data/2008-10-31/176.gcc-02.txt create mode 100644 www/timing-data/2008-10-31/176.gcc.png create mode 100644 www/timing-data/2008-10-31/sketch-01.txt create mode 100644 www/timing-data/2008-10-31/sketch-02.txt create mode 100644 www/timing-data/2008-10-31/sketch.png create mode 100644 www/timing-data/2009-03-02/176.gcc.pdf create mode 100644 www/timing-data/2009-03-02/176.gcc.png create mode 100644 www/timing-data/2009-03-02/176.gcc.txt create mode 100644 www/timing-data/2009-03-02/sketch.pdf create mode 100644 www/timing-data/2009-03-02/sketch.png create mode 100644 www/timing-data/2009-03-02/sketch.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..8ca44b8 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,56 @@ +macro(add_clang_library name) + set(srcs ${ARGN}) + if(MSVC_IDE OR XCODE) + file( GLOB_RECURSE headers *.h) + set(srcs ${srcs} ${headers}) + string( REGEX MATCHALL "/[^/]+" split_path ${CMAKE_CURRENT_SOURCE_DIR}) + list( GET split_path -1 dir) + file( GLOB_RECURSE headers ../../include/clang${dir}/*.h) + set(srcs ${srcs} ${headers}) + endif(MSVC_IDE OR XCODE) + add_library( ${name} ${srcs} ) + if( LLVM_COMMON_DEPENDS ) + add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} ) + endif( LLVM_COMMON_DEPENDS ) + add_dependencies(${name} ClangDiagnosticCommon) + if(MSVC) + get_target_property(cflag ${name} COMPILE_FLAGS) + if(NOT cflag) + set(cflag "") + endif(NOT cflag) + set(cflag "${cflag} /Za") + set_target_properties(${name} PROPERTIES COMPILE_FLAGS ${cflag}) + endif(MSVC) + install(TARGETS ${name} + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +endmacro(add_clang_library) + +macro(add_clang_executable name) + set(srcs ${ARGN}) + if(MSVC_IDE) + file( GLOB_RECURSE headers *.h) + set(srcs ${srcs} ${headers}) + endif(MSVC_IDE) + add_llvm_executable( ${name} ${srcs} ) + install(TARGETS ${name} + RUNTIME DESTINATION bin) +endmacro(add_clang_executable) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_BINARY_DIR}/include + ) + +install(DIRECTORY include + DESTINATION . + PATTERN ".svn" EXCLUDE + ) + +add_definitions( -D_GNU_SOURCE ) + +add_subdirectory(include) +add_subdirectory(lib) +add_subdirectory(tools) + +# TODO: docs. diff --git a/INPUTS/Cocoa_h.m b/INPUTS/Cocoa_h.m new file mode 100644 index 0000000..e6ba599 --- /dev/null +++ b/INPUTS/Cocoa_h.m @@ -0,0 +1,2 @@ + +#import diff --git a/INPUTS/c99-intconst-1.c b/INPUTS/c99-intconst-1.c new file mode 100644 index 0000000..629b0bc --- /dev/null +++ b/INPUTS/c99-intconst-1.c @@ -0,0 +1,639 @@ +/* Test for integer constant types. */ + +/* Origin: Joseph Myers . */ +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ + +#include + +/* Assertion that constant C is of type T. */ +#define ASSERT_CONST_TYPE(C, T) \ + do { \ + typedef T type; \ + typedef type **typepp; \ + typedef __typeof__((C)) ctype; \ + typedef ctype **ctypepp; \ + typepp x = 0; \ + ctypepp y = 0; \ + x = y; \ + y = x; \ + } while (0) + +/* (T *) if E is zero, (void *) otherwise. */ +#define type_if_not(T, E) __typeof__(0 ? (T *)0 : (void *)(E)) + +/* (T *) if E is nonzero, (void *) otherwise. */ +#define type_if(T, E) type_if_not(T, !(E)) + +/* Combine pointer types, all but one (void *). */ +#define type_comb2(T1, T2) __typeof__(0 ? (T1)0 : (T2)0) +#define type_comb3(T1, T2, T3) type_comb2(T1, type_comb2(T2, T3)) +#define type_comb4(T1, T2, T3, T4) \ + type_comb2(T1, type_comb2(T2, type_comb2(T3, T4))) +#define type_comb6(T1, T2, T3, T4, T5, T6) \ + type_comb2(T1, \ + type_comb2(T2, \ + type_comb2(T3, \ + type_comb2(T4, \ + type_comb2(T5, T6))))) + +/* (T1 *) if E1, otherwise (T2 *) if E2. */ +#define first_of2p(T1, E1, T2, E2) type_comb2(type_if(T1, (E1)), \ + type_if(T2, (!(E1) && (E2)))) +/* (T1 *) if E1, otherwise (T2 *) if E2, otherwise (T3 *) if E3. */ +#define first_of3p(T1, E1, T2, E2, T3, E3) \ + type_comb3(type_if(T1, (E1)), \ + type_if(T2, (!(E1) && (E2))), \ + type_if(T3, (!(E1) && !(E2) && (E3)))) +/* (T1 *) if E1, otherwise (T2 *) if E2, otherwise (T3 *) if E3, otherwise + (T4 *) if E4. */ +#define first_of4p(T1, E1, T2, E2, T3, E3, T4, E4) \ + type_comb4(type_if(T1, (E1)), \ + type_if(T2, (!(E1) && (E2))), \ + type_if(T3, (!(E1) && !(E2) && (E3))), \ + type_if(T4, (!(E1) && !(E2) && !(E3) && (E4)))) +/* (T1 *) if E1, otherwise (T2 *) if E2, otherwise (T3 *) if E3, otherwise + (T4 *) if E4, otherwise (T5 *) if E5, otherwise (T6 *) if E6. */ +#define first_of6p(T1, E1, T2, E2, T3, E3, T4, E4, T5, E5, T6, E6) \ + type_comb6(type_if(T1, (E1)), \ + type_if(T2, (!(E1) && (E2))), \ + type_if(T3, (!(E1) && !(E2) && (E3))), \ + type_if(T4, (!(E1) && !(E2) && !(E3) && (E4))), \ + type_if(T5, (!(E1) && !(E2) && !(E3) && !(E4) && (E5))), \ + type_if(T6, (!(E1) && !(E2) && !(E3) \ + && !(E4) && !(E5) && (E6)))) + +/* Likewise, but return the original type rather than a pointer type. */ +#define first_of2(T1, E1, T2, E2) \ + __typeof__(*((first_of2p(T1, (E1), T2, (E2)))0)) +#define first_of3(T1, E1, T2, E2, T3, E3) \ + __typeof__(*((first_of3p(T1, (E1), T2, (E2), T3, (E3)))0)) +#define first_of4(T1, E1, T2, E2, T3, E3, T4, E4) \ + __typeof__(*((first_of4p(T1, (E1), T2, (E2), T3, (E3), T4, (E4)))0)) +#define first_of6(T1, E1, T2, E2, T3, E3, T4, E4, T5, E5, T6, E6) \ + __typeof__(*((first_of6p(T1, (E1), T2, (E2), T3, (E3), \ + T4, (E4), T5, (E5), T6, (E6)))0)) + +/* Types of constants according to the C99 rules. */ +#define C99_UNSUF_DEC_TYPE(C) \ + first_of3(int, (C) <= INT_MAX, \ + long int, (C) <= LONG_MAX, \ + long long int, (C) <= LLONG_MAX) +#define C99_UNSUF_OCTHEX_TYPE(C) \ + first_of6(int, (C) <= INT_MAX, \ + unsigned int, (C) <= UINT_MAX, \ + long int, (C) <= LONG_MAX, \ + unsigned long int, (C) <= ULONG_MAX, \ + long long int, (C) <= LLONG_MAX, \ + unsigned long long int, (C) <= ULLONG_MAX) +#define C99_SUFu_TYPE(C) \ + first_of3(unsigned int, (C) <= UINT_MAX, \ + unsigned long int, (C) <= ULONG_MAX, \ + unsigned long long int, (C) <= ULLONG_MAX) +#define C99_SUFl_DEC_TYPE(C) \ + first_of2(long int, (C) <= LONG_MAX, \ + long long int, (C) <= LLONG_MAX) +#define C99_SUFl_OCTHEX_TYPE(C) \ + first_of4(long int, (C) <= LONG_MAX, \ + unsigned long int, (C) <= ULONG_MAX, \ + long long int, (C) <= LLONG_MAX, \ + unsigned long long int, (C) <= ULLONG_MAX) +#define C99_SUFul_TYPE(C) \ + first_of2(unsigned long int, (C) <= ULONG_MAX, \ + unsigned long long int, (C) <= ULLONG_MAX) +#define C99_SUFll_OCTHEX_TYPE(C) \ + first_of2(long long int, (C) <= LLONG_MAX, \ + unsigned long long int, (C) <= ULLONG_MAX) + +/* Checks that constants have correct type. */ +#define CHECK_UNSUF_DEC_TYPE(C) ASSERT_CONST_TYPE((C), C99_UNSUF_DEC_TYPE((C))) +#define CHECK_UNSUF_OCTHEX_TYPE(C) \ + ASSERT_CONST_TYPE((C), C99_UNSUF_OCTHEX_TYPE((C))) +#define CHECK_SUFu_TYPE(C) ASSERT_CONST_TYPE((C), C99_SUFu_TYPE((C))) +#define CHECK_SUFl_DEC_TYPE(C) ASSERT_CONST_TYPE((C), C99_SUFl_DEC_TYPE((C))) +#define CHECK_SUFl_OCTHEX_TYPE(C) \ + ASSERT_CONST_TYPE((C), C99_SUFl_OCTHEX_TYPE((C))) +#define CHECK_SUFul_TYPE(C) ASSERT_CONST_TYPE((C), C99_SUFul_TYPE((C))) +#define CHECK_SUFll_DEC_TYPE(C) ASSERT_CONST_TYPE((C), long long int) +#define CHECK_SUFll_OCTHEX_TYPE(C) \ + ASSERT_CONST_TYPE((C), C99_SUFll_OCTHEX_TYPE((C))) +#define CHECK_SUFull_TYPE(C) ASSERT_CONST_TYPE((C), unsigned long long int) + +/* Check a decimal value, with all suffixes. */ +#define CHECK_DEC_CONST(C) \ + CHECK_UNSUF_DEC_TYPE(C); \ + CHECK_SUFu_TYPE(C##u); \ + CHECK_SUFu_TYPE(C##U); \ + CHECK_SUFl_DEC_TYPE(C##l); \ + CHECK_SUFl_DEC_TYPE(C##L); \ + CHECK_SUFul_TYPE(C##ul); \ + CHECK_SUFul_TYPE(C##uL); \ + CHECK_SUFul_TYPE(C##Ul); \ + CHECK_SUFul_TYPE(C##UL); \ + CHECK_SUFll_DEC_TYPE(C##ll); \ + CHECK_SUFll_DEC_TYPE(C##LL); \ + CHECK_SUFull_TYPE(C##ull); \ + CHECK_SUFull_TYPE(C##uLL); \ + CHECK_SUFull_TYPE(C##Ull); \ + CHECK_SUFull_TYPE(C##ULL); + +/* Check an octal or hexadecimal value, with all suffixes. */ +#define CHECK_OCTHEX_CONST(C) \ + CHECK_UNSUF_OCTHEX_TYPE(C); \ + CHECK_SUFu_TYPE(C##u); \ + CHECK_SUFu_TYPE(C##U); \ + CHECK_SUFl_OCTHEX_TYPE(C##l); \ + CHECK_SUFl_OCTHEX_TYPE(C##L); \ + CHECK_SUFul_TYPE(C##ul); \ + CHECK_SUFul_TYPE(C##uL); \ + CHECK_SUFul_TYPE(C##Ul); \ + CHECK_SUFul_TYPE(C##UL); \ + CHECK_SUFll_OCTHEX_TYPE(C##ll); \ + CHECK_SUFll_OCTHEX_TYPE(C##LL); \ + CHECK_SUFull_TYPE(C##ull); \ + CHECK_SUFull_TYPE(C##uLL); \ + CHECK_SUFull_TYPE(C##Ull); \ + CHECK_SUFull_TYPE(C##ULL); + +#define CHECK_OCT_CONST(C) CHECK_OCTHEX_CONST(C) +#define CHECK_HEX_CONST(C) \ + CHECK_OCTHEX_CONST(0x##C); \ + CHECK_OCTHEX_CONST(0X##C); + +/* True iff "long long" is at least B bits. This presumes that (B-2)/3 is at + most 63. */ +#define LLONG_AT_LEAST(B) \ + (LLONG_MAX >> ((B)-2)/3 >> ((B)-2)/3 \ + >> ((B)-2 - ((B)-2)/3 - ((B)-2)/3)) + +#define LLONG_HAS_BITS(B) (LLONG_AT_LEAST((B)) && !LLONG_AT_LEAST((B) + 1)) + +void +foo (void) +{ + /* Decimal. */ + /* Check all 2^n and 2^n - 1 up to 2^71 - 1. */ + CHECK_DEC_CONST(1); + CHECK_DEC_CONST(2); + CHECK_DEC_CONST(3); + CHECK_DEC_CONST(4); + CHECK_DEC_CONST(7); + CHECK_DEC_CONST(8); + CHECK_DEC_CONST(15); + CHECK_DEC_CONST(16); + CHECK_DEC_CONST(31); + CHECK_DEC_CONST(32); + CHECK_DEC_CONST(63); + CHECK_DEC_CONST(64); + CHECK_DEC_CONST(127); + CHECK_DEC_CONST(128); + CHECK_DEC_CONST(255); + CHECK_DEC_CONST(256); + CHECK_DEC_CONST(511); + CHECK_DEC_CONST(512); + CHECK_DEC_CONST(1023); + CHECK_DEC_CONST(1024); + CHECK_DEC_CONST(2047); + CHECK_DEC_CONST(2048); + CHECK_DEC_CONST(4095); + CHECK_DEC_CONST(4096); + CHECK_DEC_CONST(8191); + CHECK_DEC_CONST(8192); + CHECK_DEC_CONST(16383); + CHECK_DEC_CONST(16384); + CHECK_DEC_CONST(32767); + CHECK_DEC_CONST(32768); + CHECK_DEC_CONST(65535); + CHECK_DEC_CONST(65536); + CHECK_DEC_CONST(131071); + CHECK_DEC_CONST(131072); + CHECK_DEC_CONST(262143); + CHECK_DEC_CONST(262144); + CHECK_DEC_CONST(524287); + CHECK_DEC_CONST(524288); + CHECK_DEC_CONST(1048575); + CHECK_DEC_CONST(1048576); + CHECK_DEC_CONST(2097151); + CHECK_DEC_CONST(2097152); + CHECK_DEC_CONST(4194303); + CHECK_DEC_CONST(4194304); + CHECK_DEC_CONST(8388607); + CHECK_DEC_CONST(8388608); + CHECK_DEC_CONST(16777215); + CHECK_DEC_CONST(16777216); + CHECK_DEC_CONST(33554431); + CHECK_DEC_CONST(33554432); + CHECK_DEC_CONST(67108863); + CHECK_DEC_CONST(67108864); + CHECK_DEC_CONST(134217727); + CHECK_DEC_CONST(134217728); + CHECK_DEC_CONST(268435455); + CHECK_DEC_CONST(268435456); + CHECK_DEC_CONST(536870911); + CHECK_DEC_CONST(536870912); + CHECK_DEC_CONST(1073741823); + CHECK_DEC_CONST(1073741824); + CHECK_DEC_CONST(2147483647); + CHECK_DEC_CONST(2147483648); + CHECK_DEC_CONST(4294967295); + CHECK_DEC_CONST(4294967296); + CHECK_DEC_CONST(8589934591); + CHECK_DEC_CONST(8589934592); + CHECK_DEC_CONST(17179869183); + CHECK_DEC_CONST(17179869184); + CHECK_DEC_CONST(34359738367); + CHECK_DEC_CONST(34359738368); + CHECK_DEC_CONST(68719476735); + CHECK_DEC_CONST(68719476736); + CHECK_DEC_CONST(137438953471); + CHECK_DEC_CONST(137438953472); + CHECK_DEC_CONST(274877906943); + CHECK_DEC_CONST(274877906944); + CHECK_DEC_CONST(549755813887); + CHECK_DEC_CONST(549755813888); + CHECK_DEC_CONST(1099511627775); + CHECK_DEC_CONST(1099511627776); + CHECK_DEC_CONST(2199023255551); + CHECK_DEC_CONST(2199023255552); + CHECK_DEC_CONST(4398046511103); + CHECK_DEC_CONST(4398046511104); + CHECK_DEC_CONST(8796093022207); + CHECK_DEC_CONST(8796093022208); + CHECK_DEC_CONST(17592186044415); + CHECK_DEC_CONST(17592186044416); + CHECK_DEC_CONST(35184372088831); + CHECK_DEC_CONST(35184372088832); + CHECK_DEC_CONST(70368744177663); + CHECK_DEC_CONST(70368744177664); + CHECK_DEC_CONST(140737488355327); + CHECK_DEC_CONST(140737488355328); + CHECK_DEC_CONST(281474976710655); + CHECK_DEC_CONST(281474976710656); + CHECK_DEC_CONST(562949953421311); + CHECK_DEC_CONST(562949953421312); + CHECK_DEC_CONST(1125899906842623); + CHECK_DEC_CONST(1125899906842624); + CHECK_DEC_CONST(2251799813685247); + CHECK_DEC_CONST(2251799813685248); + CHECK_DEC_CONST(4503599627370495); + CHECK_DEC_CONST(4503599627370496); + CHECK_DEC_CONST(9007199254740991); + CHECK_DEC_CONST(9007199254740992); + CHECK_DEC_CONST(18014398509481983); + CHECK_DEC_CONST(18014398509481984); + CHECK_DEC_CONST(36028797018963967); + CHECK_DEC_CONST(36028797018963968); + CHECK_DEC_CONST(72057594037927935); + CHECK_DEC_CONST(72057594037927936); + CHECK_DEC_CONST(144115188075855871); + CHECK_DEC_CONST(144115188075855872); + CHECK_DEC_CONST(288230376151711743); + CHECK_DEC_CONST(288230376151711744); + CHECK_DEC_CONST(576460752303423487); + CHECK_DEC_CONST(576460752303423488); + CHECK_DEC_CONST(1152921504606846975); + CHECK_DEC_CONST(1152921504606846976); + CHECK_DEC_CONST(2305843009213693951); + CHECK_DEC_CONST(2305843009213693952); + CHECK_DEC_CONST(4611686018427387903); + CHECK_DEC_CONST(4611686018427387904); + CHECK_DEC_CONST(9223372036854775807); +#if LLONG_AT_LEAST(65) + CHECK_DEC_CONST(9223372036854775808); + CHECK_DEC_CONST(18446744073709551615); +#endif +#if LLONG_AT_LEAST(66) + CHECK_DEC_CONST(18446744073709551616); + CHECK_DEC_CONST(36893488147419103231); +#endif +#if LLONG_AT_LEAST(67) + CHECK_DEC_CONST(36893488147419103232); + CHECK_DEC_CONST(73786976294838206463); +#endif +#if LLONG_AT_LEAST(68) + CHECK_DEC_CONST(73786976294838206464); + CHECK_DEC_CONST(147573952589676412927); +#endif +#if LLONG_AT_LEAST(69) + CHECK_DEC_CONST(147573952589676412928); + CHECK_DEC_CONST(295147905179352825855); +#endif +#if LLONG_AT_LEAST(70) + CHECK_DEC_CONST(295147905179352825856); + CHECK_DEC_CONST(590295810358705651711); +#endif +#if LLONG_AT_LEAST(71) + CHECK_DEC_CONST(590295810358705651712); + CHECK_DEC_CONST(1180591620717411303423); +#endif +#if LLONG_AT_LEAST(72) + CHECK_DEC_CONST(1180591620717411303424); + CHECK_DEC_CONST(2361183241434822606847); +#endif + /* Octal and hexadecimal. */ + /* Check all 2^n and 2^n - 1 up to 2^72 - 1. */ + CHECK_OCT_CONST(0); + CHECK_HEX_CONST(0); + CHECK_OCT_CONST(01); + CHECK_HEX_CONST(1); + CHECK_OCT_CONST(02); + CHECK_HEX_CONST(2); + CHECK_OCT_CONST(03); + CHECK_HEX_CONST(3); + CHECK_OCT_CONST(04); + CHECK_HEX_CONST(4); + CHECK_OCT_CONST(07); + CHECK_HEX_CONST(7); + CHECK_OCT_CONST(010); + CHECK_HEX_CONST(8); + CHECK_OCT_CONST(017); + CHECK_HEX_CONST(f); + CHECK_OCT_CONST(020); + CHECK_HEX_CONST(10); + CHECK_OCT_CONST(037); + CHECK_HEX_CONST(1f); + CHECK_OCT_CONST(040); + CHECK_HEX_CONST(20); + CHECK_OCT_CONST(077); + CHECK_HEX_CONST(3f); + CHECK_OCT_CONST(0100); + CHECK_HEX_CONST(40); + CHECK_OCT_CONST(0177); + CHECK_HEX_CONST(7f); + CHECK_OCT_CONST(0200); + CHECK_HEX_CONST(80); + CHECK_OCT_CONST(0377); + CHECK_HEX_CONST(ff); + CHECK_OCT_CONST(0400); + CHECK_HEX_CONST(100); + CHECK_OCT_CONST(0777); + CHECK_HEX_CONST(1ff); + CHECK_OCT_CONST(01000); + CHECK_HEX_CONST(200); + CHECK_OCT_CONST(01777); + CHECK_HEX_CONST(3ff); + CHECK_OCT_CONST(02000); + CHECK_HEX_CONST(400); + CHECK_OCT_CONST(03777); + CHECK_HEX_CONST(7ff); + CHECK_OCT_CONST(04000); + CHECK_HEX_CONST(800); + CHECK_OCT_CONST(07777); + CHECK_HEX_CONST(fff); + CHECK_OCT_CONST(010000); + CHECK_HEX_CONST(1000); + CHECK_OCT_CONST(017777); + CHECK_HEX_CONST(1fff); + CHECK_OCT_CONST(020000); + CHECK_HEX_CONST(2000); + CHECK_OCT_CONST(037777); + CHECK_HEX_CONST(3fff); + CHECK_OCT_CONST(040000); + CHECK_HEX_CONST(4000); + CHECK_OCT_CONST(077777); + CHECK_HEX_CONST(7fff); + CHECK_OCT_CONST(0100000); + CHECK_HEX_CONST(8000); + CHECK_OCT_CONST(0177777); + CHECK_HEX_CONST(ffff); + CHECK_OCT_CONST(0200000); + CHECK_HEX_CONST(10000); + CHECK_OCT_CONST(0377777); + CHECK_HEX_CONST(1ffff); + CHECK_OCT_CONST(0400000); + CHECK_HEX_CONST(20000); + CHECK_OCT_CONST(0777777); + CHECK_HEX_CONST(3ffff); + CHECK_OCT_CONST(01000000); + CHECK_HEX_CONST(40000); + CHECK_OCT_CONST(01777777); + CHECK_HEX_CONST(7ffff); + CHECK_OCT_CONST(02000000); + CHECK_HEX_CONST(80000); + CHECK_OCT_CONST(03777777); + CHECK_HEX_CONST(fffff); + CHECK_OCT_CONST(04000000); + CHECK_HEX_CONST(100000); + CHECK_OCT_CONST(07777777); + CHECK_HEX_CONST(1fffff); + CHECK_OCT_CONST(010000000); + CHECK_HEX_CONST(200000); + CHECK_OCT_CONST(017777777); + CHECK_HEX_CONST(3fffff); + CHECK_OCT_CONST(020000000); + CHECK_HEX_CONST(400000); + CHECK_OCT_CONST(037777777); + CHECK_HEX_CONST(7fffff); + CHECK_OCT_CONST(040000000); + CHECK_HEX_CONST(800000); + CHECK_OCT_CONST(077777777); + CHECK_HEX_CONST(ffffff); + CHECK_OCT_CONST(0100000000); + CHECK_HEX_CONST(1000000); + CHECK_OCT_CONST(0177777777); + CHECK_HEX_CONST(1ffffff); + CHECK_OCT_CONST(0200000000); + CHECK_HEX_CONST(2000000); + CHECK_OCT_CONST(0377777777); + CHECK_HEX_CONST(3ffffff); + CHECK_OCT_CONST(0400000000); + CHECK_HEX_CONST(4000000); + CHECK_OCT_CONST(0777777777); + CHECK_HEX_CONST(7ffffff); + CHECK_OCT_CONST(01000000000); + CHECK_HEX_CONST(8000000); + CHECK_OCT_CONST(01777777777); + CHECK_HEX_CONST(fffffff); + CHECK_OCT_CONST(02000000000); + CHECK_HEX_CONST(10000000); + CHECK_OCT_CONST(03777777777); + CHECK_HEX_CONST(1fffffff); + CHECK_OCT_CONST(04000000000); + CHECK_HEX_CONST(20000000); + CHECK_OCT_CONST(07777777777); + CHECK_HEX_CONST(3fffffff); + CHECK_OCT_CONST(010000000000); + CHECK_HEX_CONST(40000000); + CHECK_OCT_CONST(017777777777); + CHECK_HEX_CONST(7fffffff); + CHECK_OCT_CONST(020000000000); + CHECK_HEX_CONST(80000000); + CHECK_OCT_CONST(037777777777); + CHECK_HEX_CONST(ffffffff); + CHECK_OCT_CONST(040000000000); + CHECK_HEX_CONST(100000000); + CHECK_OCT_CONST(077777777777); + CHECK_HEX_CONST(1ffffffff); + CHECK_OCT_CONST(0100000000000); + CHECK_HEX_CONST(200000000); + CHECK_OCT_CONST(0177777777777); + CHECK_HEX_CONST(3ffffffff); + CHECK_OCT_CONST(0200000000000); + CHECK_HEX_CONST(400000000); + CHECK_OCT_CONST(0377777777777); + CHECK_HEX_CONST(7ffffffff); + CHECK_OCT_CONST(0400000000000); + CHECK_HEX_CONST(800000000); + CHECK_OCT_CONST(0777777777777); + CHECK_HEX_CONST(fffffffff); + CHECK_OCT_CONST(01000000000000); + CHECK_HEX_CONST(1000000000); + CHECK_OCT_CONST(01777777777777); + CHECK_HEX_CONST(1fffffffff); + CHECK_OCT_CONST(02000000000000); + CHECK_HEX_CONST(2000000000); + CHECK_OCT_CONST(03777777777777); + CHECK_HEX_CONST(3fffffffff); + CHECK_OCT_CONST(04000000000000); + CHECK_HEX_CONST(4000000000); + CHECK_OCT_CONST(07777777777777); + CHECK_HEX_CONST(7fffffffff); + CHECK_OCT_CONST(010000000000000); + CHECK_HEX_CONST(8000000000); + CHECK_OCT_CONST(017777777777777); + CHECK_HEX_CONST(ffffffffff); + CHECK_OCT_CONST(020000000000000); + CHECK_HEX_CONST(10000000000); + CHECK_OCT_CONST(037777777777777); + CHECK_HEX_CONST(1ffffffffff); + CHECK_OCT_CONST(040000000000000); + CHECK_HEX_CONST(20000000000); + CHECK_OCT_CONST(077777777777777); + CHECK_HEX_CONST(3ffffffffff); + CHECK_OCT_CONST(0100000000000000); + CHECK_HEX_CONST(40000000000); + CHECK_OCT_CONST(0177777777777777); + CHECK_HEX_CONST(7ffffffffff); + CHECK_OCT_CONST(0200000000000000); + CHECK_HEX_CONST(80000000000); + CHECK_OCT_CONST(0377777777777777); + CHECK_HEX_CONST(fffffffffff); + CHECK_OCT_CONST(0400000000000000); + CHECK_HEX_CONST(100000000000); + CHECK_OCT_CONST(0777777777777777); + CHECK_HEX_CONST(1fffffffffff); + CHECK_OCT_CONST(01000000000000000); + CHECK_HEX_CONST(200000000000); + CHECK_OCT_CONST(01777777777777777); + CHECK_HEX_CONST(3fffffffffff); + CHECK_OCT_CONST(02000000000000000); + CHECK_HEX_CONST(400000000000); + CHECK_OCT_CONST(03777777777777777); + CHECK_HEX_CONST(7fffffffffff); + CHECK_OCT_CONST(04000000000000000); + CHECK_HEX_CONST(800000000000); + CHECK_OCT_CONST(07777777777777777); + CHECK_HEX_CONST(ffffffffffff); + CHECK_OCT_CONST(010000000000000000); + CHECK_HEX_CONST(1000000000000); + CHECK_OCT_CONST(017777777777777777); + CHECK_HEX_CONST(1ffffffffffff); + CHECK_OCT_CONST(020000000000000000); + CHECK_HEX_CONST(2000000000000); + CHECK_OCT_CONST(037777777777777777); + CHECK_HEX_CONST(3ffffffffffff); + CHECK_OCT_CONST(040000000000000000); + CHECK_HEX_CONST(4000000000000); + CHECK_OCT_CONST(077777777777777777); + CHECK_HEX_CONST(7ffffffffffff); + CHECK_OCT_CONST(0100000000000000000); + CHECK_HEX_CONST(8000000000000); + CHECK_OCT_CONST(0177777777777777777); + CHECK_HEX_CONST(fffffffffffff); + CHECK_OCT_CONST(0200000000000000000); + CHECK_HEX_CONST(10000000000000); + CHECK_OCT_CONST(0377777777777777777); + CHECK_HEX_CONST(1fffffffffffff); + CHECK_OCT_CONST(0400000000000000000); + CHECK_HEX_CONST(20000000000000); + CHECK_OCT_CONST(0777777777777777777); + CHECK_HEX_CONST(3fffffffffffff); + CHECK_OCT_CONST(01000000000000000000); + CHECK_HEX_CONST(40000000000000); + CHECK_OCT_CONST(01777777777777777777); + CHECK_HEX_CONST(7fffffffffffff); + CHECK_OCT_CONST(02000000000000000000); + CHECK_HEX_CONST(80000000000000); + CHECK_OCT_CONST(03777777777777777777); + CHECK_HEX_CONST(ffffffffffffff); + CHECK_OCT_CONST(04000000000000000000); + CHECK_HEX_CONST(100000000000000); + CHECK_OCT_CONST(07777777777777777777); + CHECK_HEX_CONST(1ffffffffffffff); + CHECK_OCT_CONST(010000000000000000000); + CHECK_HEX_CONST(200000000000000); + CHECK_OCT_CONST(017777777777777777777); + CHECK_HEX_CONST(3ffffffffffffff); + CHECK_OCT_CONST(020000000000000000000); + CHECK_HEX_CONST(400000000000000); + CHECK_OCT_CONST(037777777777777777777); + CHECK_HEX_CONST(7ffffffffffffff); + CHECK_OCT_CONST(040000000000000000000); + CHECK_HEX_CONST(800000000000000); + CHECK_OCT_CONST(077777777777777777777); + CHECK_HEX_CONST(fffffffffffffff); + CHECK_OCT_CONST(0100000000000000000000); + CHECK_HEX_CONST(1000000000000000); + CHECK_OCT_CONST(0177777777777777777777); + CHECK_HEX_CONST(1fffffffffffffff); + CHECK_OCT_CONST(0200000000000000000000); + CHECK_HEX_CONST(2000000000000000); + CHECK_OCT_CONST(0377777777777777777777); + CHECK_HEX_CONST(3fffffffffffffff); + CHECK_OCT_CONST(0400000000000000000000); + CHECK_HEX_CONST(4000000000000000); + CHECK_OCT_CONST(0777777777777777777777); + CHECK_HEX_CONST(7fffffffffffffff); + CHECK_OCT_CONST(01000000000000000000000); + CHECK_HEX_CONST(8000000000000000); + CHECK_OCT_CONST(01777777777777777777777); + CHECK_HEX_CONST(ffffffffffffffff); +#if LLONG_AT_LEAST(65) + CHECK_OCT_CONST(02000000000000000000000); + CHECK_HEX_CONST(10000000000000000); + CHECK_OCT_CONST(03777777777777777777777); + CHECK_HEX_CONST(1ffffffffffffffff); +#endif +#if LLONG_AT_LEAST(66) + CHECK_OCT_CONST(04000000000000000000000); + CHECK_HEX_CONST(20000000000000000); + CHECK_OCT_CONST(07777777777777777777777); + CHECK_HEX_CONST(3ffffffffffffffff); +#endif +#if LLONG_AT_LEAST(67) + CHECK_OCT_CONST(010000000000000000000000); + CHECK_HEX_CONST(40000000000000000); + CHECK_OCT_CONST(017777777777777777777777); + CHECK_HEX_CONST(7ffffffffffffffff); +#endif +#if LLONG_AT_LEAST(68) + CHECK_OCT_CONST(020000000000000000000000); + CHECK_HEX_CONST(80000000000000000); + CHECK_OCT_CONST(037777777777777777777777); + CHECK_HEX_CONST(fffffffffffffffff); +#endif +#if LLONG_AT_LEAST(69) + CHECK_OCT_CONST(040000000000000000000000); + CHECK_HEX_CONST(100000000000000000); + CHECK_OCT_CONST(077777777777777777777777); + CHECK_HEX_CONST(1fffffffffffffffff); +#endif +#if LLONG_AT_LEAST(70) + CHECK_OCT_CONST(0100000000000000000000000); + CHECK_HEX_CONST(200000000000000000); + CHECK_OCT_CONST(0177777777777777777777777); + CHECK_HEX_CONST(3fffffffffffffffff); +#endif +#if LLONG_AT_LEAST(71) + CHECK_OCT_CONST(0200000000000000000000000); + CHECK_HEX_CONST(400000000000000000); + CHECK_OCT_CONST(0377777777777777777777777); + CHECK_HEX_CONST(7fffffffffffffffff); +#endif +#if LLONG_AT_LEAST(72) + CHECK_OCT_CONST(0400000000000000000000000); + CHECK_HEX_CONST(800000000000000000); + CHECK_OCT_CONST(0777777777777777777777777); + CHECK_HEX_CONST(ffffffffffffffffff); +#endif +} diff --git a/INPUTS/carbon_h.c b/INPUTS/carbon_h.c new file mode 100644 index 0000000..599f123 --- /dev/null +++ b/INPUTS/carbon_h.c @@ -0,0 +1,4 @@ + +#include + +//#import diff --git a/INPUTS/iostream.cc b/INPUTS/iostream.cc new file mode 100644 index 0000000..eb12fc9 --- /dev/null +++ b/INPUTS/iostream.cc @@ -0,0 +1,5 @@ +// clang -I/usr/include/c++/4.0.0 -I/usr/include/c++/4.0.0/powerpc-apple-darwin8 -I/usr/include/c++/4.0.0/backward INPUTS/iostream.cc -Eonly + +#include + +#include diff --git a/INPUTS/macro_pounder_fn.c b/INPUTS/macro_pounder_fn.c new file mode 100644 index 0000000..73f40a1 --- /dev/null +++ b/INPUTS/macro_pounder_fn.c @@ -0,0 +1,17 @@ + +// This pounds on macro expansion for performance reasons. This is currently +// heavily constrained by darwin's malloc. + +// Function-like macros. +#define A0(A, B) A B +#define A1(A, B) A0(A,B) A0(A,B) A0(A,B) A0(A,B) A0(A,B) A0(A,B) +#define A2(A, B) A1(A,B) A1(A,B) A1(A,B) A1(A,B) A1(A,B) A1(A,B) +#define A3(A, B) A2(A,B) A2(A,B) A2(A,B) A2(A,B) A2(A,B) A2(A,B) +#define A4(A, B) A3(A,B) A3(A,B) A3(A,B) A3(A,B) A3(A,B) A3(A,B) +#define A5(A, B) A4(A,B) A4(A,B) A4(A,B) A4(A,B) A4(A,B) A4(A,B) +#define A6(A, B) A5(A,B) A5(A,B) A5(A,B) A5(A,B) A5(A,B) A5(A,B) +#define A7(A, B) A6(A,B) A6(A,B) A6(A,B) A6(A,B) A6(A,B) A6(A,B) +#define A8(A, B) A7(A,B) A7(A,B) A7(A,B) A7(A,B) A7(A,B) A7(A,B) + +A8(a, b) + diff --git a/INPUTS/macro_pounder_obj.c b/INPUTS/macro_pounder_obj.c new file mode 100644 index 0000000..d2465f3 --- /dev/null +++ b/INPUTS/macro_pounder_obj.c @@ -0,0 +1,16 @@ + +// This pounds on macro expansion for performance reasons. This is currently +// heavily constrained by darwin's malloc. + +// Object-like expansions +#define A0 a b +#define A1 A0 A0 A0 A0 A0 A0 +#define A2 A1 A1 A1 A1 A1 A1 +#define A3 A2 A2 A2 A2 A2 A2 +#define A4 A3 A3 A3 A3 A3 A3 +#define A5 A4 A4 A4 A4 A4 A4 +#define A6 A5 A5 A5 A5 A5 A5 +#define A7 A6 A6 A6 A6 A6 A6 +#define A8 A7 A7 A7 A7 A7 A7 + +A8 diff --git a/INPUTS/stpcpy-test.c b/INPUTS/stpcpy-test.c new file mode 100644 index 0000000..b96a806 --- /dev/null +++ b/INPUTS/stpcpy-test.c @@ -0,0 +1,47 @@ +#define __extension__ + +#define __stpcpy(dest, src) (__extension__ (__builtin_constant_p (src) ? (__string2_1bptr_p (src) && strlen (src) + 1 <= 8 ? __stpcpy_small (dest, __stpcpy_args (src), strlen (src) + 1) : ((char *) __mempcpy (dest, src, strlen (src) + 1) - 1)) : __stpcpy (dest, src))) +#define stpcpy(dest, src) __stpcpy (dest, src) +#define __stpcpy_args(src) __extension__ __STRING2_SMALL_GET16 (src, 0), __extension__ __STRING2_SMALL_GET16 (src, 4), __extension__ __STRING2_SMALL_GET32 (src, 0), __extension__ __STRING2_SMALL_GET32 (src, 4) + +#define __mempcpy(dest, src, n) (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) && __string2_1bptr_p (src) && n <= 8 ? __mempcpy_small (dest, __mempcpy_args (src), n) : __mempcpy (dest, src, n))) +#define mempcpy(dest, src, n) __mempcpy (dest, src, n) +#define __mempcpy_args(src) ((char *) (src))[0], ((char *) (src))[2], ((char *) (src))[4], ((char *) (src))[6], __extension__ __STRING2_SMALL_GET16 (src, 0), __extension__ __STRING2_SMALL_GET16 (src, 4), __extension__ __STRING2_SMALL_GET32 (src, 0), __extension__ __STRING2_SMALL_GET32 (src, 4) + +#define __STRING2_SMALL_GET16(src, idx) (((__const unsigned char *) (__const char *) (src))[idx + 1] << 8 | ((__const unsigned char *) (__const char *) (src))[idx]) + +#define __STRING2_SMALL_GET32(src, idx) (((((__const unsigned char *) (__const char *) (src))[idx + 3] << 8 | ((__const unsigned char *) (__const char *) (src))[idx + 2]) << 8 | ((__const unsigned char *) (__const char *) (src))[idx + 1]) << 8 | ((__const unsigned char *) (__const char *) (src))[idx]) + +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) +stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e) diff --git a/LICENSE.TXT b/LICENSE.TXT new file mode 100644 index 0000000..21cb5c7 --- /dev/null +++ b/LICENSE.TXT @@ -0,0 +1,63 @@ +============================================================================== +LLVM Release License +============================================================================== +University of Illinois/NCSA +Open Source License + +Copyright (c) 2007 University of Illinois at Urbana-Champaign. +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +============================================================================== +The LLVM software contains code written by third parties. Such software will +have its own individual LICENSE.TXT file in the directory in which it appears. +This file will describe the copyrights, license, and restrictions which apply +to that code. + +The disclaimer of warranty in the University of Illinois Open Source License +applies to all code in the LLVM Distribution, and nothing in any of the +other licenses gives permission to use the names of the LLVM Team or the +University of Illinois to endorse or promote products derived from this +Software. + +The following pieces of software have additional or alternate copyrights, +licenses, and/or restrictions: + +Program Directory +------- --------- + + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..00e38d2 --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +LEVEL = ../.. +DIRS := include lib tools docs + +include $(LEVEL)/Makefile.common + +ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) +test:: + $(Verb) if [ ! -f test/Makefile ]; then \ + $(MKDIR) test; \ + $(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \ + fi +endif + +test:: + @ $(MAKE) -C test + +report:: + @ $(MAKE) -C test report + +clean:: + @ $(MAKE) -C test clean + +tags:: + $(Verb) etags `find . -type f -name \*.h | grep -v /lib/Headers | grep -v /test/` `find . -type f -name \*.cpp | grep -v /lib/Headers | grep -v /test/` + +cscope.files: + find tools lib include -name '*.cpp' \ + -or -name '*.def' \ + -or -name '*.td' \ + -or -name '*.h' > cscope.files + +.PHONY: test report clean cscope.files diff --git a/ModuleInfo.txt b/ModuleInfo.txt new file mode 100644 index 0000000..4368ef0 --- /dev/null +++ b/ModuleInfo.txt @@ -0,0 +1,5 @@ +# This file provides information for llvm-top +DepModule: llvm +ConfigCmd: +ConfigTest: +BuildCmd: diff --git a/NOTES.txt b/NOTES.txt new file mode 100644 index 0000000..3b5ad16 --- /dev/null +++ b/NOTES.txt @@ -0,0 +1,86 @@ +//===---------------------------------------------------------------------===// +// Random Notes +//===---------------------------------------------------------------------===// + +C90/C99/C++ Comparisons: +http://david.tribble.com/text/cdiffs.htm + +//===---------------------------------------------------------------------===// + +To time GCC preprocessing speed without output, use: + "time gcc -MM file" +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 + +//===---------------------------------------------------------------------===// + + C++ Template Instantiation benchmark: + http://users.rcn.com/abrahams/instantiation_speed/index.html + +//===---------------------------------------------------------------------===// + +TODO: File Manager Speedup: + + We currently do a lot of stat'ing for files that don't exist, particularly + when lots of -I paths exist (e.g. see the example, check for + failures in stat in FileManager::getFile). It would be far better to make + the following changes: + 1. FileEntry contains a sys::Path instead of a std::string for Name. + 2. sys::Path contains timestamp and size, lazily computed. Eliminate from + FileEntry. + 3. File UIDs are created on request, not when files are opened. + These changes make it possible to efficiently have FileEntry objects for + files that exist on the file system, but have not been used yet. + + Once this is done: + 1. DirectoryEntry gets a boolean value "has read entries". When false, not + all entries in the directory are in the file mgr, when true, they are. + 2. Instead of stat'ing the file in FileManager::getFile, check to see if + the dir has been read. If so, fail immediately, if not, read the dir, + then retry. + 3. Reading the dir uses the getdirentries syscall, creating an FileEntry + for all files found. + +//===---------------------------------------------------------------------===// +// Specifying targets: -triple and -arch +===---------------------------------------------------------------------===// + +The clang supports "-triple" and "-arch" options. At most one -triple and one +-arch option may be specified. Both are optional. + +The "selection of target" behavior is defined as follows: + +(1) If the user does not specify -triple, we default to the host triple. +(2) If the user specifies a -arch, that overrides the arch in the host or + specified triple. + +//===---------------------------------------------------------------------===// + + +verifyInputConstraint and verifyOutputConstraint should not return bool. + +Instead we should return something like: + +enum VerifyConstraintResult { + Valid, + + // Output only + OutputOperandConstraintLacksEqualsCharacter, + MatchingConstraintNotValidInOutputOperand, + + // Input only + InputOperandConstraintContainsEqualsCharacter, + MatchingConstraintReferencesInvalidOperandNumber, + + // Both + PercentConstraintUsedWithLastOperand +}; + +//===---------------------------------------------------------------------===// diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..611dc9d --- /dev/null +++ b/README.txt @@ -0,0 +1,178 @@ +//===----------------------------------------------------------------------===// +// 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. + + 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? :) + + 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. + + 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. + + 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. :) + diff --git a/TODO.txt b/TODO.txt new file mode 100644 index 0000000..522dcd3 --- /dev/null +++ b/TODO.txt @@ -0,0 +1,68 @@ +//===---------------------------------------------------------------------===// +// Minor random things that can be improved +//===---------------------------------------------------------------------===// + + +Warn about "X && 0x1000" saying that the user may mean "X & 0x1000". +We should do this for any immediate except zero, so long as it doesn't come +from a macro expansion. Likewise for ||. + +//===---------------------------------------------------------------------===// + +Lexer-related diagnostics should point to the problematic character, not the +start of the token. For example: + +int y = 0000\ +00080; + +diag.c:4:9: error: invalid digit '8' in octal constant +int y = 0000\ + ^ + +should be: + +diag.c:4:9: error: invalid digit '8' in octal constant +00080; + ^ + +This specific diagnostic is implemented, but others should be updated. + +//===---------------------------------------------------------------------===// + +C++ (checker): For iterators, warn of the use of "iterator++" instead + of "++iterator" when when the value returned by operator++(int) is + ignored. + +//===---------------------------------------------------------------------===// + +We want to keep more source range information in Declarator to help +produce better diagnostics. Declarator::getSourceRange() should be +implemented to give a range for the whole declarator with all of its +specifiers, and DeclaratorChunk::ParamInfo should also have a source +range covering the whole parameter, so that an error message like this: + +overloaded-operator-decl.cpp:37:23: error: parameter of overloaded post-increment operator must have type 'int' (not 'float') +X operator++(X&, const float& f); + ^ +can be turned into something like this: + +overloaded-operator-decl.cpp:37:23: error: parameter of overloaded post-increment operator must have type 'int' (not 'float') +X operator++(X&, const float& f); + ^ ~~~~~~~~~~~~~~ + +//===---------------------------------------------------------------------===// + +For terminal output, we should consider limiting the amount of +diagnostic text we print once the first error has been +encountered. For example, once we have produced an error diagnostic, +we should only continue producing diagnostics until we have produced a +page full of results (say, 50 lines of text). Beyond that, (1) the +remaining errors are likely to be less interesting, and (2) the poor +user has to scroll his terminal to find out where things went wrong. + +//===---------------------------------------------------------------------===// +More ideas for code modification hints: + - If no member of a given name is found in a class/struct, search through the names of entities that do exist in the class and suggest the closest candidate. e.g., if I write "DS.setTypeSpecType", it would suggest "DS.SetTypeSpecType" (edit distance = 1). + - If a class member is defined out-of-line but isn't in the class declaration (and there are no close matches!), provide the option to add an in-class declaration. + - Fix-it hints for the inclusion of headers when needed for particular features (e.g., for typeid) + - Change "foo.bar" to "foo->bar" when "foo" is a pointer. diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c0ccb2e --- /dev/null +++ b/clang.xcodeproj/project.pbxproj @@ -0,0 +1,1836 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXBuildFile section */ + 03F50AC60D416EAA00B9CF60 /* Targets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 03F50AC50D416EAA00B9CF60 /* Targets.cpp */; }; + 1A2193CE0F45EEB700C0713D /* Mangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2193CC0F45EEB700C0713D /* Mangle.cpp */; }; + 1A2A54B50FD1DD1C00F4CE45 /* AnalysisConsumer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54A40FD1DD1C00F4CE45 /* AnalysisConsumer.cpp */; }; + 1A2A54B60FD1DD1C00F4CE45 /* ASTConsumers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54A50FD1DD1C00F4CE45 /* ASTConsumers.cpp */; }; + 1A2A54B70FD1DD1C00F4CE45 /* Backend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54A60FD1DD1C00F4CE45 /* Backend.cpp */; }; + 1A2A54B80FD1DD1C00F4CE45 /* CacheTokens.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54A70FD1DD1C00F4CE45 /* CacheTokens.cpp */; }; + 1A2A54B90FD1DD1C00F4CE45 /* DependencyFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54A80FD1DD1C00F4CE45 /* DependencyFile.cpp */; }; + 1A2A54BA0FD1DD1C00F4CE45 /* DiagChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54A90FD1DD1C00F4CE45 /* DiagChecker.cpp */; }; + 1A2A54BB0FD1DD1C00F4CE45 /* DocumentXML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54AA0FD1DD1C00F4CE45 /* DocumentXML.cpp */; }; + 1A2A54BC0FD1DD1C00F4CE45 /* GeneratePCH.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54AB0FD1DD1C00F4CE45 /* GeneratePCH.cpp */; }; + 1A2A54BD0FD1DD1C00F4CE45 /* HTMLPrint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54AC0FD1DD1C00F4CE45 /* HTMLPrint.cpp */; }; + 1A2A54BE0FD1DD1C00F4CE45 /* PrintParserCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54AD0FD1DD1C00F4CE45 /* PrintParserCallbacks.cpp */; }; + 1A2A54BF0FD1DD1C00F4CE45 /* PrintPreprocessedOutput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54AE0FD1DD1C00F4CE45 /* PrintPreprocessedOutput.cpp */; }; + 1A2A54C00FD1DD1C00F4CE45 /* RewriteBlocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54AF0FD1DD1C00F4CE45 /* RewriteBlocks.cpp */; }; + 1A2A54C10FD1DD1C00F4CE45 /* RewriteMacros.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54B00FD1DD1C00F4CE45 /* RewriteMacros.cpp */; }; + 1A2A54C20FD1DD1C00F4CE45 /* RewriteObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54B10FD1DD1C00F4CE45 /* RewriteObjC.cpp */; }; + 1A2A54C30FD1DD1C00F4CE45 /* RewriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54B20FD1DD1C00F4CE45 /* RewriteTest.cpp */; }; + 1A2A54C40FD1DD1C00F4CE45 /* StmtXML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54B30FD1DD1C00F4CE45 /* StmtXML.cpp */; }; + 1A2A54C50FD1DD1C00F4CE45 /* Warnings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54B40FD1DD1C00F4CE45 /* Warnings.cpp */; }; + 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 */; }; + 1A5D5E580E5E81010023C059 /* CGCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5D5E570E5E81010023C059 /* CGCXX.cpp */; }; + 1A701B640F7C8FE400FEC4D1 /* SemaAccess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A701B630F7C8FE400FEC4D1 /* SemaAccess.cpp */; }; + 1A7342480C7B57D500122F56 /* CGObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7342470C7B57D500122F56 /* CGObjC.cpp */; }; + 1A869A700BA2164C008DA07A /* LiteralSupport.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1A869A6E0BA2164C008DA07A /* LiteralSupport.h */; }; + 1A869AA80BA21ABA008DA07A /* LiteralSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A869AA70BA21ABA008DA07A /* LiteralSupport.cpp */; }; + 1ABC36940C7A4BDC006DB0AB /* CGBuiltin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ABC36930C7A4BDC006DB0AB /* CGBuiltin.cpp */; }; + 1ADF47AF0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ADF47AE0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp */; }; + 1AFEF4070F8A6B2300476F2B /* clang-cc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFEF4050F8A6B2300476F2B /* clang-cc.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 */; }; + 352246E90F5C6BE000D0D279 /* ManagerRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 352246E30F5C6BE000D0D279 /* ManagerRegistry.cpp */; }; + 352246EA0F5C6BE000D0D279 /* PlistDiagnostics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 352246E40F5C6BE000D0D279 /* PlistDiagnostics.cpp */; }; + 352246EB0F5C6BE000D0D279 /* TextDiagnosticBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 352246E50F5C6BE000D0D279 /* TextDiagnosticBuffer.cpp */; }; + 352246EC0F5C6BE000D0D279 /* TextDiagnosticPrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 352246E60F5C6BE000D0D279 /* TextDiagnosticPrinter.cpp */; }; + 35260CA50C7F75C000D66CE9 /* ExprCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35260CA40C7F75C000D66CE9 /* ExprCXX.cpp */; }; + 352712510DAFE54700C76352 /* IdentifierResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 352712500DAFE54700C76352 /* IdentifierResolver.cpp */; }; + 3534A01D0E129849002709B2 /* ParseCXXInlineMethods.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3534A01C0E129849002709B2 /* ParseCXXInlineMethods.cpp */; }; + 3536456B0E23EBF7009C6509 /* Environment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3536456A0E23EBF7009C6509 /* Environment.cpp */; }; + 3537AA0E0ECD08A4008F7CDC /* PreprocessorLexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3537AA0D0ECD08A4008F7CDC /* PreprocessorLexer.cpp */; }; + 3538FDB80ED24A4E005EC283 /* DeclarationName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3538FDB70ED24A4E005EC283 /* DeclarationName.cpp */; }; + 353959D50EE5F88A00E82461 /* ParseTemplate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 353959D40EE5F88A00E82461 /* ParseTemplate.cpp */; }; + 35475B200E79973F0000BFE4 /* CGCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35475B1F0E79973F0000BFE4 /* CGCall.cpp */; }; + 355106860E9A8507006A4E44 /* MemRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 355106850E9A8507006A4E44 /* MemRegion.cpp */; }; + 3551068C0E9A8546006A4E44 /* ParsePragma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3551068A0E9A8546006A4E44 /* ParsePragma.cpp */; }; + 3551068D0E9A8546006A4E44 /* ParseTentative.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3551068B0E9A8546006A4E44 /* ParseTentative.cpp */; }; + 3552E7550E520D80003A8CA5 /* PPCaching.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3552E7540E520D80003A8CA5 /* PPCaching.cpp */; }; + 3552E7590E520DD7003A8CA5 /* CGObjCMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3552E7580E520DD7003A8CA5 /* CGObjCMac.cpp */; }; + 35544B880F5C7FD700D92AA9 /* RangeConstraintManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35544B850F5C7FD700D92AA9 /* RangeConstraintManager.cpp */; }; + 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 */; }; + 35707EFE0CD0F5CC000B2204 /* SourceLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35707EFD0CD0F5CC000B2204 /* SourceLocation.cpp */; }; + 357EA27D0F2526F300439B60 /* SemaLookup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 357EA27C0F2526F300439B60 /* SemaLookup.cpp */; }; + 35847BE50CC7DBAF00C40FFF /* StmtIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35847BE40CC7DBAF00C40FFF /* StmtIterator.cpp */; }; + 35862B0D0E3628CB0009F542 /* CheckDeadStores.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35862B0C0E3628CB0009F542 /* CheckDeadStores.cpp */; }; + 35862B120E3629850009F542 /* GRExprEngineInternalChecks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35862B110E3629850009F542 /* GRExprEngineInternalChecks.cpp */; }; + 358CFBB80E65AB04002A8E19 /* BasicConstraintManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 358CFBB70E65AB04002A8E19 /* BasicConstraintManager.cpp */; }; + 358D230B0E8BEB9D0003DDCC /* DeclGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 358D230A0E8BEB9D0003DDCC /* DeclGroup.cpp */; }; + 358F51520E529AA4007F2102 /* GRState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 358F51510E529AA4007F2102 /* GRState.cpp */; }; + 3591853F0EFB1088000039AF /* SemaTemplate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3591853E0EFB1088000039AF /* SemaTemplate.cpp */; }; + 3593790A0DA48ABA0043B19C /* BugReporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 359379090DA48ABA0043B19C /* BugReporter.cpp */; }; + 3595AFB80E1C8D62004CDF09 /* CheckObjCDealloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3595AFB70E1C8D62004CDF09 /* CheckObjCDealloc.cpp */; }; + 3599299B0DE2425300A8A33E /* SemaInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3599299A0DE2425300A8A33E /* SemaInit.cpp */; }; + 35A057E20EAE2D950069249F /* RegionStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35A057E00EAE2D950069249F /* RegionStore.cpp */; }; + 35A057E30EAE2D950069249F /* SVals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35A057E10EAE2D950069249F /* SVals.cpp */; }; + 35A3E7020DD3874400757F74 /* CGDebugInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35A3E7000DD3874400757F74 /* CGDebugInfo.cpp */; }; + 35A8FCF90D9B4B2A001C2F97 /* PathDiagnostic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35A8FCF80D9B4B29001C2F97 /* PathDiagnostic.cpp */; }; + 35BAC1E80E82C5B7003FB76F /* CheckNSError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35BAC1E70E82C5B7003FB76F /* CheckNSError.cpp */; }; + 35BB2D7F0D19954000944DB5 /* ASTConsumer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35BB2D7E0D19954000944DB5 /* ASTConsumer.cpp */; }; + 35CFFE000CA1CBCB00E6F2BE /* StmtViz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35CFFDFF0CA1CBCB00E6F2BE /* StmtViz.cpp */; }; + 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 */; }; + 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 */; }; + 35EF67700DAD1D2C00B19414 /* SemaDeclCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35EF676F0DAD1D2C00B19414 /* SemaDeclCXX.cpp */; }; + 35EFEFB60DB67ED60020783D /* GRTransferFuncs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35EFEFB50DB67ED60020783D /* GRTransferFuncs.cpp */; }; + 35F2A01E0E36AFF100D17527 /* CheckObjCUnusedIVars.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35F2A01D0E36AFF100D17527 /* CheckObjCUnusedIVars.cpp */; }; + 35F8D0D60D9B82CD00D91C5E /* BasicObjCFoundationChecks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35F8D0D50D9B82CD00D91C5E /* BasicObjCFoundationChecks.cpp */; }; + 35FE6BCF0DF6EE1F00739712 /* DeclBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35FE6BCE0DF6EE1F00739712 /* DeclBase.cpp */; }; + 72D16C1F0D9975C400E6DA4A /* HTMLRewrite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72D16C1E0D9975C400E6DA4A /* HTMLRewrite.cpp */; }; + 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 */; }; + 906BF4B00F83BA2E001071FA /* ConvertUTF.c in Sources */ = {isa = PBXBuildFile; fileRef = 906BF4AF0F83BA2E001071FA /* ConvertUTF.c */; }; + DE01DA490B12ADA300AC22CE /* PPCallbacks.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE01DA480B12ADA300AC22CE /* PPCallbacks.h */; }; + DE06756C0C051CFE00EBBFD8 /* ParseExprCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE06756B0C051CFE00EBBFD8 /* ParseExprCXX.cpp */; }; + DE06B73E0A8307640050E87E /* LangOptions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE06B73D0A8307640050E87E /* LangOptions.h */; }; + DE06BECB0A854E4B0050E87E /* Scope.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE06BECA0A854E4B0050E87E /* Scope.h */; }; + DE06D4310A8BB52D0050E87E /* Parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE06D42F0A8BB52D0050E87E /* Parser.cpp */; }; + DE06E8140A8FF9330050E87E /* Action.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE06E8130A8FF9330050E87E /* Action.h */; }; + DE0FCA630A95859D00248FD5 /* Expr.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE0FCA620A95859D00248FD5 /* Expr.h */; }; + DE0FCB340A9C21F100248FD5 /* Expr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE0FCB330A9C21F100248FD5 /* Expr.cpp */; }; + DE1733000B068B700080B521 /* ASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE1732FF0B068B700080B521 /* ASTContext.cpp */; }; + DE17336E0B068DC20080B521 /* DeclSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE17336D0B068DC20080B521 /* DeclSpec.cpp */; }; + DE1733700B068DC60080B521 /* DeclSpec.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE17336F0B068DC60080B521 /* DeclSpec.h */; }; + DE1F22030A7D852A00FBF588 /* Parser.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE1F22020A7D852A00FBF588 /* Parser.h */; }; + DE224FF80C7AA98800D370A5 /* CGExprComplex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE224FF70C7AA98800D370A5 /* CGExprComplex.cpp */; }; + DE2252700C7E82D000D370A5 /* CGExprScalar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE22526F0C7E82D000D370A5 /* CGExprScalar.cpp */; }; + DE2255FC0C8004E600D370A5 /* ParseDeclCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE2255FB0C8004E600D370A5 /* ParseDeclCXX.cpp */; }; + DE22BCF20E14197E0094DC60 /* SemaDeclAttr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE22BCF10E14197E0094DC60 /* SemaDeclAttr.cpp */; }; + DE344AB80AE5DF6D00DBC861 /* HeaderSearch.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE344AB70AE5DF6D00DBC861 /* HeaderSearch.h */; }; + DE344B540AE5E46C00DBC861 /* HeaderSearch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE344B530AE5E46C00DBC861 /* HeaderSearch.cpp */; }; + DE3450D70AEB543100DBC861 /* DirectoryLookup.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE3450D60AEB543100DBC861 /* DirectoryLookup.h */; }; + DE3452410AEF1A2D00DBC861 /* Stmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE3452400AEF1A2D00DBC861 /* Stmt.cpp */; }; + DE3452810AEF1B1800DBC861 /* Stmt.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE3452800AEF1B1800DBC861 /* Stmt.h */; }; + DE345C1A0AFC658B00DBC861 /* StmtVisitor.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE345C190AFC658B00DBC861 /* StmtVisitor.h */; }; + DE345F220AFD347900DBC861 /* StmtNodes.def in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE345F210AFD347900DBC861 /* StmtNodes.def */; }; + DE3460000AFDCC1900DBC861 /* ParseObjc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE345FFF0AFDCC1900DBC861 /* ParseObjc.cpp */; }; + DE3460050AFDCC6500DBC861 /* ParseInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE3460040AFDCC6500DBC861 /* ParseInit.cpp */; }; + DE34600B0AFDCCBF00DBC861 /* ParseStmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE34600A0AFDCCBF00DBC861 /* ParseStmt.cpp */; }; + DE34600F0AFDCCCE00DBC861 /* ParseDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE34600E0AFDCCCE00DBC861 /* ParseDecl.cpp */; }; + DE3460130AFDCCDA00DBC861 /* ParseExpr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE3460120AFDCCDA00DBC861 /* ParseExpr.cpp */; }; + DE3461270AFE68BE00DBC861 /* MinimalAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE3461260AFE68BE00DBC861 /* MinimalAction.cpp */; }; + DE34621D0AFEB19B00DBC861 /* StmtPrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE34621C0AFEB19B00DBC861 /* StmtPrinter.cpp */; }; + DE3464220B03040900DBC861 /* Type.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE3464210B03040900DBC861 /* Type.h */; }; + DE38CD500D794D0100A273B6 /* CGObjCGNU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE38CD4F0D794D0100A273B6 /* CGObjCGNU.cpp */; }; + DE38CF270D8C9E6C00A273B6 /* DeclObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE38CF260D8C9E6C00A273B6 /* DeclObjC.cpp */; }; + DE3986F00CB8D4B300223765 /* IdentifierTable.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE3986EF0CB8D4B300223765 /* IdentifierTable.h */; }; + DE3986F40CB8D50C00223765 /* IdentifierTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE3986F30CB8D50C00223765 /* IdentifierTable.cpp */; }; + DE4121350D7F1C1C0080F80A /* SymbolManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4121270D7F1C1C0080F80A /* SymbolManager.cpp */; }; + DE4121360D7F1C1C0080F80A /* ExplodedGraph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4121280D7F1C1C0080F80A /* ExplodedGraph.cpp */; }; + DE4121370D7F1C1C0080F80A /* UninitializedValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4121290D7F1C1C0080F80A /* UninitializedValues.cpp */; }; + DE4121380D7F1C1C0080F80A /* GRCoreEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE41212A0D7F1C1C0080F80A /* GRCoreEngine.cpp */; }; + DE41213C0D7F1C1C0080F80A /* GRSimpleVals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE41212F0D7F1C1C0080F80A /* GRSimpleVals.cpp */; }; + DE41213D0D7F1C1C0080F80A /* GRBlockCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4121300D7F1C1C0080F80A /* GRBlockCounter.cpp */; }; + DE41213E0D7F1C1C0080F80A /* GRExprEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4121310D7F1C1C0080F80A /* GRExprEngine.cpp */; }; + DE4264FC0C113592005A861D /* CGDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4264FB0C113592005A861D /* CGDecl.cpp */; }; + DE46BF280AE0A82D00CC047C /* TargetInfo.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE46BF270AE0A82D00CC047C /* TargetInfo.h */; }; + DE4772FA0C10EAE5002239E8 /* CGStmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4772F90C10EAE5002239E8 /* CGStmt.cpp */; }; + DE4772FC0C10EAEC002239E8 /* CGExpr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4772FB0C10EAEC002239E8 /* CGExpr.cpp */; }; + DE47999C0D2EBE1A00706D2D /* SemaExprObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE47999B0D2EBE1A00706D2D /* SemaExprObjC.cpp */; }; + DE4DC7A30EA1C33E00069E5A /* TokenRewriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4DC7A20EA1C33E00069E5A /* TokenRewriter.cpp */; }; + DE67E70B0C020EC500F66BC5 /* SemaType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE67E70A0C020EC500F66BC5 /* SemaType.cpp */; }; + DE67E70D0C020ECA00F66BC5 /* SemaStmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE67E70C0C020ECA00F66BC5 /* SemaStmt.cpp */; }; + DE67E70F0C020ECF00F66BC5 /* SemaExprCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE67E70E0C020ECF00F66BC5 /* SemaExprCXX.cpp */; }; + DE67E7110C020ED400F66BC5 /* SemaExpr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE67E7100C020ED400F66BC5 /* SemaExpr.cpp */; }; + DE67E7130C020ED900F66BC5 /* SemaDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE67E7120C020ED900F66BC5 /* SemaDecl.cpp */; }; + DE67E7150C020EDF00F66BC5 /* Sema.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE67E7140C020EDF00F66BC5 /* Sema.h */; }; + DE67E7170C020EE400F66BC5 /* Sema.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE67E7160C020EE400F66BC5 /* Sema.cpp */; }; + DE67E71A0C020F4F00F66BC5 /* ParseAST.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE67E7190C020F4F00F66BC5 /* ParseAST.cpp */; }; + DE67E7280C02109800F66BC5 /* ParseAST.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE67E7270C02109800F66BC5 /* ParseAST.h */; }; + DE6951C70C4D1F5D00A5826B /* RecordLayout.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE6951C60C4D1F5D00A5826B /* RecordLayout.h */; }; + DE6954640C5121BD00A5826B /* Token.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE6954630C5121BD00A5826B /* Token.h */; }; + DE704B260D0FBEBE009C7762 /* SemaDeclObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE704B250D0FBEBE009C7762 /* SemaDeclObjC.cpp */; }; + DE704DD20D1668A4009C7762 /* HeaderMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE704DD10D1668A4009C7762 /* HeaderMap.cpp */; }; + DE75ED290B044DC90020CF81 /* ASTContext.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE75ED280B044DC90020CF81 /* ASTContext.h */; }; + DE75EDF10B06880E0020CF81 /* Type.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE75EDF00B06880E0020CF81 /* Type.cpp */; }; + DE85CD810D8380B10070E26E /* TokenLexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE85CD800D8380B10070E26E /* TokenLexer.cpp */; }; + DE85CDA30D8383B20070E26E /* MacroArgs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE85CDA20D8383B20070E26E /* MacroArgs.cpp */; }; + DE85CDAC0D838C120070E26E /* PPMacroExpansion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE85CDAB0D838C120070E26E /* PPMacroExpansion.cpp */; }; + DE85CDB00D838C390070E26E /* PPDirectives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE85CDAF0D838C390070E26E /* PPDirectives.cpp */; }; + DE85CDB60D839BAE0070E26E /* PPLexerChange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE85CDB50D839BAE0070E26E /* PPLexerChange.cpp */; }; + DE8823CB0ED0046600CBC30A /* APValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE8823CA0ED0046600CBC30A /* APValue.cpp */; }; + DE928B130C05659200231DA4 /* ModuleBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE928B120C05659200231DA4 /* ModuleBuilder.cpp */; }; + DE928B200C0565B000231DA4 /* ModuleBuilder.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE928B1F0C0565B000231DA4 /* ModuleBuilder.h */; }; + DE928B7D0C0A615100231DA4 /* CodeGenModule.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE928B7C0C0A615100231DA4 /* CodeGenModule.h */; }; + DE928B7F0C0A615600231DA4 /* CodeGenModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE928B7E0C0A615600231DA4 /* CodeGenModule.cpp */; }; + DE928B810C0A615B00231DA4 /* CodeGenFunction.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE928B800C0A615B00231DA4 /* CodeGenFunction.h */; }; + DE928B830C0A616000231DA4 /* CodeGenFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE928B820C0A616000231DA4 /* CodeGenFunction.cpp */; }; + DEAEE98B0A5A2B970045101B /* MultipleIncludeOpt.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEAEE98A0A5A2B970045101B /* MultipleIncludeOpt.h */; }; + DEAEED4B0A5AF89A0045101B /* NOTES.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEAEED4A0A5AF89A0045101B /* NOTES.txt */; }; + 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 */; }; + DECB6D650F9AE26600F5FBC7 /* JumpDiagnostics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECB6D640F9AE26600F5FBC7 /* JumpDiagnostics.cpp */; }; + DECB6F070F9D93A800F5FBC7 /* InitPreprocessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECB6F060F9D93A800F5FBC7 /* InitPreprocessor.cpp */; }; + DECB77130FA5752300F5FBC7 /* PCHReaderStmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECB77120FA5752300F5FBC7 /* PCHReaderStmt.cpp */; }; + DECB77790FA579B000F5FBC7 /* PCHReaderDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECB77780FA579B000F5FBC7 /* PCHReaderDecl.cpp */; }; + DECB77F70FA5850200F5FBC7 /* PCHWriterDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECB77F60FA5850200F5FBC7 /* PCHWriterDecl.cpp */; }; + DECB78170FA5882F00F5FBC7 /* PCHWriterStmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECB78160FA5882F00F5FBC7 /* PCHWriterStmt.cpp */; }; + DED626C90AE0C065001E80A4 /* TargetInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED626C80AE0C065001E80A4 /* TargetInfo.cpp */; }; + DED62ABB0AE2EDF1001E80A4 /* Decl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED62ABA0AE2EDF1001E80A4 /* Decl.cpp */; }; + DED676D10B6C786700AAD4A3 /* Builtins.def in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED676D00B6C786700AAD4A3 /* Builtins.def */; }; + DED676FA0B6C797B00AAD4A3 /* Builtins.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED676F90B6C797B00AAD4A3 /* Builtins.h */; }; + DED677C90B6C854100AAD4A3 /* Builtins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED677C80B6C854100AAD4A3 /* Builtins.cpp */; }; + DED7D7410A524295003AD0FB /* Diagnostic.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7310A524295003AD0FB /* Diagnostic.h */; }; + DED7D7430A524295003AD0FB /* FileManager.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7330A524295003AD0FB /* FileManager.h */; }; + DED7D7450A524295003AD0FB /* SourceLocation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7350A524295003AD0FB /* SourceLocation.h */; }; + DED7D7460A524295003AD0FB /* SourceManager.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7360A524295003AD0FB /* SourceManager.h */; }; + DED7D7470A524295003AD0FB /* TokenKinds.def in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7370A524295003AD0FB /* TokenKinds.def */; }; + DED7D7480A524295003AD0FB /* TokenKinds.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7380A524295003AD0FB /* TokenKinds.h */; }; + DED7D74A0A524295003AD0FB /* Lexer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D73B0A524295003AD0FB /* Lexer.h */; }; + DED7D74D0A524295003AD0FB /* MacroInfo.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D73E0A524295003AD0FB /* MacroInfo.h */; }; + DED7D74E0A524295003AD0FB /* Pragma.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D73F0A524295003AD0FB /* Pragma.h */; }; + DED7D74F0A524295003AD0FB /* Preprocessor.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7400A524295003AD0FB /* Preprocessor.h */; }; + DED7D77A0A5242C7003AD0FB /* Diagnostic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D75D0A5242C7003AD0FB /* Diagnostic.cpp */; }; + DED7D77B0A5242C7003AD0FB /* FileManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D75E0A5242C7003AD0FB /* FileManager.cpp */; }; + DED7D7890A5242C7003AD0FB /* SourceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D76D0A5242C7003AD0FB /* SourceManager.cpp */; }; + DED7D78A0A5242C7003AD0FB /* TokenKinds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D76E0A5242C7003AD0FB /* TokenKinds.cpp */; }; + DED7D7C30A5242E6003AD0FB /* Lexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D79E0A5242E6003AD0FB /* Lexer.cpp */; }; + DED7D7C50A5242E6003AD0FB /* MacroInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D7A00A5242E6003AD0FB /* MacroInfo.cpp */; }; + DED7D7C70A5242E6003AD0FB /* PPExpressions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D7A20A5242E6003AD0FB /* PPExpressions.cpp */; }; + DED7D7C80A5242E6003AD0FB /* Pragma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D7A30A5242E6003AD0FB /* Pragma.cpp */; }; + DED7D7C90A5242E6003AD0FB /* Preprocessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D7A40A5242E6003AD0FB /* Preprocessor.cpp */; }; + DED7D7D80A524302003AD0FB /* README.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7D70A524302003AD0FB /* README.txt */; }; + DED7D9180A52518C003AD0FB /* ScratchBuffer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D9170A52518C003AD0FB /* ScratchBuffer.h */; }; + DED7D9E50A5257F6003AD0FB /* ScratchBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D9E40A5257F6003AD0FB /* ScratchBuffer.cpp */; }; + DEDFE5CF0F7206E40035BD10 /* NestedNameSpecifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE5CE0F7206E40035BD10 /* NestedNameSpecifier.cpp */; }; + DEDFE6460F7B3B4E0035BD10 /* driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6450F7B3B4E0035BD10 /* driver.cpp */; }; + DEDFE65A0F7B3B830035BD10 /* Types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6480F7B3B830035BD10 /* Types.cpp */; }; + DEDFE65B0F7B3B830035BD10 /* Tools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE64A0F7B3B830035BD10 /* Tools.cpp */; }; + DEDFE65C0F7B3B830035BD10 /* Compilation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE64C0F7B3B830035BD10 /* Compilation.cpp */; }; + DEDFE65D0F7B3B830035BD10 /* ArgList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE64D0F7B3B830035BD10 /* ArgList.cpp */; }; + DEDFE65E0F7B3B830035BD10 /* Arg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE64E0F7B3B830035BD10 /* Arg.cpp */; }; + DEDFE65F0F7B3B830035BD10 /* Action.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE64F0F7B3B830035BD10 /* Action.cpp */; }; + DEDFE6600F7B3B830035BD10 /* Phases.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6500F7B3B830035BD10 /* Phases.cpp */; }; + DEDFE6610F7B3B830035BD10 /* OptTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6510F7B3B830035BD10 /* OptTable.cpp */; }; + DEDFE6620F7B3B830035BD10 /* Option.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6520F7B3B830035BD10 /* Option.cpp */; }; + DEDFE6630F7B3B830035BD10 /* Job.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6530F7B3B830035BD10 /* Job.cpp */; }; + DEDFE6640F7B3B830035BD10 /* ToolChains.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6550F7B3B830035BD10 /* ToolChains.cpp */; }; + DEDFE6650F7B3B830035BD10 /* ToolChain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6560F7B3B830035BD10 /* ToolChain.cpp */; }; + DEDFE6660F7B3B830035BD10 /* Tool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6570F7B3B830035BD10 /* Tool.cpp */; }; + DEDFE6670F7B3B830035BD10 /* HostInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6580F7B3B830035BD10 /* HostInfo.cpp */; }; + DEDFE6680F7B3B830035BD10 /* Driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6590F7B3B830035BD10 /* Driver.cpp */; }; + DEDFF8880F848CF80035BD10 /* TemplateName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFF8870F848CF80035BD10 /* TemplateName.cpp */; }; + DEEBBD440C19C5D200A9FE82 /* TODO.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEEBBD430C19C5D200A9FE82 /* TODO.txt */; }; + DEEBC3BA0C2363B800A9FE82 /* CodeGenTypes.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEEBC3B90C2363B800A9FE82 /* CodeGenTypes.h */; }; + DEEBC3BC0C2363BC00A9FE82 /* CodeGenTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEEBC3BB0C2363BC00A9FE82 /* CodeGenTypes.cpp */; }; + DEF165710F8FB34D0098507F /* PCHWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF165700F8FB34D0098507F /* PCHWriter.cpp */; }; + DEF165750F8FB3510098507F /* PCHReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF165740F8FB3510098507F /* PCHReader.cpp */; }; + DEF168400F9548DC0098507F /* FixItRewriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF1683F0F9548DC0098507F /* FixItRewriter.cpp */; }; + DEF2E95F0C5FBD74000C4259 /* InternalsManual.html in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEF2E95E0C5FBD74000C4259 /* InternalsManual.html */; }; + DEF2EDA70C6A4252000C4259 /* StmtDumper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF2EDA60C6A4252000C4259 /* StmtDumper.cpp */; }; + DEF2EFF30C6CDD74000C4259 /* CGExprAgg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF2EFF20C6CDD74000C4259 /* CGExprAgg.cpp */; }; + DEF2F0100C6CFED5000C4259 /* SemaChecking.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF2F00F0C6CFED5000C4259 /* SemaChecking.cpp */; }; + DEF7D9F70C9C8B1A0001F598 /* Rewriter.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEF7D9F60C9C8B1A0001F598 /* Rewriter.h */; }; + DEF7D9F90C9C8B1D0001F598 /* Rewriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF7D9F80C9C8B1D0001F598 /* Rewriter.cpp */; }; + DEFFECA70DB1546600B4E7C3 /* DeltaTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEFFECA60DB1546600B4E7C3 /* DeltaTree.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 8DD76F690486A84900D96B5E /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 8; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + DED7D7410A524295003AD0FB /* Diagnostic.h in CopyFiles */, + DED7D7430A524295003AD0FB /* FileManager.h in CopyFiles */, + DED7D7450A524295003AD0FB /* SourceLocation.h in CopyFiles */, + DED7D7460A524295003AD0FB /* SourceManager.h in CopyFiles */, + DED7D7470A524295003AD0FB /* TokenKinds.def in CopyFiles */, + DED7D7480A524295003AD0FB /* TokenKinds.h in CopyFiles */, + DED7D74A0A524295003AD0FB /* Lexer.h in CopyFiles */, + DED7D74D0A524295003AD0FB /* MacroInfo.h in CopyFiles */, + DED7D74E0A524295003AD0FB /* Pragma.h in CopyFiles */, + DED7D74F0A524295003AD0FB /* Preprocessor.h in CopyFiles */, + DED7D7D80A524302003AD0FB /* README.txt in CopyFiles */, + DED7D9180A52518C003AD0FB /* ScratchBuffer.h in CopyFiles */, + DEAEE98B0A5A2B970045101B /* MultipleIncludeOpt.h in CopyFiles */, + DEAEED4B0A5AF89A0045101B /* NOTES.txt in CopyFiles */, + DE1F22030A7D852A00FBF588 /* Parser.h in CopyFiles */, + DE06B73E0A8307640050E87E /* LangOptions.h in CopyFiles */, + DE06BECB0A854E4B0050E87E /* Scope.h in CopyFiles */, + DE06E8140A8FF9330050E87E /* Action.h in CopyFiles */, + DEC8D9910A9433CD00353FCA /* Decl.h in CopyFiles */, + DEC8D9A40A94346E00353FCA /* AST.h in CopyFiles */, + DE0FCA630A95859D00248FD5 /* Expr.h in CopyFiles */, + DE46BF280AE0A82D00CC047C /* TargetInfo.h in CopyFiles */, + DE344AB80AE5DF6D00DBC861 /* HeaderSearch.h in CopyFiles */, + DE3450D70AEB543100DBC861 /* DirectoryLookup.h in CopyFiles */, + DE3452810AEF1B1800DBC861 /* Stmt.h in CopyFiles */, + DE345C1A0AFC658B00DBC861 /* StmtVisitor.h in CopyFiles */, + DE345F220AFD347900DBC861 /* StmtNodes.def in CopyFiles */, + DE3464220B03040900DBC861 /* Type.h in CopyFiles */, + DE75ED290B044DC90020CF81 /* ASTContext.h in CopyFiles */, + DE1733700B068DC60080B521 /* DeclSpec.h in CopyFiles */, + DE01DA490B12ADA300AC22CE /* PPCallbacks.h in CopyFiles */, + DED676D10B6C786700AAD4A3 /* Builtins.def in CopyFiles */, + DED676FA0B6C797B00AAD4A3 /* Builtins.h in CopyFiles */, + 1A30A9E90B93A4C800201A91 /* ExprCXX.h in CopyFiles */, + 1A869A700BA2164C008DA07A /* LiteralSupport.h in CopyFiles */, + DE67E7150C020EDF00F66BC5 /* Sema.h in CopyFiles */, + DE67E7280C02109800F66BC5 /* ParseAST.h in CopyFiles */, + DE928B200C0565B000231DA4 /* ModuleBuilder.h in CopyFiles */, + DE928B7D0C0A615100231DA4 /* CodeGenModule.h in CopyFiles */, + DE928B810C0A615B00231DA4 /* CodeGenFunction.h in CopyFiles */, + DEEBBD440C19C5D200A9FE82 /* TODO.txt in CopyFiles */, + 84D9A88C0C1A581300AC7ABC /* AttributeList.h in CopyFiles */, + DEEBC3BA0C2363B800A9FE82 /* CodeGenTypes.h in CopyFiles */, + 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 */, + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 035611470DA6A45C00D2EF2A /* DeclBase.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclBase.h; path = clang/AST/DeclBase.h; sourceTree = ""; tabWidth = 2; }; + 03F50AC50D416EAA00B9CF60 /* Targets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = Targets.cpp; sourceTree = ""; tabWidth = 2; }; + 1A2193CB0F45EEB700C0713D /* ABIInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ABIInfo.h; path = lib/CodeGen/ABIInfo.h; sourceTree = ""; tabWidth = 2; }; + 1A2193CC0F45EEB700C0713D /* Mangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Mangle.cpp; path = lib/CodeGen/Mangle.cpp; sourceTree = ""; tabWidth = 2; }; + 1A2193CD0F45EEB700C0713D /* Mangle.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Mangle.h; path = lib/CodeGen/Mangle.h; sourceTree = ""; tabWidth = 2; }; + 1A2A54A40FD1DD1C00F4CE45 /* AnalysisConsumer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnalysisConsumer.cpp; path = lib/Frontend/AnalysisConsumer.cpp; sourceTree = ""; }; + 1A2A54A50FD1DD1C00F4CE45 /* ASTConsumers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASTConsumers.cpp; path = lib/Frontend/ASTConsumers.cpp; sourceTree = ""; }; + 1A2A54A60FD1DD1C00F4CE45 /* Backend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Backend.cpp; path = lib/Frontend/Backend.cpp; sourceTree = ""; }; + 1A2A54A70FD1DD1C00F4CE45 /* CacheTokens.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CacheTokens.cpp; path = lib/Frontend/CacheTokens.cpp; sourceTree = ""; }; + 1A2A54A80FD1DD1C00F4CE45 /* DependencyFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DependencyFile.cpp; path = lib/Frontend/DependencyFile.cpp; sourceTree = ""; }; + 1A2A54A90FD1DD1C00F4CE45 /* DiagChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DiagChecker.cpp; path = lib/Frontend/DiagChecker.cpp; sourceTree = ""; }; + 1A2A54AA0FD1DD1C00F4CE45 /* DocumentXML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DocumentXML.cpp; path = lib/Frontend/DocumentXML.cpp; sourceTree = ""; }; + 1A2A54AB0FD1DD1C00F4CE45 /* GeneratePCH.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GeneratePCH.cpp; path = lib/Frontend/GeneratePCH.cpp; sourceTree = ""; }; + 1A2A54AC0FD1DD1C00F4CE45 /* HTMLPrint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLPrint.cpp; path = lib/Frontend/HTMLPrint.cpp; sourceTree = ""; }; + 1A2A54AD0FD1DD1C00F4CE45 /* PrintParserCallbacks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PrintParserCallbacks.cpp; path = lib/Frontend/PrintParserCallbacks.cpp; sourceTree = ""; }; + 1A2A54AE0FD1DD1C00F4CE45 /* PrintPreprocessedOutput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PrintPreprocessedOutput.cpp; path = lib/Frontend/PrintPreprocessedOutput.cpp; sourceTree = ""; }; + 1A2A54AF0FD1DD1C00F4CE45 /* RewriteBlocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteBlocks.cpp; path = lib/Frontend/RewriteBlocks.cpp; sourceTree = ""; }; + 1A2A54B00FD1DD1C00F4CE45 /* RewriteMacros.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteMacros.cpp; path = lib/Frontend/RewriteMacros.cpp; sourceTree = ""; }; + 1A2A54B10FD1DD1C00F4CE45 /* RewriteObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteObjC.cpp; path = lib/Frontend/RewriteObjC.cpp; sourceTree = ""; }; + 1A2A54B20FD1DD1C00F4CE45 /* RewriteTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteTest.cpp; path = lib/Frontend/RewriteTest.cpp; sourceTree = ""; }; + 1A2A54B30FD1DD1C00F4CE45 /* StmtXML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StmtXML.cpp; path = lib/Frontend/StmtXML.cpp; sourceTree = ""; }; + 1A2A54B40FD1DD1C00F4CE45 /* Warnings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Warnings.cpp; path = lib/Frontend/Warnings.cpp; sourceTree = ""; }; + 1A30A9E80B93A4C800201A91 /* ExprCXX.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ExprCXX.h; path = clang/AST/ExprCXX.h; sourceTree = ""; tabWidth = 2; }; + 1A32C17E0E1C87AD00A6B483 /* ExprConstant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ExprConstant.cpp; path = lib/AST/ExprConstant.cpp; sourceTree = ""; tabWidth = 2; }; + 1A376A2C0D4AED9B002A1C52 /* CGExprConstant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprConstant.cpp; path = lib/CodeGen/CGExprConstant.cpp; sourceTree = ""; tabWidth = 2; }; + 1A410F840FBCE51100351440 /* SemaTemplateInstantiateExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiateExpr.cpp; path = lib/Sema/SemaTemplateInstantiateExpr.cpp; sourceTree = ""; tabWidth = 2; }; + 1A471AB40F437BC500753CE8 /* CGBlocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGBlocks.cpp; path = lib/CodeGen/CGBlocks.cpp; sourceTree = ""; tabWidth = 2; }; + 1A5119C30FBDF71000A1FF22 /* SemaTemplateInstantiateStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiateStmt.cpp; path = lib/Sema/SemaTemplateInstantiateStmt.cpp; sourceTree = ""; }; + 1A5D5E570E5E81010023C059 /* CGCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCXX.cpp; path = lib/CodeGen/CGCXX.cpp; sourceTree = ""; tabWidth = 2; }; + 1A649E1D0F9599D9005B965E /* CGBlocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CGBlocks.h; path = lib/CodeGen/CGBlocks.h; sourceTree = ""; }; + 1A649E1E0F9599DA005B965E /* CGCXX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CGCXX.h; path = lib/CodeGen/CGCXX.h; sourceTree = ""; }; + 1A68BC110D0CADDD001A28C8 /* PPCBuiltins.def */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = text; name = PPCBuiltins.def; path = clang/AST/PPCBuiltins.def; sourceTree = ""; tabWidth = 2; }; + 1A68BC120D0CADDD001A28C8 /* TargetBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = TargetBuiltins.h; path = clang/AST/TargetBuiltins.h; sourceTree = ""; tabWidth = 2; }; + 1A68BC130D0CADDD001A28C8 /* X86Builtins.def */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = text; name = X86Builtins.def; path = clang/AST/X86Builtins.def; sourceTree = ""; tabWidth = 2; }; + 1A7019E90F79BC1100FEC4D1 /* DiagnosticAnalysisKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticAnalysisKinds.td; sourceTree = ""; }; + 1A7019EA0F79BC1100FEC4D1 /* DiagnosticASTKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticASTKinds.td; sourceTree = ""; }; + 1A7019EB0F79BC1100FEC4D1 /* DiagnosticCommonKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticCommonKinds.td; sourceTree = ""; }; + 1A7019EC0F79BC1100FEC4D1 /* DiagnosticDriverKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticDriverKinds.td; sourceTree = ""; }; + 1A7019ED0F79BC1100FEC4D1 /* DiagnosticFrontendKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticFrontendKinds.td; sourceTree = ""; }; + 1A7019EE0F79BC1100FEC4D1 /* DiagnosticLexKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticLexKinds.td; sourceTree = ""; }; + 1A7019EF0F79BC1100FEC4D1 /* DiagnosticParseKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticParseKinds.td; sourceTree = ""; }; + 1A701A250F79CE1C00FEC4D1 /* DiagnosticSemaKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticSemaKinds.td; sourceTree = ""; }; + 1A701B630F7C8FE400FEC4D1 /* SemaAccess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaAccess.cpp; path = lib/Sema/SemaAccess.cpp; sourceTree = ""; tabWidth = 2; }; + 1A72BEAC0D641E9400B085E9 /* Attr.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Attr.h; path = clang/AST/Attr.h; sourceTree = ""; tabWidth = 2; }; + 1A7342470C7B57D500122F56 /* CGObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGObjC.cpp; path = lib/CodeGen/CGObjC.cpp; sourceTree = ""; tabWidth = 2; }; + 1A869A6E0BA2164C008DA07A /* LiteralSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiteralSupport.h; sourceTree = ""; }; + 1A869AA70BA21ABA008DA07A /* LiteralSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LiteralSupport.cpp; sourceTree = ""; }; + 1ABC36930C7A4BDC006DB0AB /* CGBuiltin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGBuiltin.cpp; path = lib/CodeGen/CGBuiltin.cpp; sourceTree = ""; tabWidth = 2; }; + 1ADF47AE0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiateDecl.cpp; path = lib/Sema/SemaTemplateInstantiateDecl.cpp; sourceTree = ""; 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 = ""; tabWidth = 2; }; + 3507E4C10E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckObjCInstMethSignature.cpp; path = lib/Analysis/CheckObjCInstMethSignature.cpp; sourceTree = ""; }; + 352246E10F5C6BE000D0D279 /* HTMLDiagnostics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLDiagnostics.cpp; path = lib/Frontend/HTMLDiagnostics.cpp; sourceTree = ""; }; + 352246E20F5C6BE000D0D279 /* InitHeaderSearch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InitHeaderSearch.cpp; path = lib/Frontend/InitHeaderSearch.cpp; sourceTree = ""; }; + 352246E30F5C6BE000D0D279 /* ManagerRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ManagerRegistry.cpp; path = lib/Frontend/ManagerRegistry.cpp; sourceTree = ""; }; + 352246E40F5C6BE000D0D279 /* PlistDiagnostics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlistDiagnostics.cpp; path = lib/Frontend/PlistDiagnostics.cpp; sourceTree = ""; }; + 352246E50F5C6BE000D0D279 /* TextDiagnosticBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextDiagnosticBuffer.cpp; path = lib/Frontend/TextDiagnosticBuffer.cpp; sourceTree = ""; }; + 352246E60F5C6BE000D0D279 /* TextDiagnosticPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextDiagnosticPrinter.cpp; path = lib/Frontend/TextDiagnosticPrinter.cpp; sourceTree = ""; }; + 35260CA40C7F75C000D66CE9 /* ExprCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ExprCXX.cpp; path = lib/AST/ExprCXX.cpp; sourceTree = ""; tabWidth = 2; }; + 3527124F0DAFE54700C76352 /* IdentifierResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = IdentifierResolver.h; path = lib/Sema/IdentifierResolver.h; sourceTree = ""; tabWidth = 2; }; + 352712500DAFE54700C76352 /* IdentifierResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = IdentifierResolver.cpp; path = lib/Sema/IdentifierResolver.cpp; sourceTree = ""; tabWidth = 2; }; + 352C19DC0CA321C80045DB98 /* CFGRecStmtDeclVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFGRecStmtDeclVisitor.h; path = clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h; sourceTree = ""; }; + 352C19DD0CA321C80045DB98 /* CFGRecStmtVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFGRecStmtVisitor.h; path = clang/Analysis/Visitors/CFGRecStmtVisitor.h; sourceTree = ""; }; + 352C19DE0CA321C80045DB98 /* CFGStmtVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFGStmtVisitor.h; path = clang/Analysis/Visitors/CFGStmtVisitor.h; sourceTree = ""; }; + 352C19DF0CA321C80045DB98 /* CFGVarDeclVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFGVarDeclVisitor.h; path = clang/Analysis/Visitors/CFGVarDeclVisitor.h; sourceTree = ""; }; + 3534A01C0E129849002709B2 /* ParseCXXInlineMethods.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseCXXInlineMethods.cpp; path = lib/Parse/ParseCXXInlineMethods.cpp; sourceTree = ""; tabWidth = 2; }; + 3536456A0E23EBF7009C6509 /* Environment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Environment.cpp; path = lib/Analysis/Environment.cpp; sourceTree = ""; }; + 3536457C0E2406B0009C6509 /* Environment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Environment.h; path = clang/Analysis/PathSensitive/Environment.h; sourceTree = ""; }; + 3537AA0C0ECD088F008F7CDC /* BlkExprDeclBitVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BlkExprDeclBitVector.h; path = clang/Analysis/Support/BlkExprDeclBitVector.h; sourceTree = ""; }; + 3537AA0D0ECD08A4008F7CDC /* PreprocessorLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreprocessorLexer.cpp; sourceTree = ""; }; + 3538FDB60ED24A2C005EC283 /* DeclarationName.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclarationName.h; path = clang/AST/DeclarationName.h; sourceTree = ""; tabWidth = 2; }; + 3538FDB70ED24A4E005EC283 /* DeclarationName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DeclarationName.cpp; path = lib/AST/DeclarationName.cpp; sourceTree = ""; }; + 353959D40EE5F88A00E82461 /* ParseTemplate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseTemplate.cpp; path = lib/Parse/ParseTemplate.cpp; sourceTree = ""; tabWidth = 2; }; + 3547129D0C88881300B3E1D5 /* PrettyPrinter.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = PrettyPrinter.h; path = clang/AST/PrettyPrinter.h; sourceTree = ""; tabWidth = 2; }; + 35475B1F0E79973F0000BFE4 /* CGCall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCall.cpp; path = lib/CodeGen/CGCall.cpp; sourceTree = ""; tabWidth = 2; }; + 35475B220E7997680000BFE4 /* CGCall.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGCall.h; path = lib/CodeGen/CGCall.h; sourceTree = ""; tabWidth = 2; }; + 35475B230E7997680000BFE4 /* CGValue.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGValue.h; path = lib/CodeGen/CGValue.h; sourceTree = ""; tabWidth = 2; }; + 355106850E9A8507006A4E44 /* MemRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MemRegion.cpp; path = lib/Analysis/MemRegion.cpp; sourceTree = ""; }; + 355106880E9A851B006A4E44 /* MemRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MemRegion.h; path = clang/Analysis/PathSensitive/MemRegion.h; sourceTree = ""; }; + 3551068A0E9A8546006A4E44 /* ParsePragma.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParsePragma.cpp; path = lib/Parse/ParsePragma.cpp; sourceTree = ""; tabWidth = 2; }; + 3551068B0E9A8546006A4E44 /* ParseTentative.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseTentative.cpp; path = lib/Parse/ParseTentative.cpp; sourceTree = ""; tabWidth = 2; }; + 3551068E0E9A855F006A4E44 /* AccessSpecifier.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = AccessSpecifier.h; path = clang/Parse/AccessSpecifier.h; sourceTree = ""; tabWidth = 2; }; + 3551068F0E9A857C006A4E44 /* ParsePragma.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ParsePragma.h; path = lib/Parse/ParsePragma.h; sourceTree = ""; tabWidth = 2; }; + 3552E7540E520D80003A8CA5 /* PPCaching.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCaching.cpp; sourceTree = ""; }; + 3552E7580E520DD7003A8CA5 /* CGObjCMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGObjCMac.cpp; path = lib/CodeGen/CGObjCMac.cpp; sourceTree = ""; tabWidth = 2; }; + 3553EB9A0E5F7089007D7359 /* GRStateTrait.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRStateTrait.h; path = clang/Analysis/PathSensitive/GRStateTrait.h; sourceTree = ""; }; + 35544B850F5C7FD700D92AA9 /* RangeConstraintManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RangeConstraintManager.cpp; path = lib/Analysis/RangeConstraintManager.cpp; sourceTree = ""; }; + 35544B860F5C7FD700D92AA9 /* SimpleConstraintManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SimpleConstraintManager.cpp; path = lib/Analysis/SimpleConstraintManager.cpp; sourceTree = ""; }; + 35544B870F5C7FD700D92AA9 /* SimpleConstraintManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SimpleConstraintManager.h; path = lib/Analysis/SimpleConstraintManager.h; sourceTree = ""; }; + 35544B8B0F5C803200D92AA9 /* SemaTemplateInstantiate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiate.cpp; path = lib/Sema/SemaTemplateInstantiate.cpp; sourceTree = ""; tabWidth = 2; }; + 3557D1A80EB136B100C59739 /* InheritViz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = InheritViz.cpp; path = lib/AST/InheritViz.cpp; sourceTree = ""; tabWidth = 2; }; + 3557D1EF0EB13BB700C59739 /* SemaInherit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaInherit.cpp; path = lib/Sema/SemaInherit.cpp; sourceTree = ""; tabWidth = 2; }; + 35585DBD0EAFBC4500D0A97A /* CXXFieldCollector.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CXXFieldCollector.h; path = lib/Sema/CXXFieldCollector.h; sourceTree = ""; tabWidth = 2; }; + 35585DBE0EAFBC4500D0A97A /* SemaOverload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaOverload.cpp; path = lib/Sema/SemaOverload.cpp; sourceTree = ""; tabWidth = 2; }; + 35585DBF0EAFBC4500D0A97A /* SemaOverload.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = SemaOverload.h; path = lib/Sema/SemaOverload.h; sourceTree = ""; tabWidth = 2; }; + 3558F76C0E267C8300A5B0DF /* BasicStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BasicStore.cpp; path = lib/Analysis/BasicStore.cpp; sourceTree = ""; }; + 3558F76F0E267C9A00A5B0DF /* Store.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Store.h; path = clang/Analysis/PathSensitive/Store.h; sourceTree = ""; }; + 355CF6820C90A8B600A08AA3 /* LocalCheckers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LocalCheckers.h; path = clang/Analysis/LocalCheckers.h; sourceTree = ""; }; + 356B89760D9BFDC100CBEBE9 /* BasicObjCFoundationChecks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BasicObjCFoundationChecks.h; path = lib/Analysis/BasicObjCFoundationChecks.h; sourceTree = ""; }; + 356EF9B40C8F7DDF006650F5 /* LiveVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LiveVariables.cpp; path = lib/Analysis/LiveVariables.cpp; sourceTree = ""; }; + 35707EFD0CD0F5CC000B2204 /* SourceLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = SourceLocation.cpp; sourceTree = ""; tabWidth = 2; }; + 357EA27C0F2526F300439B60 /* SemaLookup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaLookup.cpp; path = lib/Sema/SemaLookup.cpp; sourceTree = ""; tabWidth = 2; }; + 35847BE30CC7DB9000C40FFF /* StmtIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = StmtIterator.h; path = clang/AST/StmtIterator.h; sourceTree = ""; tabWidth = 2; }; + 35847BE40CC7DBAF00C40FFF /* StmtIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtIterator.cpp; path = lib/AST/StmtIterator.cpp; sourceTree = ""; tabWidth = 2; }; + 35862B0C0E3628CB0009F542 /* CheckDeadStores.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckDeadStores.cpp; path = lib/Analysis/CheckDeadStores.cpp; sourceTree = ""; }; + 35862B110E3629850009F542 /* GRExprEngineInternalChecks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRExprEngineInternalChecks.cpp; path = lib/Analysis/GRExprEngineInternalChecks.cpp; sourceTree = ""; }; + 358CFBB70E65AB04002A8E19 /* BasicConstraintManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BasicConstraintManager.cpp; path = lib/Analysis/BasicConstraintManager.cpp; sourceTree = ""; }; + 358D23090E8BEB850003DDCC /* DeclGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclGroup.h; path = clang/AST/DeclGroup.h; sourceTree = ""; tabWidth = 2; }; + 358D230A0E8BEB9D0003DDCC /* DeclGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclGroup.cpp; path = lib/AST/DeclGroup.cpp; sourceTree = ""; tabWidth = 2; }; + 358F514F0E529A87007F2102 /* GRState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRState.h; path = clang/Analysis/PathSensitive/GRState.h; sourceTree = ""; }; + 358F51510E529AA4007F2102 /* GRState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRState.cpp; path = lib/Analysis/GRState.cpp; sourceTree = ""; }; + 3591853E0EFB1088000039AF /* SemaTemplate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplate.cpp; path = lib/Sema/SemaTemplate.cpp; sourceTree = ""; tabWidth = 2; }; + 359378FF0DA486490043B19C /* BugReporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugReporter.h; path = clang/Analysis/PathSensitive/BugReporter.h; sourceTree = ""; }; + 359379090DA48ABA0043B19C /* BugReporter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BugReporter.cpp; path = lib/Analysis/BugReporter.cpp; sourceTree = ""; }; + 3595AFB70E1C8D62004CDF09 /* CheckObjCDealloc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckObjCDealloc.cpp; path = lib/Analysis/CheckObjCDealloc.cpp; sourceTree = ""; }; + 3598EBEB0EDE23EF0070CA16 /* PTHManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PTHManager.h; sourceTree = ""; }; + 3599299A0DE2425300A8A33E /* SemaInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaInit.cpp; path = lib/Sema/SemaInit.cpp; sourceTree = ""; tabWidth = 2; }; + 35A057D20EAE2D2B0069249F /* SVals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVals.h; path = clang/Analysis/PathSensitive/SVals.h; sourceTree = ""; }; + 35A057E00EAE2D950069249F /* RegionStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegionStore.cpp; path = lib/Analysis/RegionStore.cpp; sourceTree = ""; }; + 35A057E10EAE2D950069249F /* SVals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SVals.cpp; path = lib/Analysis/SVals.cpp; sourceTree = ""; }; + 35A3E7000DD3874400757F74 /* CGDebugInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGDebugInfo.cpp; path = lib/CodeGen/CGDebugInfo.cpp; sourceTree = ""; tabWidth = 2; wrapsLines = 1; }; + 35A3E7010DD3874400757F74 /* CGDebugInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGDebugInfo.h; path = lib/CodeGen/CGDebugInfo.h; sourceTree = ""; tabWidth = 2; }; + 35A8FCF60D9B4ADD001C2F97 /* ProgramPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProgramPoint.h; path = clang/Analysis/ProgramPoint.h; sourceTree = ""; }; + 35A8FCF70D9B4ADD001C2F97 /* PathDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PathDiagnostic.h; path = clang/Analysis/PathDiagnostic.h; sourceTree = ""; }; + 35A8FCF80D9B4B29001C2F97 /* PathDiagnostic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathDiagnostic.cpp; path = lib/Analysis/PathDiagnostic.cpp; sourceTree = ""; }; + 35B820740ECB811A0020BEC0 /* PreprocessorLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreprocessorLexer.h; sourceTree = ""; }; + 35BAC1E70E82C5B7003FB76F /* CheckNSError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckNSError.cpp; path = lib/Analysis/CheckNSError.cpp; sourceTree = ""; }; + 35BB2D7E0D19954000944DB5 /* ASTConsumer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ASTConsumer.cpp; path = lib/AST/ASTConsumer.cpp; sourceTree = ""; tabWidth = 2; }; + 35BFBD2B0C9EDE1E006CB644 /* ASTConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ASTConsumer.h; path = clang/AST/ASTConsumer.h; sourceTree = ""; tabWidth = 2; }; + 35CEA05A0DF9E82700A41296 /* ExprObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ExprObjC.h; path = clang/AST/ExprObjC.h; sourceTree = ""; tabWidth = 2; }; + 35CFFDFF0CA1CBCB00E6F2BE /* StmtViz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtViz.cpp; path = lib/AST/StmtViz.cpp; sourceTree = ""; tabWidth = 2; }; + 35CFFE010CA1CBDD00E6F2BE /* StmtGraphTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = StmtGraphTraits.h; path = clang/AST/StmtGraphTraits.h; sourceTree = ""; tabWidth = 2; }; + 35D1DDD10CA9C6D50096E967 /* DataflowSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataflowSolver.h; path = clang/Analysis/FlowSensitive/DataflowSolver.h; sourceTree = ""; }; + 35D1DDD20CA9C6D50096E967 /* DataflowValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataflowValues.h; path = clang/Analysis/FlowSensitive/DataflowValues.h; sourceTree = ""; }; + 35D55B240D81D8C60092E734 /* BasicValueFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BasicValueFactory.cpp; path = lib/Analysis/BasicValueFactory.cpp; sourceTree = ""; }; + 35D55B250D81D8C60092E734 /* CFRefCount.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFRefCount.cpp; path = lib/Analysis/CFRefCount.cpp; sourceTree = ""; }; + 35D55B290D81D8E50092E734 /* BasicValueFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BasicValueFactory.h; path = clang/Analysis/PathSensitive/BasicValueFactory.h; sourceTree = ""; }; + 35E194670ECB82FB00F21733 /* SemaCXXScopeSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaCXXScopeSpec.cpp; path = lib/Sema/SemaCXXScopeSpec.cpp; sourceTree = ""; tabWidth = 2; }; + 35E194680ECB82FB00F21733 /* SemaNamedCast.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaNamedCast.cpp; path = lib/Sema/SemaNamedCast.cpp; sourceTree = ""; tabWidth = 2; }; + 35E1946C0ECB83C100F21733 /* PTHLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PTHLexer.cpp; sourceTree = ""; }; + 35EE48AD0E0C4CB200715C54 /* DeclCXX.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclCXX.h; path = clang/AST/DeclCXX.h; sourceTree = ""; tabWidth = 2; }; + 35EE48AE0E0C4CB200715C54 /* ParentMap.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ParentMap.h; path = clang/AST/ParentMap.h; sourceTree = ""; tabWidth = 2; }; + 35EE48AF0E0C4CCA00715C54 /* DeclCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclCXX.cpp; path = lib/AST/DeclCXX.cpp; sourceTree = ""; tabWidth = 2; }; + 35EE48B00E0C4CCA00715C54 /* ParentMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParentMap.cpp; path = lib/AST/ParentMap.cpp; sourceTree = ""; tabWidth = 2; }; + 35EF676F0DAD1D2C00B19414 /* SemaDeclCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaDeclCXX.cpp; path = lib/Sema/SemaDeclCXX.cpp; sourceTree = ""; tabWidth = 2; }; + 35EFEFB50DB67ED60020783D /* GRTransferFuncs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRTransferFuncs.cpp; path = lib/Analysis/GRTransferFuncs.cpp; sourceTree = ""; }; + 35F1ACE60E66166C001F4532 /* ConstraintManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConstraintManager.h; path = clang/Analysis/PathSensitive/ConstraintManager.h; sourceTree = ""; }; + 35F2A01D0E36AFF100D17527 /* CheckObjCUnusedIVars.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckObjCUnusedIVars.cpp; path = lib/Analysis/CheckObjCUnusedIVars.cpp; sourceTree = ""; }; + 35F2BE7B0DAC2963006E7668 /* HTMLRewrite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLRewrite.h; path = clang/Rewrite/HTMLRewrite.h; sourceTree = ""; }; + 35F8D0CA0D9B7E8200D91C5E /* GRSimpleAPICheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRSimpleAPICheck.h; path = clang/Analysis/PathSensitive/GRSimpleAPICheck.h; sourceTree = ""; }; + 35F8D0CB0D9B7E8200D91C5E /* GRAuditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRAuditor.h; path = clang/Analysis/PathSensitive/GRAuditor.h; sourceTree = ""; }; + 35F8D0D50D9B82CD00D91C5E /* BasicObjCFoundationChecks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BasicObjCFoundationChecks.cpp; path = lib/Analysis/BasicObjCFoundationChecks.cpp; sourceTree = ""; }; + 35F9B1550D1C6B2E00DDFDAE /* LiveVariables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LiveVariables.h; path = clang/Analysis/Analyses/LiveVariables.h; sourceTree = ""; }; + 35F9B1560D1C6B2E00DDFDAE /* UninitializedValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UninitializedValues.h; path = clang/Analysis/Analyses/UninitializedValues.h; sourceTree = ""; }; + 35FE6BCE0DF6EE1F00739712 /* DeclBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclBase.cpp; path = lib/AST/DeclBase.cpp; sourceTree = ""; tabWidth = 2; }; + 72D16C1E0D9975C400E6DA4A /* HTMLRewrite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLRewrite.cpp; path = lib/Rewrite/HTMLRewrite.cpp; sourceTree = ""; }; + 84AF36A00CB17A3B00C820A5 /* DeclObjC.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclObjC.h; path = clang/AST/DeclObjC.h; sourceTree = ""; tabWidth = 2; }; + 84D9A8870C1A57E100AC7ABC /* AttributeList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = AttributeList.cpp; path = lib/Parse/AttributeList.cpp; sourceTree = ""; tabWidth = 2; }; + 84D9A88B0C1A581300AC7ABC /* AttributeList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = AttributeList.h; path = clang/Parse/AttributeList.h; sourceTree = ""; tabWidth = 2; }; + 8DD76F6C0486A84900D96B5E /* clang */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = clang; sourceTree = BUILT_PRODUCTS_DIR; }; + 9063F2210F9E8BDF002F7251 /* ExternalSemaSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExternalSemaSource.h; path = clang/Sema/ExternalSemaSource.h; sourceTree = ""; }; + 9063F2220F9E8BDF002F7251 /* SemaConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SemaConsumer.h; path = clang/Sema/SemaConsumer.h; sourceTree = ""; }; + 9063F2280F9E911F002F7251 /* OnDiskHashTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnDiskHashTable.h; sourceTree = ""; }; + 9063F2290F9E911F002F7251 /* SourceManagerInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceManagerInternals.h; sourceTree = ""; }; + 9063F22A0F9E911F002F7251 /* TemplateKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemplateKinds.h; sourceTree = ""; }; + 906BF4AE0F83BA16001071FA /* ConvertUTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConvertUTF.h; sourceTree = ""; }; + 906BF4AF0F83BA2E001071FA /* ConvertUTF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ConvertUTF.c; sourceTree = ""; }; + 90FB99DE0F98FB1D008F9415 /* DeclContextInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeclContextInternals.h; path = clang/AST/DeclContextInternals.h; sourceTree = ""; }; + 90FB99DF0F98FB1D008F9415 /* DeclVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeclVisitor.h; path = clang/AST/DeclVisitor.h; sourceTree = ""; }; + 90FB99E00F98FB1D008F9415 /* ExternalASTSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExternalASTSource.h; path = clang/AST/ExternalASTSource.h; sourceTree = ""; }; + DE01DA480B12ADA300AC22CE /* PPCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PPCallbacks.h; sourceTree = ""; }; + DE06756B0C051CFE00EBBFD8 /* ParseExprCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseExprCXX.cpp; path = lib/Parse/ParseExprCXX.cpp; sourceTree = ""; tabWidth = 2; }; + DE06B73D0A8307640050E87E /* LangOptions.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = LangOptions.h; sourceTree = ""; tabWidth = 2; }; + DE06BECA0A854E4B0050E87E /* Scope.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Scope.h; path = clang/Parse/Scope.h; sourceTree = ""; tabWidth = 2; }; + DE06D42F0A8BB52D0050E87E /* Parser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Parser.cpp; path = lib/Parse/Parser.cpp; sourceTree = ""; tabWidth = 2; }; + DE06E8130A8FF9330050E87E /* Action.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Action.h; path = clang/Parse/Action.h; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; + DE0FCA620A95859D00248FD5 /* Expr.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Expr.h; path = clang/AST/Expr.h; sourceTree = ""; tabWidth = 2; }; + DE0FCB330A9C21F100248FD5 /* Expr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Expr.cpp; path = lib/AST/Expr.cpp; sourceTree = ""; tabWidth = 2; }; + DE1263C20EF2341900F56D2B /* Ownership.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Ownership.h; path = clang/Parse/Ownership.h; sourceTree = ""; tabWidth = 2; }; + DE1732FF0B068B700080B521 /* ASTContext.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ASTContext.cpp; path = lib/AST/ASTContext.cpp; sourceTree = ""; tabWidth = 2; }; + DE17336D0B068DC20080B521 /* DeclSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclSpec.cpp; path = lib/Parse/DeclSpec.cpp; sourceTree = ""; tabWidth = 2; }; + DE17336F0B068DC60080B521 /* DeclSpec.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclSpec.h; path = clang/Parse/DeclSpec.h; sourceTree = ""; tabWidth = 2; }; + DE1F22020A7D852A00FBF588 /* Parser.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Parser.h; path = clang/Parse/Parser.h; sourceTree = ""; tabWidth = 2; }; + DE224FF70C7AA98800D370A5 /* CGExprComplex.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprComplex.cpp; path = lib/CodeGen/CGExprComplex.cpp; sourceTree = ""; tabWidth = 2; }; + DE22526F0C7E82D000D370A5 /* CGExprScalar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprScalar.cpp; path = lib/CodeGen/CGExprScalar.cpp; sourceTree = ""; tabWidth = 2; }; + DE2255FB0C8004E600D370A5 /* ParseDeclCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseDeclCXX.cpp; path = lib/Parse/ParseDeclCXX.cpp; sourceTree = ""; tabWidth = 2; }; + DE22BCF10E14197E0094DC60 /* SemaDeclAttr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaDeclAttr.cpp; path = lib/Sema/SemaDeclAttr.cpp; sourceTree = ""; tabWidth = 2; }; + DE344AB70AE5DF6D00DBC861 /* HeaderSearch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HeaderSearch.h; sourceTree = ""; }; + DE344B530AE5E46C00DBC861 /* HeaderSearch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HeaderSearch.cpp; sourceTree = ""; }; + DE3450D60AEB543100DBC861 /* DirectoryLookup.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DirectoryLookup.h; sourceTree = ""; }; + DE3452400AEF1A2D00DBC861 /* Stmt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Stmt.cpp; path = lib/AST/Stmt.cpp; sourceTree = ""; tabWidth = 2; }; + DE3452800AEF1B1800DBC861 /* Stmt.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Stmt.h; path = clang/AST/Stmt.h; sourceTree = ""; tabWidth = 2; }; + DE345C190AFC658B00DBC861 /* StmtVisitor.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = StmtVisitor.h; path = clang/AST/StmtVisitor.h; sourceTree = ""; tabWidth = 2; }; + DE345F210AFD347900DBC861 /* StmtNodes.def */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = text; name = StmtNodes.def; path = clang/AST/StmtNodes.def; sourceTree = ""; tabWidth = 2; }; + DE345FFF0AFDCC1900DBC861 /* ParseObjc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseObjc.cpp; path = lib/Parse/ParseObjc.cpp; sourceTree = ""; tabWidth = 2; }; + DE3460040AFDCC6500DBC861 /* ParseInit.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseInit.cpp; path = lib/Parse/ParseInit.cpp; sourceTree = ""; tabWidth = 2; }; + DE34600A0AFDCCBF00DBC861 /* ParseStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseStmt.cpp; path = lib/Parse/ParseStmt.cpp; sourceTree = ""; tabWidth = 2; }; + DE34600E0AFDCCCE00DBC861 /* ParseDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseDecl.cpp; path = lib/Parse/ParseDecl.cpp; sourceTree = ""; tabWidth = 2; }; + DE3460120AFDCCDA00DBC861 /* ParseExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseExpr.cpp; path = lib/Parse/ParseExpr.cpp; sourceTree = ""; tabWidth = 2; }; + DE3461260AFE68BE00DBC861 /* MinimalAction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = MinimalAction.cpp; path = lib/Parse/MinimalAction.cpp; sourceTree = ""; tabWidth = 2; }; + DE34621C0AFEB19B00DBC861 /* StmtPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtPrinter.cpp; path = lib/AST/StmtPrinter.cpp; sourceTree = ""; tabWidth = 2; }; + DE3464210B03040900DBC861 /* Type.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Type.h; path = clang/AST/Type.h; sourceTree = ""; tabWidth = 2; }; + DE38CD4E0D794CF900A273B6 /* CGObjCRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGObjCRuntime.h; path = lib/CodeGen/CGObjCRuntime.h; sourceTree = ""; tabWidth = 2; }; + DE38CD4F0D794D0100A273B6 /* CGObjCGNU.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGObjCGNU.cpp; path = lib/CodeGen/CGObjCGNU.cpp; sourceTree = ""; tabWidth = 2; }; + DE38CF260D8C9E6C00A273B6 /* DeclObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclObjC.cpp; path = lib/AST/DeclObjC.cpp; sourceTree = ""; tabWidth = 2; }; + DE3986EF0CB8D4B300223765 /* IdentifierTable.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = IdentifierTable.h; sourceTree = ""; tabWidth = 2; }; + DE3986F30CB8D50C00223765 /* IdentifierTable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = IdentifierTable.cpp; sourceTree = ""; tabWidth = 2; }; + DE3B90DE0EAC5EF200D01046 /* ExtensionRAIIObject.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ExtensionRAIIObject.h; path = lib/Parse/ExtensionRAIIObject.h; sourceTree = ""; tabWidth = 2; }; + DE3B921C0EB1A81400D01046 /* SemaInherit.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = SemaInherit.h; path = lib/Sema/SemaInherit.h; sourceTree = ""; tabWidth = 2; }; + DE3B92230EB5152000D01046 /* Designator.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Designator.h; path = clang/Parse/Designator.h; sourceTree = ""; tabWidth = 2; }; + DE41211D0D7F1BBE0080F80A /* GRWorkList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRWorkList.h; path = clang/Analysis/PathSensitive/GRWorkList.h; sourceTree = ""; }; + DE41211E0D7F1BBE0080F80A /* SymbolManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SymbolManager.h; path = clang/Analysis/PathSensitive/SymbolManager.h; sourceTree = ""; }; + DE41211F0D7F1BBE0080F80A /* GRBlockCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRBlockCounter.h; path = clang/Analysis/PathSensitive/GRBlockCounter.h; sourceTree = ""; }; + DE4121200D7F1BBE0080F80A /* ExplodedGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExplodedGraph.h; path = clang/Analysis/PathSensitive/ExplodedGraph.h; sourceTree = ""; }; + DE4121210D7F1BBE0080F80A /* GRExprEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRExprEngine.h; path = clang/Analysis/PathSensitive/GRExprEngine.h; sourceTree = ""; }; + DE4121220D7F1BBE0080F80A /* GRTransferFuncs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRTransferFuncs.h; path = clang/Analysis/PathSensitive/GRTransferFuncs.h; sourceTree = ""; }; + DE4121230D7F1BBE0080F80A /* GRCoreEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRCoreEngine.h; path = clang/Analysis/PathSensitive/GRCoreEngine.h; sourceTree = ""; }; + DE4121270D7F1C1C0080F80A /* SymbolManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolManager.cpp; path = lib/Analysis/SymbolManager.cpp; sourceTree = ""; }; + DE4121280D7F1C1C0080F80A /* ExplodedGraph.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExplodedGraph.cpp; path = lib/Analysis/ExplodedGraph.cpp; sourceTree = ""; }; + DE4121290D7F1C1C0080F80A /* UninitializedValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UninitializedValues.cpp; path = lib/Analysis/UninitializedValues.cpp; sourceTree = ""; }; + DE41212A0D7F1C1C0080F80A /* GRCoreEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRCoreEngine.cpp; path = lib/Analysis/GRCoreEngine.cpp; sourceTree = ""; }; + DE41212C0D7F1C1C0080F80A /* GRSimpleVals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRSimpleVals.h; path = lib/Analysis/GRSimpleVals.h; sourceTree = ""; }; + DE41212F0D7F1C1C0080F80A /* GRSimpleVals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRSimpleVals.cpp; path = lib/Analysis/GRSimpleVals.cpp; sourceTree = ""; }; + DE4121300D7F1C1C0080F80A /* GRBlockCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRBlockCounter.cpp; path = lib/Analysis/GRBlockCounter.cpp; sourceTree = ""; }; + DE4121310D7F1C1C0080F80A /* GRExprEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRExprEngine.cpp; path = lib/Analysis/GRExprEngine.cpp; sourceTree = ""; }; + DE4264FB0C113592005A861D /* CGDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGDecl.cpp; path = lib/CodeGen/CGDecl.cpp; sourceTree = ""; tabWidth = 2; }; + DE46BF270AE0A82D00CC047C /* TargetInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = TargetInfo.h; sourceTree = ""; tabWidth = 2; }; + DE4772F90C10EAE5002239E8 /* CGStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGStmt.cpp; path = lib/CodeGen/CGStmt.cpp; sourceTree = ""; tabWidth = 2; }; + DE4772FB0C10EAEC002239E8 /* CGExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExpr.cpp; path = lib/CodeGen/CGExpr.cpp; sourceTree = ""; tabWidth = 2; }; + DE47999B0D2EBE1A00706D2D /* SemaExprObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaExprObjC.cpp; path = lib/Sema/SemaExprObjC.cpp; sourceTree = ""; tabWidth = 2; }; + DE4DC7980EA1BE4400069E5A /* TokenRewriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TokenRewriter.h; path = clang/Rewrite/TokenRewriter.h; sourceTree = ""; }; + DE4DC7A20EA1C33E00069E5A /* TokenRewriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TokenRewriter.cpp; path = lib/Rewrite/TokenRewriter.cpp; sourceTree = ""; }; + DE53370B0CE2D96F00D9A028 /* RewriteRope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RewriteRope.h; path = clang/Rewrite/RewriteRope.h; sourceTree = ""; }; + DE613EF30E0E148D00B05B79 /* APValue.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = APValue.h; path = clang/AST/APValue.h; sourceTree = ""; tabWidth = 2; }; + DE67E70A0C020EC500F66BC5 /* SemaType.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaType.cpp; path = lib/Sema/SemaType.cpp; sourceTree = ""; tabWidth = 2; }; + DE67E70C0C020ECA00F66BC5 /* SemaStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaStmt.cpp; path = lib/Sema/SemaStmt.cpp; sourceTree = ""; tabWidth = 2; }; + DE67E70E0C020ECF00F66BC5 /* SemaExprCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaExprCXX.cpp; path = lib/Sema/SemaExprCXX.cpp; sourceTree = ""; tabWidth = 2; }; + DE67E7100C020ED400F66BC5 /* SemaExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaExpr.cpp; path = lib/Sema/SemaExpr.cpp; sourceTree = ""; tabWidth = 2; }; + DE67E7120C020ED900F66BC5 /* SemaDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaDecl.cpp; path = lib/Sema/SemaDecl.cpp; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; + DE67E7140C020EDF00F66BC5 /* Sema.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Sema.h; path = lib/Sema/Sema.h; sourceTree = ""; tabWidth = 2; }; + DE67E7160C020EE400F66BC5 /* Sema.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Sema.cpp; path = lib/Sema/Sema.cpp; sourceTree = ""; tabWidth = 2; }; + DE67E7190C020F4F00F66BC5 /* ParseAST.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseAST.cpp; path = lib/Sema/ParseAST.cpp; sourceTree = ""; tabWidth = 2; }; + DE67E7270C02109800F66BC5 /* ParseAST.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ParseAST.h; path = clang/Sema/ParseAST.h; sourceTree = ""; }; + DE6951C60C4D1F5D00A5826B /* RecordLayout.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = RecordLayout.h; path = clang/AST/RecordLayout.h; sourceTree = ""; tabWidth = 2; }; + DE6954630C5121BD00A5826B /* Token.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Token.h; sourceTree = ""; }; + DE704B250D0FBEBE009C7762 /* SemaDeclObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaDeclObjC.cpp; path = lib/Sema/SemaDeclObjC.cpp; sourceTree = ""; tabWidth = 2; }; + DE704BD10D1647E7009C7762 /* HeaderMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeaderMap.h; sourceTree = ""; }; + DE704DD10D1668A4009C7762 /* HeaderMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HeaderMap.cpp; sourceTree = ""; }; + DE75ED280B044DC90020CF81 /* ASTContext.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ASTContext.h; path = clang/AST/ASTContext.h; sourceTree = ""; tabWidth = 2; }; + DE75EDF00B06880E0020CF81 /* Type.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Type.cpp; path = lib/AST/Type.cpp; sourceTree = ""; tabWidth = 2; }; + DE85CD800D8380B10070E26E /* TokenLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TokenLexer.cpp; sourceTree = ""; }; + DE85CD840D8380F20070E26E /* TokenLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TokenLexer.h; sourceTree = ""; }; + DE85CD9E0D8382DD0070E26E /* MacroArgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroArgs.h; sourceTree = ""; }; + DE85CDA20D8383B20070E26E /* MacroArgs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MacroArgs.cpp; sourceTree = ""; }; + DE85CDAB0D838C120070E26E /* PPMacroExpansion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPMacroExpansion.cpp; sourceTree = ""; }; + DE85CDAF0D838C390070E26E /* PPDirectives.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPDirectives.cpp; sourceTree = ""; }; + DE85CDB50D839BAE0070E26E /* PPLexerChange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPLexerChange.cpp; sourceTree = ""; }; + DE8822350EC80C0A00CBC30A /* CGBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGBuilder.h; path = lib/CodeGen/CGBuilder.h; sourceTree = ""; tabWidth = 2; }; + DE8823CA0ED0046600CBC30A /* APValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = APValue.cpp; path = lib/AST/APValue.cpp; sourceTree = ""; }; + DE8823DE0ED0B78600CBC30A /* PTHLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PTHLexer.h; sourceTree = ""; }; + DE8824530ED1243E00CBC30A /* OperatorKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OperatorKinds.h; sourceTree = ""; }; + DE8824560ED1244600CBC30A /* OperatorKinds.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OperatorKinds.def; sourceTree = ""; }; + DE928B120C05659200231DA4 /* ModuleBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleBuilder.cpp; path = lib/CodeGen/ModuleBuilder.cpp; sourceTree = ""; tabWidth = 2; }; + DE928B1F0C0565B000231DA4 /* ModuleBuilder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ModuleBuilder.h; path = clang/CodeGen/ModuleBuilder.h; sourceTree = ""; }; + DE928B7C0C0A615100231DA4 /* CodeGenModule.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CodeGenModule.h; path = lib/CodeGen/CodeGenModule.h; sourceTree = ""; tabWidth = 2; }; + DE928B7E0C0A615600231DA4 /* CodeGenModule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CodeGenModule.cpp; path = lib/CodeGen/CodeGenModule.cpp; sourceTree = ""; tabWidth = 2; }; + DE928B800C0A615B00231DA4 /* CodeGenFunction.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CodeGenFunction.h; path = lib/CodeGen/CodeGenFunction.h; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; + DE928B820C0A616000231DA4 /* CodeGenFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CodeGenFunction.cpp; path = lib/CodeGen/CodeGenFunction.cpp; sourceTree = ""; tabWidth = 2; }; + DEA09A6E0F31756F000C2258 /* ASTDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ASTDiagnostic.h; path = clang/AST/ASTDiagnostic.h; sourceTree = ""; tabWidth = 2; }; + DEA09A830F3175BF000C2258 /* LexDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LexDiagnostic.h; sourceTree = ""; }; + DEA09A860F3175CA000C2258 /* ParseDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ParseDiagnostic.h; path = clang/Parse/ParseDiagnostic.h; sourceTree = ""; tabWidth = 2; }; + DEA09A890F3175D9000C2258 /* SemaDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SemaDiagnostic.h; path = clang/Sema/SemaDiagnostic.h; sourceTree = ""; }; + DEAABDF70F5F477C0098928A /* PrettyStackTrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrettyStackTrace.h; sourceTree = ""; }; + DEAEE98A0A5A2B970045101B /* MultipleIncludeOpt.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MultipleIncludeOpt.h; sourceTree = ""; }; + DEAEED4A0A5AF89A0045101B /* NOTES.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = NOTES.txt; sourceTree = ""; }; + DEB076C90F3A221200F5A2BE /* DeclTemplate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclTemplate.h; path = clang/AST/DeclTemplate.h; sourceTree = ""; tabWidth = 2; }; + DEB076CE0F3A222200F5A2BE /* DeclTemplate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DeclTemplate.cpp; path = lib/AST/DeclTemplate.cpp; sourceTree = ""; }; + DEB077930F44F96000F5A2BE /* TokenConcatenation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TokenConcatenation.h; sourceTree = ""; }; + DEB077980F44F97800F5A2BE /* TokenConcatenation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TokenConcatenation.cpp; sourceTree = ""; }; + DEB07AC70F4A427E00F5A2BE /* SemaAttr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaAttr.cpp; path = lib/Sema/SemaAttr.cpp; sourceTree = ""; tabWidth = 2; }; + DEB089EE0F12F1D900522C07 /* TypeTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeTraits.h; sourceTree = ""; }; + DEC63B190C7B940200DBF169 /* CFG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CFG.cpp; path = lib/AST/CFG.cpp; sourceTree = ""; tabWidth = 2; }; + DEC63B1B0C7B940600DBF169 /* CFG.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CFG.h; path = clang/AST/CFG.h; sourceTree = ""; tabWidth = 2; }; + DEC8D9900A9433CD00353FCA /* Decl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Decl.h; path = clang/AST/Decl.h; sourceTree = ""; tabWidth = 2; }; + DEC8D9A30A94346E00353FCA /* AST.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = AST.h; path = clang/AST/AST.h; sourceTree = ""; tabWidth = 2; }; + DECAB0CF0DB3C84200E13CCB /* RewriteRope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteRope.cpp; path = lib/Rewrite/RewriteRope.cpp; sourceTree = ""; }; + DECB6D640F9AE26600F5FBC7 /* JumpDiagnostics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JumpDiagnostics.cpp; path = lib/Sema/JumpDiagnostics.cpp; sourceTree = ""; }; + DECB6F030F9D939A00F5FBC7 /* InitPreprocessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InitPreprocessor.h; path = clang/Frontend/InitPreprocessor.h; sourceTree = ""; }; + DECB6F060F9D93A800F5FBC7 /* InitPreprocessor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InitPreprocessor.cpp; path = lib/Frontend/InitPreprocessor.cpp; sourceTree = ""; }; + DECB734E0FA3ED8400F5FBC7 /* StmtObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StmtObjC.h; path = clang/AST/StmtObjC.h; sourceTree = ""; }; + DECB73550FA3EE5A00F5FBC7 /* StmtCXX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StmtCXX.h; path = clang/AST/StmtCXX.h; sourceTree = ""; }; + DECB77120FA5752300F5FBC7 /* PCHReaderStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PCHReaderStmt.cpp; path = lib/Frontend/PCHReaderStmt.cpp; sourceTree = ""; }; + DECB77780FA579B000F5FBC7 /* PCHReaderDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PCHReaderDecl.cpp; path = lib/Frontend/PCHReaderDecl.cpp; sourceTree = ""; }; + DECB77F60FA5850200F5FBC7 /* PCHWriterDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PCHWriterDecl.cpp; path = lib/Frontend/PCHWriterDecl.cpp; sourceTree = ""; }; + DECB78160FA5882F00F5FBC7 /* PCHWriterStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PCHWriterStmt.cpp; path = lib/Frontend/PCHWriterStmt.cpp; sourceTree = ""; }; + DECB78540FA58F5500F5FBC7 /* AccessSpecifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AccessSpecifier.h; path = clang/Parse/AccessSpecifier.h; sourceTree = ""; }; + DED626C80AE0C065001E80A4 /* TargetInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = TargetInfo.cpp; sourceTree = ""; tabWidth = 2; }; + DED62ABA0AE2EDF1001E80A4 /* Decl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Decl.cpp; path = lib/AST/Decl.cpp; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; + DED676D00B6C786700AAD4A3 /* Builtins.def */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = text; name = Builtins.def; path = clang/AST/Builtins.def; sourceTree = ""; tabWidth = 2; }; + DED676F90B6C797B00AAD4A3 /* Builtins.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Builtins.h; path = clang/AST/Builtins.h; sourceTree = ""; tabWidth = 2; }; + DED677C80B6C854100AAD4A3 /* Builtins.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Builtins.cpp; path = lib/AST/Builtins.cpp; sourceTree = ""; tabWidth = 2; }; + DED7D7310A524295003AD0FB /* Diagnostic.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = Diagnostic.h; sourceTree = ""; tabWidth = 2; }; + DED7D7330A524295003AD0FB /* FileManager.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = FileManager.h; sourceTree = ""; tabWidth = 2; }; + DED7D7350A524295003AD0FB /* SourceLocation.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = SourceLocation.h; sourceTree = ""; tabWidth = 2; }; + DED7D7360A524295003AD0FB /* SourceManager.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = SourceManager.h; sourceTree = ""; tabWidth = 2; }; + DED7D7370A524295003AD0FB /* TokenKinds.def */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = text; path = TokenKinds.def; sourceTree = ""; tabWidth = 2; }; + DED7D7380A524295003AD0FB /* TokenKinds.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = TokenKinds.h; sourceTree = ""; tabWidth = 2; }; + DED7D73B0A524295003AD0FB /* Lexer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Lexer.h; sourceTree = ""; }; + DED7D73E0A524295003AD0FB /* MacroInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MacroInfo.h; sourceTree = ""; }; + DED7D73F0A524295003AD0FB /* Pragma.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Pragma.h; sourceTree = ""; }; + DED7D7400A524295003AD0FB /* Preprocessor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Preprocessor.h; sourceTree = ""; }; + DED7D75D0A5242C7003AD0FB /* Diagnostic.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = Diagnostic.cpp; sourceTree = ""; tabWidth = 2; }; + DED7D75E0A5242C7003AD0FB /* FileManager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = FileManager.cpp; sourceTree = ""; tabWidth = 2; }; + DED7D76D0A5242C7003AD0FB /* SourceManager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = SourceManager.cpp; sourceTree = ""; tabWidth = 2; }; + DED7D76E0A5242C7003AD0FB /* TokenKinds.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = TokenKinds.cpp; sourceTree = ""; tabWidth = 2; }; + DED7D79E0A5242E6003AD0FB /* Lexer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Lexer.cpp; sourceTree = ""; }; + DED7D7A00A5242E6003AD0FB /* MacroInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MacroInfo.cpp; sourceTree = ""; }; + DED7D7A20A5242E6003AD0FB /* PPExpressions.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PPExpressions.cpp; sourceTree = ""; }; + DED7D7A30A5242E6003AD0FB /* Pragma.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Pragma.cpp; sourceTree = ""; }; + DED7D7A40A5242E6003AD0FB /* Preprocessor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Preprocessor.cpp; sourceTree = ""; }; + DED7D7D70A524302003AD0FB /* README.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = README.txt; sourceTree = ""; }; + DED7D9170A52518C003AD0FB /* ScratchBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ScratchBuffer.h; sourceTree = ""; }; + DED7D9E40A5257F6003AD0FB /* ScratchBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ScratchBuffer.cpp; sourceTree = ""; }; + DEDFE5270F63A9230035BD10 /* DeclNodes.def */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = text; name = DeclNodes.def; path = clang/AST/DeclNodes.def; sourceTree = ""; tabWidth = 2; }; + DEDFE5CB0F7206CC0035BD10 /* NestedNameSpecifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NestedNameSpecifier.h; path = clang/AST/NestedNameSpecifier.h; sourceTree = ""; }; + DEDFE5CE0F7206E40035BD10 /* NestedNameSpecifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NestedNameSpecifier.cpp; path = lib/AST/NestedNameSpecifier.cpp; sourceTree = ""; }; + DEDFE6450F7B3B4E0035BD10 /* driver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = driver.cpp; path = tools/driver/driver.cpp; sourceTree = ""; }; + DEDFE6480F7B3B830035BD10 /* Types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Types.cpp; path = lib/Driver/Types.cpp; sourceTree = ""; }; + DEDFE6490F7B3B830035BD10 /* Tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Tools.h; path = lib/Driver/Tools.h; sourceTree = ""; }; + DEDFE64A0F7B3B830035BD10 /* Tools.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Tools.cpp; path = lib/Driver/Tools.cpp; sourceTree = ""; }; + DEDFE64B0F7B3B830035BD10 /* ToolChains.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ToolChains.h; path = lib/Driver/ToolChains.h; sourceTree = ""; }; + DEDFE64C0F7B3B830035BD10 /* Compilation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Compilation.cpp; path = lib/Driver/Compilation.cpp; sourceTree = ""; }; + DEDFE64D0F7B3B830035BD10 /* ArgList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ArgList.cpp; path = lib/Driver/ArgList.cpp; sourceTree = ""; }; + DEDFE64E0F7B3B830035BD10 /* Arg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Arg.cpp; path = lib/Driver/Arg.cpp; sourceTree = ""; }; + DEDFE64F0F7B3B830035BD10 /* Action.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Action.cpp; path = lib/Driver/Action.cpp; sourceTree = ""; }; + DEDFE6500F7B3B830035BD10 /* Phases.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Phases.cpp; path = lib/Driver/Phases.cpp; sourceTree = ""; }; + DEDFE6510F7B3B830035BD10 /* OptTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptTable.cpp; path = lib/Driver/OptTable.cpp; sourceTree = ""; }; + DEDFE6520F7B3B830035BD10 /* Option.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Option.cpp; path = lib/Driver/Option.cpp; sourceTree = ""; }; + DEDFE6530F7B3B830035BD10 /* Job.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Job.cpp; path = lib/Driver/Job.cpp; sourceTree = ""; }; + DEDFE6540F7B3B830035BD10 /* InputInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InputInfo.h; path = lib/Driver/InputInfo.h; sourceTree = ""; }; + DEDFE6550F7B3B830035BD10 /* ToolChains.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ToolChains.cpp; path = lib/Driver/ToolChains.cpp; sourceTree = ""; }; + DEDFE6560F7B3B830035BD10 /* ToolChain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ToolChain.cpp; path = lib/Driver/ToolChain.cpp; sourceTree = ""; }; + DEDFE6570F7B3B830035BD10 /* Tool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Tool.cpp; path = lib/Driver/Tool.cpp; sourceTree = ""; }; + DEDFE6580F7B3B830035BD10 /* HostInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HostInfo.cpp; path = lib/Driver/HostInfo.cpp; sourceTree = ""; }; + DEDFE6590F7B3B830035BD10 /* Driver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Driver.cpp; path = lib/Driver/Driver.cpp; sourceTree = ""; }; + DEDFF87F0F848CE30035BD10 /* TemplateName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TemplateName.h; path = clang/AST/TemplateName.h; sourceTree = ""; }; + DEDFF8870F848CF80035BD10 /* TemplateName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TemplateName.cpp; path = lib/AST/TemplateName.cpp; sourceTree = ""; }; + DEDFFF070F959EE60035BD10 /* Diagnostic.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Diagnostic.td; sourceTree = ""; }; + DEDFFF530F9704580035BD10 /* DiagnosticGroups.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticGroups.td; sourceTree = ""; }; + DEEBBD430C19C5D200A9FE82 /* TODO.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = TODO.txt; sourceTree = ""; }; + DEEBC3B90C2363B800A9FE82 /* CodeGenTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CodeGenTypes.h; path = lib/CodeGen/CodeGenTypes.h; sourceTree = ""; tabWidth = 2; }; + DEEBC3BB0C2363BC00A9FE82 /* CodeGenTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CodeGenTypes.cpp; path = lib/CodeGen/CodeGenTypes.cpp; sourceTree = ""; tabWidth = 2; }; + DEF1615E0F65C81C0098507F /* InitHeaderSearch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InitHeaderSearch.h; path = clang/Frontend/InitHeaderSearch.h; sourceTree = ""; }; + DEF1615F0F65C81C0098507F /* ManagerRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ManagerRegistry.h; path = clang/Frontend/ManagerRegistry.h; sourceTree = ""; }; + DEF161600F65C81C0098507F /* TextDiagnosticBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextDiagnosticBuffer.h; path = clang/Frontend/TextDiagnosticBuffer.h; sourceTree = ""; }; + DEF161610F65C81C0098507F /* PathDiagnosticClients.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PathDiagnosticClients.h; path = clang/Frontend/PathDiagnosticClients.h; sourceTree = ""; }; + DEF161620F65C81C0098507F /* CompileOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CompileOptions.h; path = clang/Frontend/CompileOptions.h; sourceTree = ""; }; + DEF161630F65C81C0098507F /* TextDiagnosticPrinter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextDiagnosticPrinter.h; path = clang/Frontend/TextDiagnosticPrinter.h; sourceTree = ""; }; + DEF165140F8D46980098507F /* Tool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Tool.h; path = clang/Driver/Tool.h; sourceTree = ""; }; + DEF165150F8D46980098507F /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Types.h; path = clang/Driver/Types.h; sourceTree = ""; }; + DEF165160F8D46980098507F /* Action.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Action.h; path = clang/Driver/Action.h; sourceTree = ""; }; + DEF165170F8D46980098507F /* Compilation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Compilation.h; path = clang/Driver/Compilation.h; sourceTree = ""; }; + DEF165180F8D46980098507F /* Options.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Options.def; path = clang/Driver/Options.def; sourceTree = ""; }; + DEF165190F8D46980098507F /* Option.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Option.h; path = clang/Driver/Option.h; sourceTree = ""; }; + DEF1651A0F8D46980098507F /* Types.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Types.def; path = clang/Driver/Types.def; sourceTree = ""; }; + DEF1651B0F8D46980098507F /* ToolChain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ToolChain.h; path = clang/Driver/ToolChain.h; sourceTree = ""; }; + DEF1651C0F8D46980098507F /* Options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Options.h; path = clang/Driver/Options.h; sourceTree = ""; }; + DEF1651D0F8D46980098507F /* ArgList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ArgList.h; path = clang/Driver/ArgList.h; sourceTree = ""; }; + DEF1651E0F8D46980098507F /* Arg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Arg.h; path = clang/Driver/Arg.h; sourceTree = ""; }; + DEF1651F0F8D46980098507F /* HostInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HostInfo.h; path = clang/Driver/HostInfo.h; sourceTree = ""; }; + DEF165200F8D46980098507F /* Driver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Driver.h; path = clang/Driver/Driver.h; sourceTree = ""; }; + DEF165210F8D46980098507F /* Job.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Job.h; path = clang/Driver/Job.h; sourceTree = ""; }; + DEF165220F8D46980098507F /* Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Util.h; path = clang/Driver/Util.h; sourceTree = ""; }; + DEF165230F8D46980098507F /* Phases.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Phases.h; path = clang/Driver/Phases.h; sourceTree = ""; }; + DEF165240F8D46980098507F /* DriverDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DriverDiagnostic.h; path = clang/Driver/DriverDiagnostic.h; sourceTree = ""; }; + DEF165700F8FB34D0098507F /* PCHWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PCHWriter.cpp; path = lib/Frontend/PCHWriter.cpp; sourceTree = ""; }; + DEF165740F8FB3510098507F /* PCHReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PCHReader.cpp; path = lib/Frontend/PCHReader.cpp; sourceTree = ""; }; + DEF165780F8FB3690098507F /* PCHWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PCHWriter.h; path = clang/Frontend/PCHWriter.h; sourceTree = ""; }; + DEF1657B0F8FB36E0098507F /* PCHReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PCHReader.h; path = clang/Frontend/PCHReader.h; sourceTree = ""; }; + DEF1657E0F8FB3730098507F /* PCHBitCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PCHBitCodes.h; path = clang/Frontend/PCHBitCodes.h; sourceTree = ""; }; + DEF1683F0F9548DC0098507F /* FixItRewriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FixItRewriter.cpp; path = lib/Frontend/FixItRewriter.cpp; sourceTree = ""; }; + DEF168620F9549250098507F /* FixItRewriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FixItRewriter.h; path = clang/Frontend/FixItRewriter.h; sourceTree = ""; }; + DEF169220F9645960098507F /* FrontendDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FrontendDiagnostic.h; path = clang/Frontend/FrontendDiagnostic.h; sourceTree = ""; }; + DEF1692C0F9645BF0098507F /* AnalysisDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnalysisDiagnostic.h; path = clang/Analysis/AnalysisDiagnostic.h; sourceTree = ""; }; + DEF16BE40FA13A5B0098507F /* TypeNodes.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = TypeNodes.def; path = clang/AST/TypeNodes.def; sourceTree = ""; }; + DEF16BE50FA13A650098507F /* TypeOrdering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TypeOrdering.h; path = clang/AST/TypeOrdering.h; sourceTree = ""; }; + DEF2E95E0C5FBD74000C4259 /* InternalsManual.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; name = InternalsManual.html; path = docs/InternalsManual.html; sourceTree = ""; }; + DEF2EDA60C6A4252000C4259 /* StmtDumper.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtDumper.cpp; path = lib/AST/StmtDumper.cpp; sourceTree = ""; tabWidth = 2; }; + DEF2EFF20C6CDD74000C4259 /* CGExprAgg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprAgg.cpp; path = lib/CodeGen/CGExprAgg.cpp; sourceTree = ""; tabWidth = 2; }; + DEF2F00F0C6CFED5000C4259 /* SemaChecking.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaChecking.cpp; path = lib/Sema/SemaChecking.cpp; sourceTree = ""; tabWidth = 2; }; + DEF7D9F60C9C8B1A0001F598 /* Rewriter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Rewriter.h; path = clang/Rewrite/Rewriter.h; sourceTree = ""; }; + DEF7D9F80C9C8B1D0001F598 /* Rewriter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Rewriter.cpp; path = lib/Rewrite/Rewriter.cpp; sourceTree = ""; }; + DEFFECA30DB093D100B4E7C3 /* DeltaTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeltaTree.h; path = clang/Rewrite/DeltaTree.h; sourceTree = ""; }; + DEFFECA60DB1546600B4E7C3 /* DeltaTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DeltaTree.cpp; path = lib/Rewrite/DeltaTree.cpp; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8DD76F660486A84900D96B5E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 08FB7794FE84155DC02AAC07 /* clang */ = { + isa = PBXGroup; + children = ( + DED7D72E0A524295003AD0FB /* include */, + 08FB7795FE84155DC02AAC07 /* Libraries */, + DEDFE61F0F7B3AE10035BD10 /* Tools */, + C6859E8C029090F304C91782 /* Documentation */, + 1AB674ADFE9D54B511CA2CBB /* Products */, + ); + name = clang; + sourceTree = ""; + }; + 08FB7795FE84155DC02AAC07 /* Libraries */ = { + isa = PBXGroup; + children = ( + DED7D7500A5242C7003AD0FB /* Basic */, + DED7D78C0A5242E6003AD0FB /* Lex */, + DE1F22600A7D8C9B00FBF588 /* Parse */, + DEC8D9920A9433F400353FCA /* AST */, + DE67E7070C020EAB00F66BC5 /* Sema */, + DE927FCC0C0557CD00231DA4 /* CodeGen */, + 356EF9B30C8F7DCA006650F5 /* Analysis */, + DEF7D9F50C9C8B0C0001F598 /* Rewrite */, + 352246E00F5C6BC000D0D279 /* Frontend */, + DEDFE6470F7B3B560035BD10 /* Driver */, + ); + name = Libraries; + sourceTree = ""; + }; + 1AB674ADFE9D54B511CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8DD76F6C0486A84900D96B5E /* clang */, + ); + name = Products; + sourceTree = ""; + }; + 3507E4C30E27FE3800FB7B57 /* Checks */ = { + isa = PBXGroup; + children = ( + 35BAC1E70E82C5B7003FB76F /* CheckNSError.cpp */, + 356B89760D9BFDC100CBEBE9 /* BasicObjCFoundationChecks.h */, + 35F8D0D50D9B82CD00D91C5E /* BasicObjCFoundationChecks.cpp */, + 35862B0C0E3628CB0009F542 /* CheckDeadStores.cpp */, + 3595AFB70E1C8D62004CDF09 /* CheckObjCDealloc.cpp */, + 3507E4C10E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp */, + 35F2A01D0E36AFF100D17527 /* CheckObjCUnusedIVars.cpp */, + DE4121290D7F1C1C0080F80A /* UninitializedValues.cpp */, + ); + name = Checks; + sourceTree = ""; + }; + 3507E4C60E27FE5500FB7B57 /* Core */ = { + isa = PBXGroup; + children = ( + 35A057E10EAE2D950069249F /* SVals.cpp */, + 355106850E9A8507006A4E44 /* MemRegion.cpp */, + 35D55B240D81D8C60092E734 /* BasicValueFactory.cpp */, + 3536456A0E23EBF7009C6509 /* Environment.cpp */, + DE4121280D7F1C1C0080F80A /* ExplodedGraph.cpp */, + DE4121300D7F1C1C0080F80A /* GRBlockCounter.cpp */, + DE41212A0D7F1C1C0080F80A /* GRCoreEngine.cpp */, + DE4121310D7F1C1C0080F80A /* GRExprEngine.cpp */, + 35862B110E3629850009F542 /* GRExprEngineInternalChecks.cpp */, + 358F51510E529AA4007F2102 /* GRState.cpp */, + 35EFEFB50DB67ED60020783D /* GRTransferFuncs.cpp */, + DE4121270D7F1C1C0080F80A /* SymbolManager.cpp */, + ); + name = Core; + sourceTree = ""; + }; + 3507E4C90E27FE9000FB7B57 /* Bug Reporting */ = { + isa = PBXGroup; + children = ( + 35A8FCF80D9B4B29001C2F97 /* PathDiagnostic.cpp */, + 359379090DA48ABA0043B19C /* BugReporter.cpp */, + ); + name = "Bug Reporting"; + sourceTree = ""; + }; + 3507E4CC0E27FEB900FB7B57 /* Flow-Sensitive Analyses */ = { + isa = PBXGroup; + children = ( + 356EF9B40C8F7DDF006650F5 /* LiveVariables.cpp */, + ); + name = "Flow-Sensitive Analyses"; + sourceTree = ""; + }; + 352246E00F5C6BC000D0D279 /* Frontend */ = { + isa = PBXGroup; + children = ( + 1A2A54A40FD1DD1C00F4CE45 /* AnalysisConsumer.cpp */, + 1A2A54A50FD1DD1C00F4CE45 /* ASTConsumers.cpp */, + 1A2A54A60FD1DD1C00F4CE45 /* Backend.cpp */, + 1A2A54A70FD1DD1C00F4CE45 /* CacheTokens.cpp */, + 1A2A54A80FD1DD1C00F4CE45 /* DependencyFile.cpp */, + 1A2A54A90FD1DD1C00F4CE45 /* DiagChecker.cpp */, + 1A2A54AA0FD1DD1C00F4CE45 /* DocumentXML.cpp */, + DEF1683F0F9548DC0098507F /* FixItRewriter.cpp */, + 1A2A54AB0FD1DD1C00F4CE45 /* GeneratePCH.cpp */, + 352246E10F5C6BE000D0D279 /* HTMLDiagnostics.cpp */, + 1A2A54AC0FD1DD1C00F4CE45 /* HTMLPrint.cpp */, + 352246E20F5C6BE000D0D279 /* InitHeaderSearch.cpp */, + DECB6F060F9D93A800F5FBC7 /* InitPreprocessor.cpp */, + 352246E30F5C6BE000D0D279 /* ManagerRegistry.cpp */, + DEF165740F8FB3510098507F /* PCHReader.cpp */, + DECB77780FA579B000F5FBC7 /* PCHReaderDecl.cpp */, + DECB77120FA5752300F5FBC7 /* PCHReaderStmt.cpp */, + DEF165700F8FB34D0098507F /* PCHWriter.cpp */, + DECB77F60FA5850200F5FBC7 /* PCHWriterDecl.cpp */, + DECB78160FA5882F00F5FBC7 /* PCHWriterStmt.cpp */, + 352246E40F5C6BE000D0D279 /* PlistDiagnostics.cpp */, + 1A2A54AD0FD1DD1C00F4CE45 /* PrintParserCallbacks.cpp */, + 1A2A54AE0FD1DD1C00F4CE45 /* PrintPreprocessedOutput.cpp */, + 352246E50F5C6BE000D0D279 /* TextDiagnosticBuffer.cpp */, + 352246E60F5C6BE000D0D279 /* TextDiagnosticPrinter.cpp */, + 1A2A54AF0FD1DD1C00F4CE45 /* RewriteBlocks.cpp */, + 1A2A54B00FD1DD1C00F4CE45 /* RewriteMacros.cpp */, + 1A2A54B10FD1DD1C00F4CE45 /* RewriteObjC.cpp */, + 1A2A54B20FD1DD1C00F4CE45 /* RewriteTest.cpp */, + 1A2A54B30FD1DD1C00F4CE45 /* StmtXML.cpp */, + 1A2A54B40FD1DD1C00F4CE45 /* Warnings.cpp */, + ); + name = Frontend; + sourceTree = ""; + }; + 352C19DB0CA321AC0045DB98 /* Visitors */ = { + isa = PBXGroup; + children = ( + 352C19DC0CA321C80045DB98 /* CFGRecStmtDeclVisitor.h */, + 352C19DD0CA321C80045DB98 /* CFGRecStmtVisitor.h */, + 352C19DE0CA321C80045DB98 /* CFGStmtVisitor.h */, + 352C19DF0CA321C80045DB98 /* CFGVarDeclVisitor.h */, + ); + name = Visitors; + sourceTree = ""; + }; + 35544B820F5C7F6600D92AA9 /* StoreManagers */ = { + isa = PBXGroup; + children = ( + 35A057E00EAE2D950069249F /* RegionStore.cpp */, + 3558F76C0E267C8300A5B0DF /* BasicStore.cpp */, + ); + name = StoreManagers; + sourceTree = ""; + }; + 35544B830F5C7F8900D92AA9 /* ConstraintManagers */ = { + isa = PBXGroup; + children = ( + 35544B870F5C7FD700D92AA9 /* SimpleConstraintManager.h */, + 35544B860F5C7FD700D92AA9 /* SimpleConstraintManager.cpp */, + 358CFBB70E65AB04002A8E19 /* BasicConstraintManager.cpp */, + 35544B850F5C7FD700D92AA9 /* RangeConstraintManager.cpp */, + ); + name = ConstraintManagers; + sourceTree = ""; + }; + 35544B840F5C7F9D00D92AA9 /* Path-Sensitive */ = { + isa = PBXGroup; + children = ( + 3507E4C60E27FE5500FB7B57 /* Core */, + 35544B820F5C7F6600D92AA9 /* StoreManagers */, + 35862B130E3629BC0009F542 /* Transfer Function Analyses */, + 35544B830F5C7F8900D92AA9 /* ConstraintManagers */, + ); + name = "Path-Sensitive"; + sourceTree = ""; + }; + 356EF9AF0C8F7DA4006650F5 /* Analysis */ = { + isa = PBXGroup; + children = ( + DEF1692C0F9645BF0098507F /* AnalysisDiagnostic.h */, + 35A8FCF60D9B4ADD001C2F97 /* ProgramPoint.h */, + 35A8FCF70D9B4ADD001C2F97 /* PathDiagnostic.h */, + 355CF6820C90A8B600A08AA3 /* LocalCheckers.h */, + 35F9B1540D1C6AFC00DDFDAE /* Analyses */, + 35D1DDCF0CA9C6BE0096E967 /* FlowSensitive */, + DE4121130D7F1B980080F80A /* PathSensitive */, + 35F9B1520D1C6ACB00DDFDAE /* Support */, + 352C19DB0CA321AC0045DB98 /* Visitors */, + ); + name = Analysis; + sourceTree = ""; + }; + 356EF9B30C8F7DCA006650F5 /* Analysis */ = { + isa = PBXGroup; + children = ( + 35544B840F5C7F9D00D92AA9 /* Path-Sensitive */, + 3507E4CC0E27FEB900FB7B57 /* Flow-Sensitive Analyses */, + 3507E4C30E27FE3800FB7B57 /* Checks */, + 3507E4C90E27FE9000FB7B57 /* Bug Reporting */, + ); + name = Analysis; + sourceTree = ""; + }; + 35862B130E3629BC0009F542 /* Transfer Function Analyses */ = { + isa = PBXGroup; + children = ( + 35D55B250D81D8C60092E734 /* CFRefCount.cpp */, + DE41212F0D7F1C1C0080F80A /* GRSimpleVals.cpp */, + DE41212C0D7F1C1C0080F80A /* GRSimpleVals.h */, + ); + name = "Transfer Function Analyses"; + sourceTree = ""; + }; + 35D1DDCF0CA9C6BE0096E967 /* FlowSensitive */ = { + isa = PBXGroup; + children = ( + 35D1DDD10CA9C6D50096E967 /* DataflowSolver.h */, + 35D1DDD20CA9C6D50096E967 /* DataflowValues.h */, + ); + name = FlowSensitive; + sourceTree = ""; + }; + 35F9B1520D1C6ACB00DDFDAE /* Support */ = { + isa = PBXGroup; + children = ( + 3537AA0C0ECD088F008F7CDC /* BlkExprDeclBitVector.h */, + ); + name = Support; + sourceTree = ""; + }; + 35F9B1540D1C6AFC00DDFDAE /* Analyses */ = { + isa = PBXGroup; + children = ( + 35F9B1550D1C6B2E00DDFDAE /* LiveVariables.h */, + 35F9B1560D1C6B2E00DDFDAE /* UninitializedValues.h */, + ); + name = Analyses; + sourceTree = ""; + }; + C6859E8C029090F304C91782 /* Documentation */ = { + isa = PBXGroup; + children = ( + DEAEED4A0A5AF89A0045101B /* NOTES.txt */, + DED7D7D70A524302003AD0FB /* README.txt */, + DEEBBD430C19C5D200A9FE82 /* TODO.txt */, + DEF2E95E0C5FBD74000C4259 /* InternalsManual.html */, + ); + name = Documentation; + sourceTree = ""; + }; + DE1F21F20A7D84E800FBF588 /* Parse */ = { + isa = PBXGroup; + children = ( + 3551068E0E9A855F006A4E44 /* AccessSpecifier.h */, + 84D9A88B0C1A581300AC7ABC /* AttributeList.h */, + DE06E8130A8FF9330050E87E /* Action.h */, + DE17336F0B068DC60080B521 /* DeclSpec.h */, + DE3B92230EB5152000D01046 /* Designator.h */, + DE1263C20EF2341900F56D2B /* Ownership.h */, + DEA09A860F3175CA000C2258 /* ParseDiagnostic.h */, + DE1F22020A7D852A00FBF588 /* Parser.h */, + DE06BECA0A854E4B0050E87E /* Scope.h */, + ); + name = Parse; + sourceTree = ""; + }; + DE1F22600A7D8C9B00FBF588 /* Parse */ = { + isa = PBXGroup; + children = ( + 84D9A8870C1A57E100AC7ABC /* AttributeList.cpp */, + DE17336D0B068DC20080B521 /* DeclSpec.cpp */, + DE3B90DE0EAC5EF200D01046 /* ExtensionRAIIObject.h */, + DE3461260AFE68BE00DBC861 /* MinimalAction.cpp */, + DE34600E0AFDCCCE00DBC861 /* ParseDecl.cpp */, + DE2255FB0C8004E600D370A5 /* ParseDeclCXX.cpp */, + DE3460120AFDCCDA00DBC861 /* ParseExpr.cpp */, + DE06756B0C051CFE00EBBFD8 /* ParseExprCXX.cpp */, + 3534A01C0E129849002709B2 /* ParseCXXInlineMethods.cpp */, + DE3460040AFDCC6500DBC861 /* ParseInit.cpp */, + DE345FFF0AFDCC1900DBC861 /* ParseObjc.cpp */, + 3551068F0E9A857C006A4E44 /* ParsePragma.h */, + 3551068A0E9A8546006A4E44 /* ParsePragma.cpp */, + DE34600A0AFDCCBF00DBC861 /* ParseStmt.cpp */, + 353959D40EE5F88A00E82461 /* ParseTemplate.cpp */, + 3551068B0E9A8546006A4E44 /* ParseTentative.cpp */, + DE06D42F0A8BB52D0050E87E /* Parser.cpp */, + ); + name = Parse; + sourceTree = ""; + }; + DE4121130D7F1B980080F80A /* PathSensitive */ = { + isa = PBXGroup; + children = ( + 35D55B290D81D8E50092E734 /* BasicValueFactory.h */, + 359378FF0DA486490043B19C /* BugReporter.h */, + 3536457C0E2406B0009C6509 /* Environment.h */, + DE4121200D7F1BBE0080F80A /* ExplodedGraph.h */, + 35F1ACE60E66166C001F4532 /* ConstraintManager.h */, + 35F8D0CB0D9B7E8200D91C5E /* GRAuditor.h */, + DE41211F0D7F1BBE0080F80A /* GRBlockCounter.h */, + DE4121230D7F1BBE0080F80A /* GRCoreEngine.h */, + DE4121210D7F1BBE0080F80A /* GRExprEngine.h */, + 358F514F0E529A87007F2102 /* GRState.h */, + 3553EB9A0E5F7089007D7359 /* GRStateTrait.h */, + 35F8D0CA0D9B7E8200D91C5E /* GRSimpleAPICheck.h */, + DE4121220D7F1BBE0080F80A /* GRTransferFuncs.h */, + DE41211D0D7F1BBE0080F80A /* GRWorkList.h */, + 355106880E9A851B006A4E44 /* MemRegion.h */, + 3558F76F0E267C9A00A5B0DF /* Store.h */, + 35A057D20EAE2D2B0069249F /* SVals.h */, + DE41211E0D7F1BBE0080F80A /* SymbolManager.h */, + ); + name = PathSensitive; + sourceTree = ""; + }; + DE67E7070C020EAB00F66BC5 /* Sema */ = { + isa = PBXGroup; + children = ( + 35585DBD0EAFBC4500D0A97A /* CXXFieldCollector.h */, + 3527124F0DAFE54700C76352 /* IdentifierResolver.h */, + 352712500DAFE54700C76352 /* IdentifierResolver.cpp */, + DECB6D640F9AE26600F5FBC7 /* JumpDiagnostics.cpp */, + DE67E7190C020F4F00F66BC5 /* ParseAST.cpp */, + DE67E7140C020EDF00F66BC5 /* Sema.h */, + DE67E7160C020EE400F66BC5 /* Sema.cpp */, + 1A701B630F7C8FE400FEC4D1 /* SemaAccess.cpp */, + DEB07AC70F4A427E00F5A2BE /* SemaAttr.cpp */, + DEF2F00F0C6CFED5000C4259 /* SemaChecking.cpp */, + 35E194670ECB82FB00F21733 /* SemaCXXScopeSpec.cpp */, + DE67E7120C020ED900F66BC5 /* SemaDecl.cpp */, + DE22BCF10E14197E0094DC60 /* SemaDeclAttr.cpp */, + 35EF676F0DAD1D2C00B19414 /* SemaDeclCXX.cpp */, + DE704B250D0FBEBE009C7762 /* SemaDeclObjC.cpp */, + DE67E7100C020ED400F66BC5 /* SemaExpr.cpp */, + DE67E70E0C020ECF00F66BC5 /* SemaExprCXX.cpp */, + DE47999B0D2EBE1A00706D2D /* SemaExprObjC.cpp */, + 3557D1EF0EB13BB700C59739 /* SemaInherit.cpp */, + DE3B921C0EB1A81400D01046 /* SemaInherit.h */, + 3599299A0DE2425300A8A33E /* SemaInit.cpp */, + 357EA27C0F2526F300439B60 /* SemaLookup.cpp */, + 35E194680ECB82FB00F21733 /* SemaNamedCast.cpp */, + 35585DBE0EAFBC4500D0A97A /* SemaOverload.cpp */, + 35585DBF0EAFBC4500D0A97A /* SemaOverload.h */, + DE67E70C0C020ECA00F66BC5 /* SemaStmt.cpp */, + 3591853E0EFB1088000039AF /* SemaTemplate.cpp */, + 35544B8B0F5C803200D92AA9 /* SemaTemplateInstantiate.cpp */, + 1ADF47AE0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp */, + 1A410F840FBCE51100351440 /* SemaTemplateInstantiateExpr.cpp */, + 1A5119C30FBDF71000A1FF22 /* SemaTemplateInstantiateStmt.cpp */, + DE67E70A0C020EC500F66BC5 /* SemaType.cpp */, + ); + name = Sema; + sourceTree = ""; + }; + DE67E7260C02108300F66BC5 /* Sema */ = { + isa = PBXGroup; + children = ( + 9063F2210F9E8BDF002F7251 /* ExternalSemaSource.h */, + 9063F2220F9E8BDF002F7251 /* SemaConsumer.h */, + DE67E7270C02109800F66BC5 /* ParseAST.h */, + DEA09A890F3175D9000C2258 /* SemaDiagnostic.h */, + ); + name = Sema; + sourceTree = ""; + }; + DE927FCC0C0557CD00231DA4 /* CodeGen */ = { + isa = PBXGroup; + children = ( + 1A2193CB0F45EEB700C0713D /* ABIInfo.h */, + 1A471AB40F437BC500753CE8 /* CGBlocks.cpp */, + 1A649E1D0F9599D9005B965E /* CGBlocks.h */, + DE8822350EC80C0A00CBC30A /* CGBuilder.h */, + 1ABC36930C7A4BDC006DB0AB /* CGBuiltin.cpp */, + 35475B1F0E79973F0000BFE4 /* CGCall.cpp */, + 35475B220E7997680000BFE4 /* CGCall.h */, + 1A5D5E570E5E81010023C059 /* CGCXX.cpp */, + 1A649E1E0F9599DA005B965E /* CGCXX.h */, + 35A3E7000DD3874400757F74 /* CGDebugInfo.cpp */, + 35A3E7010DD3874400757F74 /* CGDebugInfo.h */, + DE4264FB0C113592005A861D /* CGDecl.cpp */, + DE4772FB0C10EAEC002239E8 /* CGExpr.cpp */, + DEF2EFF20C6CDD74000C4259 /* CGExprAgg.cpp */, + DE224FF70C7AA98800D370A5 /* CGExprComplex.cpp */, + 1A376A2C0D4AED9B002A1C52 /* CGExprConstant.cpp */, + DE22526F0C7E82D000D370A5 /* CGExprScalar.cpp */, + 1A7342470C7B57D500122F56 /* CGObjC.cpp */, + DE38CD4E0D794CF900A273B6 /* CGObjCRuntime.h */, + DE38CD4F0D794D0100A273B6 /* CGObjCGNU.cpp */, + 3552E7580E520DD7003A8CA5 /* CGObjCMac.cpp */, + DE4772F90C10EAE5002239E8 /* CGStmt.cpp */, + 35475B230E7997680000BFE4 /* CGValue.h */, + DE928B800C0A615B00231DA4 /* CodeGenFunction.h */, + DE928B820C0A616000231DA4 /* CodeGenFunction.cpp */, + DE928B7C0C0A615100231DA4 /* CodeGenModule.h */, + DE928B7E0C0A615600231DA4 /* CodeGenModule.cpp */, + DEEBC3BB0C2363BC00A9FE82 /* CodeGenTypes.cpp */, + DEEBC3B90C2363B800A9FE82 /* CodeGenTypes.h */, + 1A2193CC0F45EEB700C0713D /* Mangle.cpp */, + 1A2193CD0F45EEB700C0713D /* Mangle.h */, + DE928B120C05659200231DA4 /* ModuleBuilder.cpp */, + ); + name = CodeGen; + sourceTree = ""; + }; + DE928B140C05659A00231DA4 /* CodeGen */ = { + isa = PBXGroup; + children = ( + DE928B1F0C0565B000231DA4 /* ModuleBuilder.h */, + ); + name = CodeGen; + sourceTree = ""; + }; + DEC8D98B0A9433BC00353FCA /* AST */ = { + isa = PBXGroup; + children = ( + DECB78540FA58F5500F5FBC7 /* AccessSpecifier.h */, + DE613EF30E0E148D00B05B79 /* APValue.h */, + DEC8D9A30A94346E00353FCA /* AST.h */, + 35BFBD2B0C9EDE1E006CB644 /* ASTConsumer.h */, + DE75ED280B044DC90020CF81 /* ASTContext.h */, + DEA09A6E0F31756F000C2258 /* ASTDiagnostic.h */, + 1A72BEAC0D641E9400B085E9 /* Attr.h */, + DED676D00B6C786700AAD4A3 /* Builtins.def */, + DED676F90B6C797B00AAD4A3 /* Builtins.h */, + 90FB99DE0F98FB1D008F9415 /* DeclContextInternals.h */, + 90FB99DF0F98FB1D008F9415 /* DeclVisitor.h */, + 90FB99E00F98FB1D008F9415 /* ExternalASTSource.h */, + 1A68BC110D0CADDD001A28C8 /* PPCBuiltins.def */, + 1A68BC130D0CADDD001A28C8 /* X86Builtins.def */, + DEC63B1B0C7B940600DBF169 /* CFG.h */, + DEC8D9900A9433CD00353FCA /* Decl.h */, + 3538FDB60ED24A2C005EC283 /* DeclarationName.h */, + 035611470DA6A45C00D2EF2A /* DeclBase.h */, + 84AF36A00CB17A3B00C820A5 /* DeclObjC.h */, + 35EE48AD0E0C4CB200715C54 /* DeclCXX.h */, + 358D23090E8BEB850003DDCC /* DeclGroup.h */, + DEDFE5270F63A9230035BD10 /* DeclNodes.def */, + DEB076C90F3A221200F5A2BE /* DeclTemplate.h */, + DE0FCA620A95859D00248FD5 /* Expr.h */, + 1A30A9E80B93A4C800201A91 /* ExprCXX.h */, + 35CEA05A0DF9E82700A41296 /* ExprObjC.h */, + DEDFE5CB0F7206CC0035BD10 /* NestedNameSpecifier.h */, + 35EE48AE0E0C4CB200715C54 /* ParentMap.h */, + 3547129D0C88881300B3E1D5 /* PrettyPrinter.h */, + DE6951C60C4D1F5D00A5826B /* RecordLayout.h */, + DE3452800AEF1B1800DBC861 /* Stmt.h */, + DECB73550FA3EE5A00F5FBC7 /* StmtCXX.h */, + DE345F210AFD347900DBC861 /* StmtNodes.def */, + DECB734E0FA3ED8400F5FBC7 /* StmtObjC.h */, + DE345C190AFC658B00DBC861 /* StmtVisitor.h */, + 35847BE30CC7DB9000C40FFF /* StmtIterator.h */, + 35CFFE010CA1CBDD00E6F2BE /* StmtGraphTraits.h */, + 1A68BC120D0CADDD001A28C8 /* TargetBuiltins.h */, + DEDFF87F0F848CE30035BD10 /* TemplateName.h */, + DEF16BE40FA13A5B0098507F /* TypeNodes.def */, + DEF16BE50FA13A650098507F /* TypeOrdering.h */, + DE3464210B03040900DBC861 /* Type.h */, + ); + name = AST; + sourceTree = ""; + }; + DEC8D9920A9433F400353FCA /* AST */ = { + isa = PBXGroup; + children = ( + DE8823CA0ED0046600CBC30A /* APValue.cpp */, + 35BB2D7E0D19954000944DB5 /* ASTConsumer.cpp */, + DE1732FF0B068B700080B521 /* ASTContext.cpp */, + DED677C80B6C854100AAD4A3 /* Builtins.cpp */, + DEC63B190C7B940200DBF169 /* CFG.cpp */, + 35FE6BCE0DF6EE1F00739712 /* DeclBase.cpp */, + DED62ABA0AE2EDF1001E80A4 /* Decl.cpp */, + 3538FDB70ED24A4E005EC283 /* DeclarationName.cpp */, + 35EE48AF0E0C4CCA00715C54 /* DeclCXX.cpp */, + 358D230A0E8BEB9D0003DDCC /* DeclGroup.cpp */, + DE38CF260D8C9E6C00A273B6 /* DeclObjC.cpp */, + DEB076CE0F3A222200F5A2BE /* DeclTemplate.cpp */, + DE0FCB330A9C21F100248FD5 /* Expr.cpp */, + 1A32C17E0E1C87AD00A6B483 /* ExprConstant.cpp */, + 35260CA40C7F75C000D66CE9 /* ExprCXX.cpp */, + 3557D1A80EB136B100C59739 /* InheritViz.cpp */, + DEDFE5CE0F7206E40035BD10 /* NestedNameSpecifier.cpp */, + 35EE48B00E0C4CCA00715C54 /* ParentMap.cpp */, + DE3452400AEF1A2D00DBC861 /* Stmt.cpp */, + DEF2EDA60C6A4252000C4259 /* StmtDumper.cpp */, + DE34621C0AFEB19B00DBC861 /* StmtPrinter.cpp */, + 35847BE40CC7DBAF00C40FFF /* StmtIterator.cpp */, + 35CFFDFF0CA1CBCB00E6F2BE /* StmtViz.cpp */, + DEDFF8870F848CF80035BD10 /* TemplateName.cpp */, + DE75EDF00B06880E0020CF81 /* Type.cpp */, + ); + name = AST; + sourceTree = ""; + }; + DED7D72E0A524295003AD0FB /* include */ = { + isa = PBXGroup; + children = ( + DED7D7300A524295003AD0FB /* Basic */, + DED7D7390A524295003AD0FB /* Lex */, + DE1F21F20A7D84E800FBF588 /* Parse */, + DEC8D98B0A9433BC00353FCA /* AST */, + DE67E7260C02108300F66BC5 /* Sema */, + DE928B140C05659A00231DA4 /* CodeGen */, + 356EF9AF0C8F7DA4006650F5 /* Analysis */, + DEF7D9F40C9C8B020001F598 /* Rewrite */, + DEF1615D0F65C7FC0098507F /* Frontend */, + DEF165020F8D46810098507F /* Driver */, + ); + path = include; + sourceTree = ""; + }; + DED7D7300A524295003AD0FB /* Basic */ = { + isa = PBXGroup; + children = ( + 906BF4AE0F83BA16001071FA /* ConvertUTF.h */, + DED7D7310A524295003AD0FB /* Diagnostic.h */, + DEDFFF070F959EE60035BD10 /* Diagnostic.td */, + 1A7019E90F79BC1100FEC4D1 /* DiagnosticAnalysisKinds.td */, + 1A7019EA0F79BC1100FEC4D1 /* DiagnosticASTKinds.td */, + 1A7019EB0F79BC1100FEC4D1 /* DiagnosticCommonKinds.td */, + 1A7019EC0F79BC1100FEC4D1 /* DiagnosticDriverKinds.td */, + 1A7019ED0F79BC1100FEC4D1 /* DiagnosticFrontendKinds.td */, + DEDFFF530F9704580035BD10 /* DiagnosticGroups.td */, + 1A7019EE0F79BC1100FEC4D1 /* DiagnosticLexKinds.td */, + 1A7019EF0F79BC1100FEC4D1 /* DiagnosticParseKinds.td */, + 1A701A250F79CE1C00FEC4D1 /* DiagnosticSemaKinds.td */, + DED7D7330A524295003AD0FB /* FileManager.h */, + DE3986EF0CB8D4B300223765 /* IdentifierTable.h */, + DE06B73D0A8307640050E87E /* LangOptions.h */, + 9063F2280F9E911F002F7251 /* OnDiskHashTable.h */, + DE8824560ED1244600CBC30A /* OperatorKinds.def */, + DE8824530ED1243E00CBC30A /* OperatorKinds.h */, + DEAABDF70F5F477C0098928A /* PrettyStackTrace.h */, + DED7D7350A524295003AD0FB /* SourceLocation.h */, + DED7D7360A524295003AD0FB /* SourceManager.h */, + 9063F2290F9E911F002F7251 /* SourceManagerInternals.h */, + DE46BF270AE0A82D00CC047C /* TargetInfo.h */, + 9063F22A0F9E911F002F7251 /* TemplateKinds.h */, + DED7D7380A524295003AD0FB /* TokenKinds.h */, + DED7D7370A524295003AD0FB /* TokenKinds.def */, + DEB089EE0F12F1D900522C07 /* TypeTraits.h */, + ); + name = Basic; + path = clang/Basic; + sourceTree = ""; + }; + DED7D7390A524295003AD0FB /* Lex */ = { + isa = PBXGroup; + children = ( + DE3450D60AEB543100DBC861 /* DirectoryLookup.h */, + DE704BD10D1647E7009C7762 /* HeaderMap.h */, + DE344AB70AE5DF6D00DBC861 /* HeaderSearch.h */, + DEA09A830F3175BF000C2258 /* LexDiagnostic.h */, + DED7D73B0A524295003AD0FB /* Lexer.h */, + 1A869A6E0BA2164C008DA07A /* LiteralSupport.h */, + DED7D73E0A524295003AD0FB /* MacroInfo.h */, + DEAEE98A0A5A2B970045101B /* MultipleIncludeOpt.h */, + DE01DA480B12ADA300AC22CE /* PPCallbacks.h */, + DE8823DE0ED0B78600CBC30A /* PTHLexer.h */, + 3598EBEB0EDE23EF0070CA16 /* PTHManager.h */, + DED7D73F0A524295003AD0FB /* Pragma.h */, + DED7D7400A524295003AD0FB /* Preprocessor.h */, + 35B820740ECB811A0020BEC0 /* PreprocessorLexer.h */, + DED7D9170A52518C003AD0FB /* ScratchBuffer.h */, + DE6954630C5121BD00A5826B /* Token.h */, + DEB077930F44F96000F5A2BE /* TokenConcatenation.h */, + DE85CD840D8380F20070E26E /* TokenLexer.h */, + ); + name = Lex; + path = clang/Lex; + sourceTree = ""; + }; + DED7D7500A5242C7003AD0FB /* Basic */ = { + isa = PBXGroup; + children = ( + 906BF4AF0F83BA2E001071FA /* ConvertUTF.c */, + DED7D75D0A5242C7003AD0FB /* Diagnostic.cpp */, + DED7D75E0A5242C7003AD0FB /* FileManager.cpp */, + DE3986F30CB8D50C00223765 /* IdentifierTable.cpp */, + 35707EFD0CD0F5CC000B2204 /* SourceLocation.cpp */, + DED7D76D0A5242C7003AD0FB /* SourceManager.cpp */, + DED626C80AE0C065001E80A4 /* TargetInfo.cpp */, + 03F50AC50D416EAA00B9CF60 /* Targets.cpp */, + DED7D76E0A5242C7003AD0FB /* TokenKinds.cpp */, + ); + name = Basic; + path = lib/Basic; + sourceTree = ""; + }; + DED7D78C0A5242E6003AD0FB /* Lex */ = { + isa = PBXGroup; + children = ( + DE704DD10D1668A4009C7762 /* HeaderMap.cpp */, + DE344B530AE5E46C00DBC861 /* HeaderSearch.cpp */, + DED7D79E0A5242E6003AD0FB /* Lexer.cpp */, + 1A869AA70BA21ABA008DA07A /* LiteralSupport.cpp */, + DE85CD9E0D8382DD0070E26E /* MacroArgs.h */, + DE85CDA20D8383B20070E26E /* MacroArgs.cpp */, + DED7D7A00A5242E6003AD0FB /* MacroInfo.cpp */, + 3552E7540E520D80003A8CA5 /* PPCaching.cpp */, + DE85CDAF0D838C390070E26E /* PPDirectives.cpp */, + DED7D7A20A5242E6003AD0FB /* PPExpressions.cpp */, + DE85CDB50D839BAE0070E26E /* PPLexerChange.cpp */, + DE85CDAB0D838C120070E26E /* PPMacroExpansion.cpp */, + DED7D7A30A5242E6003AD0FB /* Pragma.cpp */, + DED7D7A40A5242E6003AD0FB /* Preprocessor.cpp */, + 3537AA0D0ECD08A4008F7CDC /* PreprocessorLexer.cpp */, + 35E1946C0ECB83C100F21733 /* PTHLexer.cpp */, + DED7D9E40A5257F6003AD0FB /* ScratchBuffer.cpp */, + DEB077980F44F97800F5A2BE /* TokenConcatenation.cpp */, + DE85CD800D8380B10070E26E /* TokenLexer.cpp */, + ); + name = Lex; + path = lib/Lex; + sourceTree = ""; + }; + DEDFE61F0F7B3AE10035BD10 /* Tools */ = { + isa = PBXGroup; + children = ( + DEDFE6200F7B3AE90035BD10 /* clang-cc */, + DEDFE6210F7B3AF10035BD10 /* clang */, + ); + name = Tools; + sourceTree = ""; + }; + DEDFE6200F7B3AE90035BD10 /* clang-cc */ = { + isa = PBXGroup; + children = ( + 1AFEF4050F8A6B2300476F2B /* clang-cc.cpp */, + ); + name = "clang-cc"; + sourceTree = ""; + }; + DEDFE6210F7B3AF10035BD10 /* clang */ = { + isa = PBXGroup; + children = ( + DEDFE6450F7B3B4E0035BD10 /* driver.cpp */, + ); + name = clang; + sourceTree = ""; + }; + DEDFE6470F7B3B560035BD10 /* Driver */ = { + isa = PBXGroup; + children = ( + DEDFE6480F7B3B830035BD10 /* Types.cpp */, + DEDFE6490F7B3B830035BD10 /* Tools.h */, + DEDFE64A0F7B3B830035BD10 /* Tools.cpp */, + DEDFE64B0F7B3B830035BD10 /* ToolChains.h */, + DEDFE64C0F7B3B830035BD10 /* Compilation.cpp */, + DEDFE64D0F7B3B830035BD10 /* ArgList.cpp */, + DEDFE64E0F7B3B830035BD10 /* Arg.cpp */, + DEDFE64F0F7B3B830035BD10 /* Action.cpp */, + DEDFE6500F7B3B830035BD10 /* Phases.cpp */, + DEDFE6510F7B3B830035BD10 /* OptTable.cpp */, + DEDFE6520F7B3B830035BD10 /* Option.cpp */, + DEDFE6530F7B3B830035BD10 /* Job.cpp */, + DEDFE6540F7B3B830035BD10 /* InputInfo.h */, + DEDFE6550F7B3B830035BD10 /* ToolChains.cpp */, + DEDFE6560F7B3B830035BD10 /* ToolChain.cpp */, + DEDFE6570F7B3B830035BD10 /* Tool.cpp */, + DEDFE6580F7B3B830035BD10 /* HostInfo.cpp */, + DEDFE6590F7B3B830035BD10 /* Driver.cpp */, + ); + name = Driver; + sourceTree = ""; + }; + DEF1615D0F65C7FC0098507F /* Frontend */ = { + isa = PBXGroup; + children = ( + DEF161620F65C81C0098507F /* CompileOptions.h */, + DEF168620F9549250098507F /* FixItRewriter.h */, + DEF169220F9645960098507F /* FrontendDiagnostic.h */, + DEF1615E0F65C81C0098507F /* InitHeaderSearch.h */, + DECB6F030F9D939A00F5FBC7 /* InitPreprocessor.h */, + DEF1615F0F65C81C0098507F /* ManagerRegistry.h */, + DEF1657E0F8FB3730098507F /* PCHBitCodes.h */, + DEF1657B0F8FB36E0098507F /* PCHReader.h */, + DEF165780F8FB3690098507F /* PCHWriter.h */, + DEF161610F65C81C0098507F /* PathDiagnosticClients.h */, + DEF161600F65C81C0098507F /* TextDiagnosticBuffer.h */, + DEF161630F65C81C0098507F /* TextDiagnosticPrinter.h */, + ); + name = Frontend; + sourceTree = ""; + }; + DEF165020F8D46810098507F /* Driver */ = { + isa = PBXGroup; + children = ( + DEF165160F8D46980098507F /* Action.h */, + DEF1651D0F8D46980098507F /* ArgList.h */, + DEF1651E0F8D46980098507F /* Arg.h */, + DEF165170F8D46980098507F /* Compilation.h */, + DEF165240F8D46980098507F /* DriverDiagnostic.h */, + DEF165200F8D46980098507F /* Driver.h */, + DEF1651F0F8D46980098507F /* HostInfo.h */, + DEF165210F8D46980098507F /* Job.h */, + DEF165180F8D46980098507F /* Options.def */, + DEF165190F8D46980098507F /* Option.h */, + DEF1651C0F8D46980098507F /* Options.h */, + DEF165230F8D46980098507F /* Phases.h */, + DEF165140F8D46980098507F /* Tool.h */, + DEF165150F8D46980098507F /* Types.h */, + DEF1651A0F8D46980098507F /* Types.def */, + DEF1651B0F8D46980098507F /* ToolChain.h */, + DEF165220F8D46980098507F /* Util.h */, + ); + name = Driver; + sourceTree = ""; + }; + DEF7D9F40C9C8B020001F598 /* Rewrite */ = { + isa = PBXGroup; + children = ( + DEFFECA30DB093D100B4E7C3 /* DeltaTree.h */, + 35F2BE7B0DAC2963006E7668 /* HTMLRewrite.h */, + DEF7D9F60C9C8B1A0001F598 /* Rewriter.h */, + DE53370B0CE2D96F00D9A028 /* RewriteRope.h */, + DE4DC7980EA1BE4400069E5A /* TokenRewriter.h */, + ); + name = Rewrite; + sourceTree = ""; + }; + DEF7D9F50C9C8B0C0001F598 /* Rewrite */ = { + isa = PBXGroup; + children = ( + DEFFECA60DB1546600B4E7C3 /* DeltaTree.cpp */, + 72D16C1E0D9975C400E6DA4A /* HTMLRewrite.cpp */, + DEF7D9F80C9C8B1D0001F598 /* Rewriter.cpp */, + DECAB0CF0DB3C84200E13CCB /* RewriteRope.cpp */, + DE4DC7A20EA1C33E00069E5A /* TokenRewriter.cpp */, + ); + name = Rewrite; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8DD76F620486A84900D96B5E /* clang */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "clang" */; + buildPhases = ( + 8DD76F640486A84900D96B5E /* Sources */, + 8DD76F660486A84900D96B5E /* Frameworks */, + 8DD76F690486A84900D96B5E /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = clang; + productInstallPath = "$(HOME)/bin"; + productName = clang; + productReference = 8DD76F6C0486A84900D96B5E /* clang */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 08FB7793FE84155DC02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */; + compatibilityVersion = "Xcode 2.4"; + hasScannedForEncodings = 1; + mainGroup = 08FB7794FE84155DC02AAC07 /* clang */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8DD76F620486A84900D96B5E /* clang */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 8DD76F640486A84900D96B5E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DED7D77A0A5242C7003AD0FB /* Diagnostic.cpp in Sources */, + DED7D77B0A5242C7003AD0FB /* FileManager.cpp in Sources */, + DED7D7890A5242C7003AD0FB /* SourceManager.cpp in Sources */, + DED7D78A0A5242C7003AD0FB /* TokenKinds.cpp in Sources */, + DED7D7C30A5242E6003AD0FB /* Lexer.cpp in Sources */, + DED7D7C50A5242E6003AD0FB /* MacroInfo.cpp in Sources */, + DED7D7C70A5242E6003AD0FB /* PPExpressions.cpp in Sources */, + DED7D7C80A5242E6003AD0FB /* Pragma.cpp in Sources */, + DED7D7C90A5242E6003AD0FB /* Preprocessor.cpp in Sources */, + DED7D9E50A5257F6003AD0FB /* ScratchBuffer.cpp in Sources */, + DE06D4310A8BB52D0050E87E /* Parser.cpp in Sources */, + DE0FCB340A9C21F100248FD5 /* Expr.cpp in Sources */, + DED626C90AE0C065001E80A4 /* TargetInfo.cpp in Sources */, + DED62ABB0AE2EDF1001E80A4 /* Decl.cpp in Sources */, + DE344B540AE5E46C00DBC861 /* HeaderSearch.cpp in Sources */, + DE3452410AEF1A2D00DBC861 /* Stmt.cpp in Sources */, + DE3460000AFDCC1900DBC861 /* ParseObjc.cpp in Sources */, + DE3460050AFDCC6500DBC861 /* ParseInit.cpp in Sources */, + DE34600B0AFDCCBF00DBC861 /* ParseStmt.cpp in Sources */, + DE34600F0AFDCCCE00DBC861 /* ParseDecl.cpp in Sources */, + DE3460130AFDCCDA00DBC861 /* ParseExpr.cpp in Sources */, + DE3461270AFE68BE00DBC861 /* MinimalAction.cpp in Sources */, + DE34621D0AFEB19B00DBC861 /* StmtPrinter.cpp in Sources */, + DE75EDF10B06880E0020CF81 /* Type.cpp in Sources */, + DE1733000B068B700080B521 /* ASTContext.cpp in Sources */, + DE17336E0B068DC20080B521 /* DeclSpec.cpp in Sources */, + DED677C90B6C854100AAD4A3 /* Builtins.cpp in Sources */, + 1A869AA80BA21ABA008DA07A /* LiteralSupport.cpp in Sources */, + DE67E70B0C020EC500F66BC5 /* SemaType.cpp in Sources */, + DE67E70D0C020ECA00F66BC5 /* SemaStmt.cpp in Sources */, + DE67E70F0C020ECF00F66BC5 /* SemaExprCXX.cpp in Sources */, + DE67E7110C020ED400F66BC5 /* SemaExpr.cpp in Sources */, + DE67E7130C020ED900F66BC5 /* SemaDecl.cpp in Sources */, + DE67E7170C020EE400F66BC5 /* Sema.cpp in Sources */, + DE67E71A0C020F4F00F66BC5 /* ParseAST.cpp in Sources */, + DE06756C0C051CFE00EBBFD8 /* ParseExprCXX.cpp in Sources */, + DE928B130C05659200231DA4 /* ModuleBuilder.cpp in Sources */, + DE928B7F0C0A615600231DA4 /* CodeGenModule.cpp in Sources */, + DE928B830C0A616000231DA4 /* CodeGenFunction.cpp in Sources */, + DE4772FA0C10EAE5002239E8 /* CGStmt.cpp in Sources */, + DE4772FC0C10EAEC002239E8 /* CGExpr.cpp in Sources */, + DE4264FC0C113592005A861D /* CGDecl.cpp in Sources */, + 84D9A8880C1A57E100AC7ABC /* AttributeList.cpp in Sources */, + DEEBC3BC0C2363BC00A9FE82 /* CodeGenTypes.cpp in Sources */, + DEF2EDA70C6A4252000C4259 /* StmtDumper.cpp in Sources */, + DEF2EFF30C6CDD74000C4259 /* CGExprAgg.cpp in Sources */, + DEF2F0100C6CFED5000C4259 /* SemaChecking.cpp in Sources */, + 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 */, + 356EF9B50C8F7DDF006650F5 /* LiveVariables.cpp in Sources */, + DEF7D9F90C9C8B1D0001F598 /* Rewriter.cpp in Sources */, + 35CFFE000CA1CBCB00E6F2BE /* StmtViz.cpp in Sources */, + DE3986F40CB8D50C00223765 /* IdentifierTable.cpp in Sources */, + 35847BE50CC7DBAF00C40FFF /* StmtIterator.cpp in Sources */, + 35707EFE0CD0F5CC000B2204 /* SourceLocation.cpp in Sources */, + DE704B260D0FBEBE009C7762 /* SemaDeclObjC.cpp in Sources */, + DE704DD20D1668A4009C7762 /* HeaderMap.cpp in Sources */, + 35BB2D7F0D19954000944DB5 /* ASTConsumer.cpp in Sources */, + DE47999C0D2EBE1A00706D2D /* SemaExprObjC.cpp in Sources */, + 03F50AC60D416EAA00B9CF60 /* Targets.cpp in Sources */, + 1A376A2D0D4AED9B002A1C52 /* CGExprConstant.cpp in Sources */, + DE38CD500D794D0100A273B6 /* CGObjCGNU.cpp in Sources */, + DE4121350D7F1C1C0080F80A /* SymbolManager.cpp in Sources */, + DE4121360D7F1C1C0080F80A /* ExplodedGraph.cpp in Sources */, + DE4121370D7F1C1C0080F80A /* UninitializedValues.cpp in Sources */, + DE4121380D7F1C1C0080F80A /* GRCoreEngine.cpp in Sources */, + DE41213C0D7F1C1C0080F80A /* GRSimpleVals.cpp in Sources */, + DE41213D0D7F1C1C0080F80A /* GRBlockCounter.cpp in Sources */, + DE41213E0D7F1C1C0080F80A /* GRExprEngine.cpp in Sources */, + 35D55B270D81D8C60092E734 /* BasicValueFactory.cpp in Sources */, + 35D55B280D81D8C60092E734 /* CFRefCount.cpp in Sources */, + DE85CD810D8380B10070E26E /* TokenLexer.cpp in Sources */, + DE85CDA30D8383B20070E26E /* MacroArgs.cpp in Sources */, + DE85CDAC0D838C120070E26E /* PPMacroExpansion.cpp in Sources */, + DE85CDB00D838C390070E26E /* PPDirectives.cpp in Sources */, + DE85CDB60D839BAE0070E26E /* PPLexerChange.cpp in Sources */, + DE38CF270D8C9E6C00A273B6 /* DeclObjC.cpp in Sources */, + 72D16C1F0D9975C400E6DA4A /* HTMLRewrite.cpp in Sources */, + 35A8FCF90D9B4B2A001C2F97 /* PathDiagnostic.cpp in Sources */, + 35F8D0D60D9B82CD00D91C5E /* BasicObjCFoundationChecks.cpp in Sources */, + 3593790A0DA48ABA0043B19C /* BugReporter.cpp in Sources */, + 35EF67700DAD1D2C00B19414 /* SemaDeclCXX.cpp in Sources */, + 352712510DAFE54700C76352 /* IdentifierResolver.cpp in Sources */, + DEFFECA70DB1546600B4E7C3 /* DeltaTree.cpp in Sources */, + DECAB0D00DB3C84200E13CCB /* RewriteRope.cpp in Sources */, + 35EFEFB60DB67ED60020783D /* GRTransferFuncs.cpp in Sources */, + 35A3E7020DD3874400757F74 /* CGDebugInfo.cpp in Sources */, + 3599299B0DE2425300A8A33E /* SemaInit.cpp in Sources */, + 35FE6BCF0DF6EE1F00739712 /* DeclBase.cpp in Sources */, + 35EE48B10E0C4CCA00715C54 /* DeclCXX.cpp in Sources */, + 35EE48B20E0C4CCA00715C54 /* ParentMap.cpp in Sources */, + 3534A01D0E129849002709B2 /* ParseCXXInlineMethods.cpp in Sources */, + DE22BCF20E14197E0094DC60 /* SemaDeclAttr.cpp in Sources */, + 1A32C17F0E1C87AD00A6B483 /* ExprConstant.cpp in Sources */, + 3595AFB80E1C8D62004CDF09 /* CheckObjCDealloc.cpp in Sources */, + 3536456B0E23EBF7009C6509 /* Environment.cpp in Sources */, + 3558F76D0E267C8300A5B0DF /* BasicStore.cpp in Sources */, + 3507E4C20E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp in Sources */, + 35862B0D0E3628CB0009F542 /* CheckDeadStores.cpp in Sources */, + 35862B120E3629850009F542 /* GRExprEngineInternalChecks.cpp in Sources */, + 35F2A01E0E36AFF100D17527 /* CheckObjCUnusedIVars.cpp in Sources */, + 3552E7550E520D80003A8CA5 /* PPCaching.cpp in Sources */, + 3552E7590E520DD7003A8CA5 /* CGObjCMac.cpp in Sources */, + 358F51520E529AA4007F2102 /* GRState.cpp in Sources */, + 1A5D5E580E5E81010023C059 /* CGCXX.cpp in Sources */, + 358CFBB80E65AB04002A8E19 /* BasicConstraintManager.cpp in Sources */, + 35475B200E79973F0000BFE4 /* CGCall.cpp in Sources */, + 35BAC1E80E82C5B7003FB76F /* CheckNSError.cpp in Sources */, + 358D230B0E8BEB9D0003DDCC /* DeclGroup.cpp in Sources */, + 355106860E9A8507006A4E44 /* MemRegion.cpp in Sources */, + 3551068C0E9A8546006A4E44 /* ParsePragma.cpp in Sources */, + 3551068D0E9A8546006A4E44 /* ParseTentative.cpp in Sources */, + DE4DC7A30EA1C33E00069E5A /* TokenRewriter.cpp in Sources */, + 35A057E20EAE2D950069249F /* RegionStore.cpp in Sources */, + 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 */, + 35E1946D0ECB83C100F21733 /* PTHLexer.cpp in Sources */, + 3537AA0E0ECD08A4008F7CDC /* PreprocessorLexer.cpp in Sources */, + DE8823CB0ED0046600CBC30A /* APValue.cpp in Sources */, + 3538FDB80ED24A4E005EC283 /* DeclarationName.cpp in Sources */, + 353959D50EE5F88A00E82461 /* ParseTemplate.cpp in Sources */, + 3591853F0EFB1088000039AF /* SemaTemplate.cpp in Sources */, + 357EA27D0F2526F300439B60 /* SemaLookup.cpp in Sources */, + DEB076CF0F3A222200F5A2BE /* DeclTemplate.cpp in Sources */, + 1A471AB50F437BC500753CE8 /* CGBlocks.cpp in Sources */, + DEB077990F44F97800F5A2BE /* TokenConcatenation.cpp in Sources */, + 1A2193CE0F45EEB700C0713D /* Mangle.cpp in Sources */, + DEB07AC80F4A427E00F5A2BE /* SemaAttr.cpp in Sources */, + 352246E70F5C6BE000D0D279 /* HTMLDiagnostics.cpp in Sources */, + 352246E80F5C6BE000D0D279 /* InitHeaderSearch.cpp in Sources */, + 352246E90F5C6BE000D0D279 /* ManagerRegistry.cpp in Sources */, + 352246EA0F5C6BE000D0D279 /* PlistDiagnostics.cpp in Sources */, + 352246EB0F5C6BE000D0D279 /* TextDiagnosticBuffer.cpp in Sources */, + 352246EC0F5C6BE000D0D279 /* TextDiagnosticPrinter.cpp in Sources */, + 35544B880F5C7FD700D92AA9 /* RangeConstraintManager.cpp in Sources */, + 35544B890F5C7FD700D92AA9 /* SimpleConstraintManager.cpp in Sources */, + 35544B8C0F5C803200D92AA9 /* SemaTemplateInstantiate.cpp in Sources */, + DEDFE5CF0F7206E40035BD10 /* NestedNameSpecifier.cpp in Sources */, + 1ADF47AF0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp in Sources */, + DEDFE6460F7B3B4E0035BD10 /* driver.cpp in Sources */, + DEDFE65A0F7B3B830035BD10 /* Types.cpp in Sources */, + DEDFE65B0F7B3B830035BD10 /* Tools.cpp in Sources */, + DEDFE65C0F7B3B830035BD10 /* Compilation.cpp in Sources */, + DEDFE65D0F7B3B830035BD10 /* ArgList.cpp in Sources */, + DEDFE65E0F7B3B830035BD10 /* Arg.cpp in Sources */, + DEDFE65F0F7B3B830035BD10 /* Action.cpp in Sources */, + DEDFE6600F7B3B830035BD10 /* Phases.cpp in Sources */, + DEDFE6610F7B3B830035BD10 /* OptTable.cpp in Sources */, + DEDFE6620F7B3B830035BD10 /* Option.cpp in Sources */, + DEDFE6630F7B3B830035BD10 /* Job.cpp in Sources */, + DEDFE6640F7B3B830035BD10 /* ToolChains.cpp in Sources */, + DEDFE6650F7B3B830035BD10 /* ToolChain.cpp in Sources */, + DEDFE6660F7B3B830035BD10 /* Tool.cpp in Sources */, + DEDFE6670F7B3B830035BD10 /* HostInfo.cpp in Sources */, + DEDFE6680F7B3B830035BD10 /* Driver.cpp in Sources */, + 1A701B640F7C8FE400FEC4D1 /* SemaAccess.cpp in Sources */, + 906BF4B00F83BA2E001071FA /* ConvertUTF.c in Sources */, + DEDFF8880F848CF80035BD10 /* TemplateName.cpp in Sources */, + 1AFEF4070F8A6B2300476F2B /* clang-cc.cpp in Sources */, + DEF165710F8FB34D0098507F /* PCHWriter.cpp in Sources */, + DEF165750F8FB3510098507F /* PCHReader.cpp in Sources */, + DEF168400F9548DC0098507F /* FixItRewriter.cpp in Sources */, + DECB6D650F9AE26600F5FBC7 /* JumpDiagnostics.cpp in Sources */, + DECB6F070F9D93A800F5FBC7 /* InitPreprocessor.cpp in Sources */, + DECB77130FA5752300F5FBC7 /* PCHReaderStmt.cpp in Sources */, + 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 */, + 1A2A54B80FD1DD1C00F4CE45 /* CacheTokens.cpp in Sources */, + 1A2A54B90FD1DD1C00F4CE45 /* DependencyFile.cpp in Sources */, + 1A2A54BA0FD1DD1C00F4CE45 /* DiagChecker.cpp in Sources */, + 1A2A54BB0FD1DD1C00F4CE45 /* DocumentXML.cpp in Sources */, + 1A2A54BC0FD1DD1C00F4CE45 /* GeneratePCH.cpp in Sources */, + 1A2A54BD0FD1DD1C00F4CE45 /* HTMLPrint.cpp in Sources */, + 1A2A54BE0FD1DD1C00F4CE45 /* PrintParserCallbacks.cpp in Sources */, + 1A2A54BF0FD1DD1C00F4CE45 /* PrintPreprocessedOutput.cpp in Sources */, + 1A2A54C00FD1DD1C00F4CE45 /* RewriteBlocks.cpp in Sources */, + 1A2A54C10FD1DD1C00F4CE45 /* RewriteMacros.cpp in Sources */, + 1A2A54C20FD1DD1C00F4CE45 /* RewriteObjC.cpp in Sources */, + 1A2A54C30FD1DD1C00F4CE45 /* RewriteTest.cpp in Sources */, + 1A2A54C40FD1DD1C00F4CE45 /* StmtXML.cpp in Sources */, + 1A2A54C50FD1DD1C00F4CE45 /* Warnings.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1DEB923208733DC60010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + COPY_PHASE_STRIP = NO; + GCC_CW_ASM_SYNTAX = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; + GCC_ENABLE_PASCAL_STRINGS = NO; + GCC_ENABLE_SYMBOL_SEPARATION = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + __STDC_CONSTANT_MACROS, + "__STDC_LIMIT_MACROS=1", + ); + GCC_STRICT_ALIASING = YES; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_THREADSAFE_STATICS = NO; + GCC_USE_GCC3_PFE_SUPPORT = NO; + INSTALL_PATH = "$(HOME)/bin"; + OTHER_LDFLAGS = ( + "-lLLVMBitWriter", + "-lLLVMBitReader", + "-lLLVMAsmPrinter", + "-lLLVMSelectionDAG", + "-lLLVMCodeGen", + "-lLLVMipo", + "-lLLVMScalarOpts", + "-lLLVMTransformUtils", + "-lLLVMipa", + "-lLLVMAnalysis", + "-lLLVMTarget", + "-lLLVMCore", + "-lLLVMSupport", + "-lLLVMSystem", + ); + PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; + PRODUCT_NAME = clang; + }; + name = Debug; + }; + 1DEB923308733DC60010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + GCC_CW_ASM_SYNTAX = NO; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; + GCC_ENABLE_PASCAL_STRINGS = NO; + GCC_ENABLE_SYMBOL_SEPARATION = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_PREPROCESSOR_DEFINITIONS = ( + __STDC_CONSTANT_MACROS, + "__STDC_LIMIT_MACROS=1", + ); + GCC_STRICT_ALIASING = YES; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_THREADSAFE_STATICS = NO; + GCC_USE_GCC3_PFE_SUPPORT = NO; + INSTALL_PATH = "$(HOME)/bin"; + OTHER_LDFLAGS = ( + "-lLLVMBitWriter", + "-lLLVMBitReader", + "-lLLVMAsmPrinter", + "-lLLVMSelectionDAG", + "-lLLVMCodeGen", + "-lLLVMipo", + "-lLLVMScalarOpts", + "-lLLVMTransformUtils", + "-lLLVMipa", + "-lLLVMAnalysis", + "-lLLVMTarget", + "-lLLVMCore", + "-lLLVMSupport", + "-lLLVMSystem", + ); + PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; + PRODUCT_NAME = clang; + }; + name = Release; + }; + 1DEB923608733DC60010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_VERSION = ""; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + ../../include, + include, + ); + LIBRARY_SEARCH_PATHS = ../../Debug/lib; + OTHER_LDFLAGS = ""; + PREBINDING = NO; + }; + name = Debug; + }; + 1DEB923708733DC60010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + ../../include, + include, + ); + LIBRARY_SEARCH_PATHS = ../../Release; + OTHER_LDFLAGS = ""; + PREBINDING = NO; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "clang" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB923208733DC60010E9CD /* Debug */, + 1DEB923308733DC60010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB923608733DC60010E9CD /* Debug */, + 1DEB923708733DC60010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; +} diff --git a/docs/AnalyzerRegions.html b/docs/AnalyzerRegions.html new file mode 100644 index 0000000..35708d5 --- /dev/null +++ b/docs/AnalyzerRegions.html @@ -0,0 +1,258 @@ + + +Static Analyzer Design Document: Memory Regions + + + +

Static Analyzer Design Document: Memory Regions

+ +

Authors

+ +

Ted Kremenek, kremenek at apple
+Zhongxing Xu, xuzhongzhing at gmail

+ +

Introduction

+ +

The path-sensitive analysis engine in libAnalysis employs an extensible API +for abstractly modeling the memory of an analyzed program. This API employs the +concept of "memory regions" to abstractly model chunks of program memory such as +program variables and dynamically allocated memory such as those returned from +'malloc' and 'alloca'. Regions are hierarchical, with subregions modeling +subtyping relationships, field and array offsets into larger chunks of memory, +and so on.

+ +

The region API consists of two components:

+ +
  • A taxonomy and representation of regions themselves within the analyzer +engine. The primary definitions and interfaces are described in MemRegion.h. +At the root of the region hierarchy is the class MemRegion with +specific subclasses refining the region concept for variables, heap allocated +memory, and so forth.
  • The modeling of binding of values to regions. For +example, modeling the value stored to a local variable x consists of +recording the binding between the region for x (which represents the +raw memory associated with x) and the value stored to x. This +binding relationship is captured with the notion of "symbolic +stores."
+ +

Symbolic stores, which can be thought of as representing the relation +regions -> values, are implemented by subclasses of the +StoreManager class (Store.h). A +particular StoreManager implementation has complete flexibility concerning the +following: + +

    +
  • How to model the binding between regions and values
  • +
  • What bindings are recorded +
+ +

Together, both points allow different StoreManagers to tradeoff between +different levels of analysis precision and scalability concerning the reasoning +of program memory. Meanwhile, the core path-sensitive engine makes no +assumptions about either points, and queries a StoreManager about the bindings +to a memory region through a generic interface that all StoreManagers share. If +a particular StoreManager cannot reason about the potential bindings of a given +memory region (e.g., 'BasicStoreManager' does not reason about fields +of structures) then the StoreManager can simply return 'unknown' (represented by +'UnknownVal') for a particular region-binding. This separation of +concerns not only isolates the core analysis engine from the details of +reasoning about program memory but also facilities the option of a client of the +path-sensitive engine to easily swap in different StoreManager implementations +that internally reason about program memory in very different ways. + +

The rest of this document is divided into two parts. We first discuss region +taxonomy and the semantics of regions. We then discuss the StoreManager +interface, and details of how the currently available StoreManager classes +implement region bindings.

+ +

Memory Regions and Region Taxonomy

+ +

Pointers

+ +

Before talking about the memory regions, we would talk about the pointers +since memory regions are essentially used to represent pointer values.

+ +

The pointer is a type of values. Pointer values have two semantic aspects. +One is its physical value, which is an address or location. The other is the +type of the memory object residing in the address.

+ +

Memory regions are designed to abstract these two properties of the pointer. +The physical value of a pointer is represented by MemRegion pointers. The rvalue +type of the region corresponds to the type of the pointee object.

+ +

One complication is that we could have different view regions on the same +memory chunk. They represent the same memory location, but have different +abstract location, i.e., MemRegion pointers. Thus we need to canonicalize the +abstract locations to get a unique abstract location for one physical +location.

+ +

Furthermore, these different view regions may or may not represent memory +objects of different types. Some different types are semantically the same, +for example, 'struct s' and 'my_type' are the same type.

+ +
+struct s;
+typedef struct s my_type;
+
+ +

But char and int are not the same type in the code below:

+ +
+void *p;
+int *q = (int*) p;
+char *r = (char*) p;
+
Thus we need to canonicalize the MemRegion which is used in binding and +retrieving.

+ +

Regions

+

Region is the entity used to model pointer values. A Region has the following +properties:

+ +
    +
  • Kind
  • + +
  • ObjectType: the type of the object residing on the region.
  • + +
  • LocationType: the type of the pointer value that the region corresponds to. + Usually this is the pointer to the ObjectType. But sometimes we want to cache + this type explicitly, for example, for a CodeTextRegion.
  • + +
  • StartLocation
  • + +
  • EndLocation
  • +
+ +

Symbolic Regions

+ +

A symbolic region is a map of the concept of symbolic values into the domain +of regions. It is the way that we represent symbolic pointers. Whenever a +symbolic pointer value is needed, a symbolic region is created to represent +it.

+ +

A symbolic region has no type. It wraps a SymbolData. But sometimes we have +type information associated with a symbolic region. For this case, a +TypedViewRegion is created to layer the type information on top of the symbolic +region. The reason we do not carry type information with the symbolic region is +that the symbolic regions can have no type. To be consistent, we don't let them +to carry type information.

+ +

Like a symbolic pointer, a symbolic region may be NULL, has unknown extent, +and represents a generic chunk of memory.

+ +

NOTE: We plan not to use loc::SymbolVal in RegionStore and remove it + gradually.

+ +

Symbolic regions get their rvalue types through the following ways:

+ +
    +
  • Through the parameter or global variable that points to it, e.g.: +
    +void f(struct s* p) {
    +  ...
    +}
    +
    + +

    The symbolic region pointed to by p has type struct +s.

  • + +
  • Through explicit or implicit casts, e.g.: +
    +void f(void* p) {
    +  struct s* q = (struct s*) p;
    +  ...
    +}
    +
    +
  • +
+ +

We attach the type information to the symbolic region lazily. For the first +case above, we create the TypedViewRegion only when the pointer is +actually used to access the pointee memory object, that is when the element or +field region is created. For the cast case, the TypedViewRegion is +created when visiting the CastExpr.

+ +

The reason for doing lazy typing is that symbolic regions are sometimes only +used to do location comparison.

+ +

Pointer Casts

+ +

Pointer casts allow people to impose different 'views' onto a chunk of +memory.

+ +

Usually we have two kinds of casts. One kind of casts cast down with in the +type hierarchy. It imposes more specific views onto more generic memory regions. +The other kind of casts cast up with in the type hierarchy. It strips away more +specific views on top of the more generic memory regions.

+ +

We simulate the down casts by layering another TypedViewRegion on +top of the original region. We simulate the up casts by striping away the top +TypedViewRegion. Down casts is usually simple. For up casts, if the +there is no TypedViewRegion to be stripped, we return the original +region. If the underlying region is of the different type than the cast-to type, +we flag an error state.

+ +

For toll-free bridging casts, we return the original region.

+ +

We can set up a partial order for pointer types, with the most general type +void* at the top. The partial order forms a tree with void* as +its root node.

+ +

Every MemRegion has a root position in the type tree. For example, +the pointee region of void *p has its root position at the root node of +the tree. VarRegion of int x has its root position at the 'int +type' node.

+ +

TypedViewRegion is used to move the region down or up in the tree. +Moving down in the tree adds a TypedViewRegion. Moving up in the tree +removes a TypedViewRegion.

+ +

Do we want to allow moving up beyond the root position? This happens +when:

 int x; void *p = &x; 
+ +

The region of x has its root position at 'int*' node. the cast to +void* moves that region up to the 'void*' node. I propose to not allow such +casts, and assign the region of x for p.

+ +

Another non-ideal case is that people might cast to a non-generic pointer +from another non-generic pointer instead of first casting it back to the generic +pointer. Direct handling of this case would result in multiple layers of +TypedViewRegions. This enforces an incorrect semantic view to the region, +because we can only have one typed view on a region at a time. To avoid this +inconsistency, before casting the region, we strip the TypedViewRegion, then do +the cast. In summary, we only allow one layer of TypedViewRegion.

+ +

Region Bindings

+ +

The following region kinds are boundable: VarRegion, CompoundLiteralRegion, +StringRegion, ElementRegion, FieldRegion, and ObjCIvarRegion.

+ +

When binding regions, we perform canonicalization on element regions and field +regions. This is because we can have different views on the same region, some +of which are essentially the same view with different sugar type names.

+ +

To canonicalize a region, we get the canonical types for all TypedViewRegions +along the way up to the root region, and make new TypedViewRegions with those +canonical types.

+ +

For Objective-C and C++, perhaps another canonicalization rule should be +added: for FieldRegion, the least derived class that has the field is used as +the type of the super region of the FieldRegion.

+ +

All bindings and retrievings are done on the canonicalized regions.

+ +

Canonicalization is transparent outside the region store manager, and more +specifically, unaware outside the Bind() and Retrieve() method. We don't need to +consider region canonicalization when doing pointer cast.

+ +

Constraint Manager

+ +

The constraint manager reasons about the abstract location of memory objects. +We can have different views on a region, but none of these views changes the +location of that object. Thus we should get the same abstract location for those +regions.

+ + + diff --git a/docs/BlockImplementation.txt b/docs/BlockImplementation.txt new file mode 100644 index 0000000..b2ad405 --- /dev/null +++ b/docs/BlockImplementation.txt @@ -0,0 +1,647 @@ +Block Implementation Specification + +Copyright 2008-2009 Apple, Inc. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +0. History + +2008/7/14 - created +2008/8/21 - revised, C++ +2008/9/24 - add NULL isa field to __block storage +2008/10/1 - revise block layout to use a static descriptor structure +2008/10/6 - revise block layout to use an unsigned long int flags +2008/10/28 - specify use of _Block_object_assign/dispose for all "Object" types in helper functions +2008/10/30 - revise new layout to have invoke function in same place +2008/10/30 - add __weak support + +This document describes the Apple ABI implementation specification of Blocks. + +1. High Level + +A Block consists of a structure of the following form: + +struct Block_literal_1 { + void *isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock + int flags; + int reserved; + void (*invoke)(void *, ...); + struct Block_descriptor_1 { + unsigned long int reserved; // NULL + unsigned long int size; // sizeof(struct Block_literal_1) + // optional helper functions + void (*copy_helper)(void *dst, void *src); + void (*dispose_helper)(void *src); + } *descriptor; + // imported variables +}; + +The following flags bits are used by the compiler: + +enum { + BLOCK_HAS_COPY_DISPOSE = (1 << 25), + BLOCK_HAS_CTOR = (1 << 26), // helpers have C++ code + BLOCK_IS_GLOBAL = (1 << 28), + BLOCK_HAS_DESCRIPTOR = (1 << 29), // interim until complete world build is accomplished +}; + +Block literals may occur within functions where the structure is created in stack local memory. They may also appear as initialization expressions for Block variables of global or static local variables. + +When a Block literal expression is evaluated the stack based structure is initialized as follows: + +1) static descriptor structure is declared and initialized as follows: +1a) the invoke function pointer is set to a function that takes the Block structure as its first argument and the rest of the arguments (if any) to the Block and executes the Block compound statement. +1b) the size field is set to the size of the following Block literal structure. +1c) the copy_helper and dispose_helper function pointers are set to respective helper functions if they are required by the Block literal +2) a stack (or global) Block literal data structure is created and initialized as follows: +2a) the isa field is set to the address of the external _NSConcreteStackBlock, which is a block of uninitialized memory supplied in libSystem, or _NSConcreteGlobalBlock if this is a static or file level block literal. +2) The flags field is set to zero unless there are variables imported into the block that need helper functions for program level Block_copy() and Block_release() operations, in which case the (1<<25) flags bit is set. + +As an example, the Block literal expression + ^ { printf("hello world\n"); } +would cause to be created on a 32-bit system: + +struct __block_literal_1 { + void *isa; + int flags; + int reserved; + void (*invoke)(struct __block_literal_1 *); + struct __block_descriptor_1 *descriptor; +}; + +void __block_invoke_1(struct __block_literal_1 *_block) { + printf("hello world\n"); +} + +static struct __block_descriptor_1 { + unsigned long int reserved; + unsigned long int Block_size; +} __block_descriptor_1 = { 0, sizeof(struct __block_literal_1), __block_invoke_1 }; + +and where the block literal appeared + + struct __block_literal_1 _block_literal = { + &_NSConcreteStackBlock, + (1<<29), , + __block_invoke_1, + &__block_descriptor_1 + }; + +Blocks import other Block references, const copies of other variables, and variables marked __block. In Objective-C variables may additionally be objects. + +When a Block literal expression used as the initial value of a global or static local variable it is initialized as follows: + struct __block_literal_1 __block_literal_1 = { + &_NSConcreteGlobalBlock, + (1<<28)|(1<<29), , + __block_invoke_1, + &__block_descriptor_1 + }; +that is, a different address is provided as the first value and a particular (1<<28) bit is set in the flags field, and otherwise it is the same as for stack based Block literals. This is an optimization that can be used for any Block literal that imports no const or __block storage variables. + + +2. Imported Variables + +Variables of "auto" storage class are imported as const copies. Variables of "__block" storage class are imported as a pointer to an enclosing data structure. Global variables are simply referenced and not considered as imported. + +2.1 Imported const copy variables + +Automatic storage variables not marked with __block are imported as const copies. + +The simplest example is that of importing a variable of type int. + + int x = 10; + void (^vv)(void) = ^{ printf("x is %d\n", x); } + x = 11; + vv(); + +would be compiled + +struct __block_literal_2 { + void *isa; + int flags; + int reserved; + void (*invoke)(struct __block_literal_2 *); + struct __block_descriptor_2 *descriptor; + const int x; +}; + +void __block_invoke_2(struct __block_literal_2 *_block) { + printf("x is %d\n", _block->x); +} + +static struct __block_descriptor_2 { + unsigned long int reserved; + unsigned long int Block_size; +} __block_descriptor_2 = { 0, sizeof(struct __block_literal_2) }; + +and + + struct __block_literal_2 __block_literal_2 = { + &_NSConcreteStackBlock, + (1<<29), , + __block_invoke_2, + &__block_descriptor_2, + x + }; + +In summary, scalars, structures, unions, and function pointers are generally imported as const copies with no need for helper functions. + +2.2 Imported const copy of Block reference + +The first case where copy and dispose helper functions are required is for the case of when a block itself is imported. In this case both a copy_helper function and a dispose_helper function are needed. The copy_helper function is passed both the existing stack based pointer and the pointer to the new heap version and should call back into the runtime to actually do the copy operation on the imported fields within the block. The runtime functions are all described in Section 5.0 Runtime Helper Functions. + +An example: + + void (^existingBlock)(void) = ...; + void (^vv)(void) = ^{ existingBlock(); } + vv(); + +struct __block_literal_3 { + ...; // existing block +}; + +struct __block_literal_4 { + void *isa; + int flags; + int reserved; + void (*invoke)(struct __block_literal_4 *); + struct __block_literal_3 *const existingBlock; +}; + +void __block_invoke_4(struct __block_literal_2 *_block) { + __block->existingBlock->invoke(__block->existingBlock); +} + +void __block_copy_4(struct __block_literal_4 *dst, struct __block_literal_4 *src) { + //_Block_copy_assign(&dst->existingBlock, src->existingBlock, 0); + _Block_object_assign(&dst->existingBlock, src->existingBlock, BLOCK_FIELD_IS_BLOCK); +} + +void __block_dispose_4(struct __block_literal_4 *src) { + // was _Block_destroy + _Block_object_dispose(src->existingBlock, BLOCK_FIELD_IS_BLOCK); +} + +static struct __block_descriptor_4 { + unsigned long int reserved; + unsigned long int Block_size; + void (*copy_helper)(struct __block_literal_4 *dst, struct __block_literal_4 *src); + void (*dispose_helper)(struct __block_literal_4 *); +} __block_descriptor_4 = { + 0, + sizeof(struct __block_literal_4), + __block_copy_4, + __block_dispose_4, +}; + +and where it is used + + struct __block_literal_4 _block_literal = { + &_NSConcreteStackBlock, + (1<<25)|(1<<29), + __block_invoke_4, + & __block_descriptor_4 + existingBlock, + }; + +2.2.1 Importing __attribute__((NSObject)) variables. + +GCC introduces __attribute__((NSObject)) on structure pointers to mean "this is an object". This is useful because many low level data structures are declared as opaque structure pointers, e.g. CFStringRef, CFArrayRef, etc. When used from C, however, these are still really objects and are the second case where that requires copy and dispose helper functions to be generated. The copy helper functions generated by the compiler should use the _Block_object_assign runtime helper function and in the dispose helper the _Block_object_dispose runtime helper function should be called. + +For example, block xyzzy in the following + + struct Opaque *__attribute__((NSObject)) objectPointer = ...; + ... + void (^xyzzy)(void) = ^{ CFPrint(objectPointer); }; + +would have helper functions + +void __block_copy_xyzzy(struct __block_literal_5 *dst, struct __block_literal_5 *src) { + _Block_object_assign(&dst->objectPointer, src-> objectPointer, BLOCK_FIELD_IS_OBJECT); +} + +void __block_dispose_xyzzy(struct __block_literal_5 *src) { + _Block_object_dispose(src->objectPointer, BLOCK_FIELD_IS_OBJECT); +} + +generated. + + +2.3 Imported __block marked variables. + +2.3.1 Layout of __block marked variables + +The compiler must embed variables that are marked __block in a specialized structure of the form: + +struct _block_byref_xxxx { + void *isa; + struct Block_byref *forwarding; + int flags; //refcount; + int size; + typeof(marked_variable) marked_variable; +}; + +Variables of certain types require helper functions for when Block_copy() and Block_release() are performed upon a referencing Block. At the "C" level only variables that are of type Block or ones that have __attribute__((NSObject)) marked require helper functions. In Objective-C objects require helper functions and in C++ stack based objects require helper functions. Variables that require helper functions use the form: + +struct _block_byref_xxxx { + void *isa; + struct _block_byref_xxxx *forwarding; + int flags; //refcount; + int size; + // helper functions called via Block_copy() and Block_release() + void (*byref_keep)(void *dst, void *src); + void (*byref_dispose)(void *); + typeof(marked_variable) marked_variable; +}; + +The structure is initialized such that + a) the forwarding pointer is set to the beginning of its enclosing structure, + b) the size field is initialized to the total size of the enclosing structure, + c) the flags field is set to either 0 if no helper functions are needed or (1<<25) if they are, + d) the helper functions are initialized (if present) + e) the variable itself is set to its initial value. + f) the isa field is set to NULL + +2.3.2 Access to __block variables from within its lexical scope. + +In order to "move" the variable to the heap upon a copy_helper operation the compiler must rewrite access to such a variable to be indirect through the structures forwarding pointer. For example: + + int __block i = 10; + i = 11; + +would be rewritten to be: + + struct _block_byref_i { + void *isa; + struct _block_byref_i *forwarding; + int flags; //refcount; + int size; + int captured_i; + } i = { NULL, &i, 0, sizeof(struct _block_byref_i), 11; + + i.forwarding->captured_i = 11; + +In the case of a Block reference variable being marked __block the helper code generated must use the _Block_object_assign and _Block_object_dispose routines supplied by the runtime to make the copies. For example: + + __block void (voidBlock)(void) = blockA; + voidBlock = blockB; + +would translate into + +struct _block_byref_voidBlock { + void *isa; + struct _block_byref_voidBlock *forwarding; + int flags; //refcount; + int size; + void (*byref_keep)(struct _block_byref_voidBlock *dst, struct _block_byref_voidBlock *src); + void (*byref_dispose)(struct _block_byref_voidBlock *); + void (^captured_voidBlock)(void); +}; + +void _block_byref_keep_helper(struct _block_byref_voidBlock *dst, struct _block_byref_voidBlock *src) { + //_Block_copy_assign(&dst->captured_voidBlock, src->captured_voidBlock, 0); + _Block_object_assign(&dst->captured_voidBlock, src->captured_voidBlock, BLOCK_FIELD_IS_BLOCK | BLOCK_BYREF_CALLER); +} + +void _block_byref_dispose_helper(struct _block_byref_voidBlock *param) { + //_Block_destroy(param->captured_voidBlock, 0); + _Block_object_dispose(param->captured_voidBlock, BLOCK_FIELD_IS_BLOCK | BLOCK_BYREF_CALLER)} + +and + struct _block_byref_voidBlock voidBlock = {( .forwarding=&voidBlock, .flags=(1<<25), .size=sizeof(struct _block_byref_voidBlock *), + .byref_keep=_block_byref_keep_helper, .byref_dispose=_block_byref_dispose_helper, + .captured_voidBlock=blockA }; + + voidBlock.forwarding->captured_voidBlock = blockB; + + +2.3.3 Importing __block variables into Blocks + +A Block that uses a __block variable in its compound statement body must import the variable and emit copy_helper and dispose_helper helper functions that, in turn, call back into the runtime to actually copy or release the byref data block using the functions _Block_object_assign and _Block_object_dispose. + +For example: + + int __block i = 2; + functioncall(^{ i = 10; }); + +would translate to + +struct _block_byref_i { + void *isa; // set to NULL + struct _block_byref_voidBlock *forwarding; + int flags; //refcount; + int size; + void (*byref_keep)(struct _block_byref_i *dst, struct _block_byref_i *src); + void (*byref_dispose)(struct _block_byref_i *); + int captured_i; +}; + + +struct __block_literal_5 { + void *isa; + int flags; + int reserved; + void (*invoke)(struct __block_literal_5 *); + struct __block_descriptor_5 *descriptor; + struct _block_byref_i *i_holder; +}; + +void __block_invoke_5(struct __block_literal_5 *_block) { + _block->forwarding->captured_i = 10; +} + +void __block_copy_5(struct __block_literal_5 *dst, struct __block_literal_5 *src) { + //_Block_byref_assign_copy(&dst->captured_i, src->captured_i); + _Block_object_assign(&dst->captured_i, src->captured_i, BLOCK_FIELD_IS_BYREF | BLOCK_BYREF_CALLER); +} + +void __block_dispose_5(struct __block_literal_5 *src) { + //_Block_byref_release(src->captured_i); + _Block_object_dispose(src->captured_i, BLOCK_FIELD_IS_BYREF | BLOCK_BYREF_CALLER); +} + +static struct __block_descriptor_5 { + unsigned long int reserved; + unsigned long int Block_size; + void (*copy_helper)(struct __block_literal_5 *dst, struct __block_literal_5 *src); + void (*dispose_helper)(struct __block_literal_5 *); +} __block_descriptor_5 = { 0, sizeof(struct __block_literal_5) __block_copy_5, __block_dispose_5 }; + +and + + struct _block_byref_i i = {( .forwarding=&i, .flags=0, .size=sizeof(struct _block_byref_i) )}; + struct __block_literal_5 _block_literal = { + &_NSConcreteStackBlock, + (1<<25)|(1<<29), , + __block_invoke_5, + &__block_descriptor_5, + 2, + }; + +2.3.4 Importing __attribute__((NSObject)) __block variables + +A __block variable that is also marked __attribute__((NSObject)) should have byref_keep and byref_dispose helper functions that use _Block_object_assign and _Block_object_dispose. + +2.3.5 __block escapes + +Because Blocks referencing __block variables may have Block_copy() performed upon them the underlying storage for the variables may move to the heap. In Objective-C Garbage Collection Only compilation environments the heap used is the garbage collected one and no further action is required. Otherwise the compiler must issue a call to potentially release any heap storage for __block variables at all escapes or terminations of their scope. + + +2.3.6 Nesting + +Blocks may contain Block literal expressions. Any variables used within inner blocks are imported into all enclosing Block scopes even if the variables are not used. This includes const imports as well as __block variables. + +3. Objective C Extensions to Blocks + +3.1 Importing Objects + +Objects should be treated as __attribute__((NSObject)) variables; all copy_helper, dispose_helper, byref_keep, and byref_dispose helper functions should use _Block_object_assign and _Block_object_dispose. There should be no code generated that uses -retain or -release methods. + + +3.2 Blocks as Objects + +The compiler will treat Blocks as objects when synthesizing property setters and getters, will characterize them as objects when generating garbage collection strong and weak layout information in the same manner as objects, and will issue strong and weak write-barrier assignments in the same manner as objects. + +3.3 __weak __block Support + +Objective-C (and Objective-C++) support the __weak attribute on __block variables. Under normal circumstances the compiler uses the Objective-C runtime helper support functions objc_assign_weak and objc_read_weak. Both should continue to be used for all reads and writes of __weak __block variables: + objc_read_weak(&block->byref_i->forwarding->i) + +The __weak variable is stored in a _block_byref_xxxx structure and the Block has copy and dispose helpers for this structure that call: + _Block_object_assign(&dest->_block_byref_i, src-> _block_byref_i, BLOCK_FIELD_IS_WEAK | BLOCK_FIELD_IS_BYREF); +and + _Block_object_dispose(src->_block_byref_i, BLOCK_FIELD_IS_WEAK | BLOCK_FIELD_IS_BYREF); + + +In turn, the block_byref copy support helpers distinguish between whether the __block variable is a Block or not and should either call: + _Block_object_assign(&dest->_block_byref_i, src->_block_byref_i, BLOCK_FIELD_IS_WEAK | BLOCK_FIELD_IS_OBJECT | BLOCK_BYREF_CALLER); +for something declared as an object or + _Block_object_assign(&dest->_block_byref_i, src->_block_byref_i, BLOCK_FIELD_IS_WEAK | BLOCK_FIELD_IS_BLOCK | BLOCK_BYREF_CALLER); +for something declared as a Block. + +A full example follows: + + + __block __weak id obj = ; + functioncall(^{ [obj somemessage]; }); + +would translate to + +struct _block_byref_obj { + void *isa; // uninitialized + struct _block_byref_obj *forwarding; + int flags; //refcount; + int size; + void (*byref_keep)(struct _block_byref_i *dst, struct _block_byref_i *src); + void (*byref_dispose)(struct _block_byref_i *); + int captured_obj; +}; + +void _block_byref_obj_keep(struct _block_byref_voidBlock *dst, struct _block_byref_voidBlock *src) { + //_Block_copy_assign(&dst->captured_obj, src->captured_obj, 0); + _Block_object_assign(&dst->captured_obj, src->captured_obj, BLOCK_FIELD_IS_OBJECT | BLOCK_FIELD_IS_WEAK | BLOCK_BYREF_CALLER); +} + +void _block_byref_obj_dispose(struct _block_byref_voidBlock *param) { + //_Block_destroy(param->captured_obj, 0); + _Block_object_dispose(param->captured_obj, BLOCK_FIELD_IS_OBJECT | BLOCK_FIELD_IS_WEAK | BLOCK_BYREF_CALLER); +}; + +for the block byref part and + +struct __block_literal_5 { + void *isa; + int flags; + int reserved; + void (*invoke)(struct __block_literal_5 *); + struct __block_descriptor_5 *descriptor; + struct _block_byref_obj *byref_obj; +}; + +void __block_invoke_5(struct __block_literal_5 *_block) { + [objc_read_weak(&_block->byref_obj->forwarding->captured_obj) somemessage]; +} + +void __block_copy_5(struct __block_literal_5 *dst, struct __block_literal_5 *src) { + //_Block_byref_assign_copy(&dst->byref_obj, src->byref_obj); + _Block_object_assign(&dst->byref_obj, src->byref_obj, BLOCK_FIELD_IS_BYREF | BLOCK_FIELD_IS_WEAK); +} + +void __block_dispose_5(struct __block_literal_5 *src) { + //_Block_byref_release(src->byref_obj); + _Block_object_dispose(src->byref_obj, BLOCK_FIELD_IS_BYREF | BLOCK_FIELD_IS_WEAK); +} + +static struct __block_descriptor_5 { + unsigned long int reserved; + unsigned long int Block_size; + void (*copy_helper)(struct __block_literal_5 *dst, struct __block_literal_5 *src); + void (*dispose_helper)(struct __block_literal_5 *); +} __block_descriptor_5 = { 0, sizeof(struct __block_literal_5), __block_copy_5, __block_dispose_5 }; + +and within the compound statement: + + struct _block_byref_obj obj = {( .forwarding=&obj, .flags=(1<<25), .size=sizeof(struct _block_byref_obj), + .byref_keep=_block_byref_obj_keep, .byref_dispose=_block_byref_obj_dispose, + .captured_obj = )}; + + struct __block_literal_5 _block_literal = { + &_NSConcreteStackBlock, + (1<<25)|(1<<29), , + __block_invoke_5, + &__block_descriptor_5, + &obj, // a reference to the on-stack structure containing "captured_obj" + }; + + + functioncall(_block_literal->invoke(&_block_literal)); + + +4.0 C++ Support + +Within a block stack based C++ objects are copied as const copies using the const copy constructor. It is an error if a stack based C++ object is used within a block if it does not have a const copy constructor. In addition both copy and destroy helper routines must be synthesized for the block to support the Block_copy() operation, and the flags work marked with the (1<<26) bit in addition to the (1<<25) bit. The copy helper should call the constructor using appropriate offsets of the variable within the supplied stack based block source and heap based destination for all const constructed copies, and similarly should call the destructor in the destroy routine. + +As an example, suppose a C++ class FOO existed with a const copy constructor. Within a code block a stack version of a FOO object is declared and used within a Block literal expression: + +{ + FOO foo; + void (^block)(void) = ^{ printf("%d\n", foo.value()); }; +} + +The compiler would synthesize + +struct __block_literal_10 { + void *isa; + int flags; + int reserved; + void (*invoke)(struct __block_literal_10 *); + struct __block_descriptor_10 *descriptor; + const FOO foo; +}; + +void __block_invoke_10(struct __block_literal_10 *_block) { + printf("%d\n", _block->foo.value()); +} + +void __block_literal_10(struct __block_literal_10 *dst, struct __block_literal_10 *src) { + comp_ctor(&dst->foo, &src->foo); +} + +void __block_dispose_10(struct __block_literal_10 *src) { + comp_dtor(&src->foo); +} + +static struct __block_descriptor_10 { + unsigned long int reserved; + unsigned long int Block_size; + void (*copy_helper)(struct __block_literal_10 *dst, struct __block_literal_10 *src); + void (*dispose_helper)(struct __block_literal_10 *); +} __block_descriptor_10 = { 0, sizeof(struct __block_literal_10), __block_copy_10, __block_dispose_10 }; + +and the code would be: +{ + FOO foo; + comp_ctor(&foo); // default constructor + struct __block_literal_10 _block_literal = { + &_NSConcreteStackBlock, + (1<<25)|(1<<26)|(1<<29), , + __block_invoke_10, + &__block_descriptor_10, + }; + comp_ctor(&_block_literal->foo, &foo); // const copy into stack version + struct __block_literal_10 &block = &_block_literal; // assign literal to block variable + block->invoke(block); // invoke block + comp_dtor(&_block_literal->foo); // destroy stack version of const block copy + comp_dtor(&foo); // destroy original version +} + + +C++ objects stored in __block storage start out on the stack in a block_byref data structure as do other variables. Such objects (if not const objects) must support a regular copy constructor. The block_byref data structure will have copy and destroy helper routines synthesized by the compiler. The copy helper will have code created to perform the copy constructor based on the initial stack block_byref data structure, and will also set the (1<<26) bit in addition to the (1<<25) bit. The destroy helper will have code to do the destructor on the object stored within the supplied block_byref heap data structure. + +To support member variable and function access the compiler will synthesize a const pointer to a block version of the this pointer. + +5.0 Runtime Helper Functions + +The runtime helper functions are described in /usr/local/include/Block_private.h. To summarize their use, a block requires copy/dispose helpers if it imports any block variables, __block storage variables, __attribute__((NSObject)) variables, or C++ const copied objects with constructor/destructors. The (1<<26) bit is set and functions are generated. + +The block copy helper function should, for each of the variables of the type mentioned above, call + _Block_object_assign(&dst->target, src->target, BLOCK_FIELD_); +in the copy helper and + _Block_object_dispose(->target, BLOCK_FIELD_); +in the dispose helper where + is + +enum { + BLOCK_FIELD_IS_OBJECT = 3, // id, NSObject, __attribute__((NSObject)), block, ... + BLOCK_FIELD_IS_BLOCK = 7, // a block variable + BLOCK_FIELD_IS_BYREF = 8, // the on stack structure holding the __block variable + + BLOCK_FIELD_IS_WEAK = 16, // declared __weak + + BLOCK_BYREF_CALLER = 128, // called from byref copy/dispose helpers +}; + +and of course the CTORs/DTORs for const copied C++ objects. + +The block_byref data structure similarly requires copy/dispose helpers for block variables, __attribute__((NSObject)) variables, or C++ const copied objects with constructor/destructors, and again the (1<<26) bit is set and functions are generated in the same manner. + +Under ObjC we allow __weak as an attribute on __block variables, and this causes the addition of BLOCK_FIELD_IS_WEAK orred onto the BLOCK_FIELD_IS_BYREF flag when copying the block_byref structure in the block copy helper, and onto the BLOCK_FIELD_ field within the block_byref copy/dispose helper calls. + +The prototypes, and summary, of the helper functions are + +/* Certain field types require runtime assistance when being copied to the heap. The following function is used + to copy fields of types: blocks, pointers to byref structures, and objects (including __attribute__((NSObject)) pointers. + BLOCK_FIELD_IS_WEAK is orthogonal to the other choices which are mutually exclusive. + Only in a Block copy helper will one see BLOCK_FIELD_IS_BYREF. + */ +void _Block_object_assign(void *destAddr, const void *object, const int flags); + +/* Similarly a compiler generated dispose helper needs to call back for each field of the byref data structure. + (Currently the implementation only packs one field into the byref structure but in principle there could be more). + The same flags used in the copy helper should be used for each call generated to this function: + */ +void _Block_object_dispose(const void *object, const int flags); + +The following functions have been used and will continue to be supported until new compiler support is complete. + +// Obsolete functions. +// Copy helper callback for copying a block imported into a Block +// Called by copy_helper helper functions synthesized by the compiler. +// The address in the destination block of an imported Block is provided as the first argument +// and the value of the existing imported Block is the second. +// Use: _Block_object_assign(dest, src, BLOCK_FIELD_IS_BLOCK {| BLOCK_FIELD_IS_WEAK}); +void _Block_copy_assign(struct Block_basic **dest, const struct Block_basic *src, const int flags); + +// Destroy helper callback for releasing Blocks imported into a Block +// Called by dispose_helper helper functions synthesized by the compiler. +// The value of the imported Block variable is passed back. +// Use: _Block_object_dispose(src, BLOCK_FIELD_IS_BLOCK {| BLOCK_FIELD_IS_WEAK}); +void _Block_destroy(const struct Block_basic *src, const int flags); + +// Byref data block copy helper callback +// Called by block copy helpers when copying __block structures +// Use: _Block_object_assign(dest, src, BLOCK_FIELD_IS_BYREF {| BLOCK_FIELD_IS_WEAK}); +void _Block_byref_assign_copy(struct Block_byref **destp, struct Block_byref *src); + +// Byref data block release helper callback +// Called by block release helpers when releasing a Block +// Called at escape points in scope where __block variables live (under non-GC-only conditions) +// Use: _Block_object_dispose(src, BLOCK_FIELD_IS_BYREF {| BLOCK_FIELD_IS_WEAK}); +void §(struct Block_byref *shared_struct); + + diff --git a/docs/BlockLanguageSpec.txt b/docs/BlockLanguageSpec.txt new file mode 100644 index 0000000..a612fd2 --- /dev/null +++ b/docs/BlockLanguageSpec.txt @@ -0,0 +1,165 @@ +Language Specification for Blocks + +2008/2/25 — created +2008/7/28 — revised, __block syntax +2008/8/13 — revised, Block globals +2008/8/21 — revised, C++ elaboration +2008/11/1 — revised, __weak support +2009/1/12 — revised, explicit return types +2009/2/10 — revised, __block objects need retain + +Copyright 2008-2009 Apple, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +The Block Type + +A new derived type is introduced to C and, by extension, Objective-C, C++, and Objective-C++. Like function types, the Block type is a pair consisting of a result value type and a list of parameter types very similar to a function type. Blocks are intended to be used much like functions with the key distinction being that in addition to executable code they also contain various variable bindings to automatic (stack) or managed (heap) memory. + +The abstract declarator int (^)(char, float) describes a reference to a Block that, when invoked, takes two parameters, the first of type char and the second of type float, and returns a value of type int. The Block referenced is of opaque data that may reside in automatic (stack) memory, global memory, or heap memory. + + +Block Variable Declarations + +A variable with Block type is declared using function pointer style notation substituting ^ for *. The following are valid Block variable declarations: + void (^blockReturningVoidWithVoidArgument)(void); + int (^blockReturningIntWithIntAndCharArguments)(int, char); + void (^arrayOfTenBlocksReturningVoidWithIntArgument[10])(int); + +Variadic ... arguments are supported. [variadic.c] A Block that takes no arguments must specify void in the argument list [voidarg.c]. An empty parameter list does not represent, as K&R provide, an unspecified argument list. Note: both gcc and clang support K&R style as a convenience. + +A Block reference may be cast to a pointer of arbitrary type and vice versa. [cast.c] A Block reference may not be dereferenced via the pointer dereference operator *, and thus a Block's size may not be computed at compile time. [sizeof.c] + + +Block Literal Expressions + +A Block literal expression produces a reference to a Block. It is introduced by the use of the ^ token as a unary operator. + Block_literal_expression ::= ^ block_decl compound_statement_body + block_decl ::= + block_decl ::= parameter_list + block_decl ::= type_expression + +...where type expression is extended to allow ^ as a Block reference (pointer) where * is allowed as a function reference (pointer). + +The following Block literal: + ^ void (void) { printf("hello world\n"); } + +...produces a reference to a Block with no arguments with no return value. + +The return type is optional and is inferred from the return statements. If the return statements return a value, they all must return a value of the same type. If there is no value returned the inferred type of the Block is void; otherwise it is the type of the return statement value. + +If the return type is omitted and the argument list is ( void ), the ( void ) argument list may also be omitted. + +So: + ^ ( void ) { printf("hello world\n"); } + +...and: + ^ { printf("hello world\n"); } + +...are exactly equivalent constructs for the same expression. + +The type_expression extends C expression parsing to accommodate Block reference declarations as it accommodates function pointer declarations. + +Given: + typedef int (*pointerToFunctionThatReturnsIntWithCharArg)(char); + pointerToFunctionThatReturnsIntWithCharArg functionPointer; + + ^ pointerToFunctionThatReturnsIntWithCharArg (float x) { return functionPointer; } + +...and: + ^ int ((*)(float x))(char) { return functionPointer; } + +...are equivalent expressions, as is: + + ^(float x) { return functionPointer; } + +[returnfunctionptr.c] + +The compound statement body establishes a new lexical scope within that of its parent. Variables used within the scope of the compound statement are bound to the Block in the normal manner with the exception of those in automatic (stack) storage. Thus one may access functions and global variables as one would expect, as well as static local variables. [testme] + +Local automatic (stack) variables referenced within the compound statement of a Block are imported and captured by the Block as const copies. The capture (binding) is performed at the time of the Block literal expression evaluation. + +The lifetime of variables declared in a Block is that of a function; each activation frame contains a new copy of variables declared within the local scope of the Block. Such variable declarations should be allowed anywhere [testme] rather than only when C99 parsing is requested, including for statements. [testme] + +Block literal expressions may occur within Block literal expressions (nest) and all variables captured by any nested blocks are implicitly also captured in the scopes of their enclosing Blocks. + +A Block literal expression may be used as the initialization value for Block variables at global or local static scope. + + +The Invoke Operator + +Blocks are invoked using function call syntax with a list of expression parameters of types corresponding to the declaration and returning a result type also according to the declaration. Given: + int (^x)(char); + void (^z)(void); + int (^(*y))(char) = &x; + +...the following are all legal Block invocations: + x('a'); + (*y)('a'); + (true ? x : *y)('a') + + +The Copy and Release Operations + +The compiler and runtime provide copy and release operations for Block references that create and, in matched use, release allocated storage for referenced Blocks. + +The copy operation Block_copy() is styled as a function that takes an arbitrary Block reference and returns a Block reference of the same type. The release operation, Block_release(), is styled as a function that takes an arbitrary Block reference and, if dynamically matched to a Block copy operation, allows recovery of the referenced allocated memory. + + +The __block Storage Qualifier + +In addition to the new Block type we also introduce a new storage qualifier, __block, for local variables. [testme: a __block declaration within a block literal] The __block storage qualifier is mutually exclusive to the existing local storage qualifiers auto, register, and static.[testme] Variables qualified by __block act as if they were in allocated storage and this storage is automatically recovered after last use of said variable. An implementation may choose an optimization where the storage is initially automatic and only "moved" to allocated (heap) storage upon a Block_copy of a referencing Block. Such variables may be mutated as normal variables are. + +In the case where a __block variable is a Block one must assume that the __block variable resides in allocated storage and as such is assumed to reference a Block that is also in allocated storage (that it is the result of a Block_copy operation). Despite this there is no provision to do a Block_copy or a Block_release if an implementation provides initial automatic storage for Blocks. This is due to the inherent race condition of potentially several threads trying to update the shared variable and the need for synchronization around disposing of older values and copying new ones. Such synchronization is beyond the scope of this language specification. + + +Control Flow + +The compound statement of a Block is treated much like a function body with respect to control flow in that goto, break, and continue do not escape the Block. Exceptions are treated "normally" in that when thrown they pop stack frames until a catch clause is found. + + +Objective-C Extensions + +Objective-C extends the definition of a Block reference type to be that also of id. A variable or expression of Block type may be messaged or used as a parameter wherever an id may be. The converse is also true. Block references may thus appear as properties and are subject to the assign, retain, and copy attribute logic that is reserved for objects. + +All Blocks are constructed to be Objective-C objects regardless of whether the Objective-C runtime is operational in the program or not. Blocks using automatic (stack) memory are objects and may be messaged, although they may not be assigned into __weak locations if garbage collection is enabled. + +Within a Block literal expression within a method definition references to instance variables are also imported into the lexical scope of the compound statement. These variables are implicitly qualified as references from self, and so self is imported as a const copy. The net effect is that instance variables can be mutated. + +The Block_copy operator retains all objects held in variables of automatic storage referenced within the Block expression (or form strong references if running under garbage collection). Object variables of __block storage type are assumed to hold normal pointers with no provision for retain and release messages. + +Foundation defines (and supplies) -copy and -release methods for Blocks. + +In the Objective-C and Objective-C++ languages, we allow the __weak specifier for __block variables of object type. If garbage collection is not enabled, this qualifier causes these variables to be kept without retain messages being sent. This knowingly leads to dangling pointers if the Block (or a copy) outlives the lifetime of this object. + +In garbage collected environments, the __weak variable is set to nil when the object it references is collected, as long as the __block variable resides in the heap (either by default or via Block_copy()). The initial Apple implementation does in fact start __block variables on the stack and migrate them to the heap only as a result of a Block_copy() operation. + +It is a runtime error to attempt to assign a reference to a stack-based Block into any storage marked __weak, including __weak __block variables. + + +C++ Extensions + +Block literal expressions within functions are extended to allow const use of C++ objects, pointers, or references held in automatic storage. + +For example, given class Foo with member function fighter(void): + Foo foo; + Foo &fooRef = foo; + Foo *fooPtr = &foo; + +...a Block that used foo would import the variables as const variations: + const Foo block_foo = foo; // const copy constructor + const Foo &block_fooRef = fooRef; + const Foo *block_fooPtr = fooPtr; + +Stack-local objects are copied into a Block via a copy const constructor. If no such constructor exists, it is considered an error to reference such objects from within the Block compound statements. A destructor is run as control leaves the compound statement that contains the Block literal expression. + +If a Block originates on the stack, a const copy constructor of the stack-based Block const copy is performed when a Block_copy operation is called; when the last Block_release (or subsequently GC) occurs, a destructor is run on the heap copy. + +Variables declared as residing in __block storage may be initially allocated in the heap or may first appear on the stack and be copied to the heap as a result of a Block_copy() operation. When copied from the stack, a normal copy constructor is used to initialize the heap-based version from the original stack version. The destructor for a const copied object is run at the normal end of scope. The destructor for any initial stack based version is also called at normal end of scope. + +Within a member function, access to member functions and variables is done via an implicit const copy of a this pointer. + +Member variables that are Blocks may not be overloaded by the types of their arguments. + diff --git a/docs/DriverArchitecture.png b/docs/DriverArchitecture.png new file mode 100644 index 0000000..056a70a Binary files /dev/null and b/docs/DriverArchitecture.png differ diff --git a/docs/DriverInternals.html b/docs/DriverInternals.html new file mode 100644 index 0000000..a99d72c --- /dev/null +++ b/docs/DriverInternals.html @@ -0,0 +1,517 @@ + + + Clang Driver Manual + + + + + + + + +
+ +

Driver Design & Internals

+ + + + + +

Introduction

+ + +

This document describes the Clang driver. The purpose of this + document is to describe both the motivation and design goals + for the driver, as well as details of the internal + implementation.

+ + +

Features and Goals

+ + +

The Clang driver is intended to be a production quality + compiler driver providing access to the Clang compiler and + tools, with a command line interface which is compatible with + the gcc driver.

+ +

Although the driver is part of and driven by the Clang + project, it is logically a separate tool which shares many of + the same goals as Clang:

+ +

Features:

+ + + +

GCC Compatibility

+ + +

The number one goal of the driver is to ease the adoption of + Clang by allowing users to drop Clang into a build system + which was designed to call GCC. Although this makes the driver + much more complicated than might otherwise be necessary, we + decided that being very compatible with the gcc command line + interface was worth it in order to allow users to quickly test + clang on their projects.

+ + +

Flexible

+ + +

The driver was designed to be flexible and easily accomodate + new uses as we grow the clang and LLVM infrastructure. As one + example, the driver can easily support the introduction of + tools which have an integrated assembler; something we hope to + add to LLVM in the future.

+ +

Similarly, most of the driver functionality is kept in a + library which can be used to build other tools which want to + implement or accept a gcc like interface.

+ + +

Low Overhead

+ + +

The driver should have as little overhead as possible. In + practice, we found that the gcc driver by itself incurred a + small but meaningful overhead when compiling many small + files. The driver doesn't do much work compared to a + compilation, but we have tried to keep it as efficient as + possible by following a few simple principles:

+
    +
  • Avoid memory allocation and string copying when + possible.
  • + +
  • Don't parse arguments more than once.
  • + +
  • Provide a few simple interfaces for efficiently searching + arguments.
  • +
+ + +

Simple

+ + +

Finally, the driver was designed to be "as simple as + possible", given the other goals. Notably, trying to be + completely compatible with the gcc driver adds a significant + amount of complexity. However, the design of the driver + attempts to mitigate this complexity by dividing the process + into a number of independent stages instead of a single + monolithic task.

+ + +

Internal Design and Implementation

+ + + + + +

Internals Introduction

+ + +

In order to satisfy the stated goals, the driver was designed + to completely subsume the functionality of the gcc executable; + that is, the driver should not need to delegate to gcc to + perform subtasks. On Darwin, this implies that the Clang + driver also subsumes the gcc driver-driver, which is used to + implement support for building universal images (binaries and + object files). This also implies that the driver should be + able to call the language specific compilers (e.g. cc1) + directly, which means that it must have enough information to + forward command line arguments to child processes + correctly.

+ + +

Design Overview

+ + +

The diagram below shows the significant components of the + driver architecture and how they relate to one another. The + orange components represent concrete data structures built by + the driver, the green components indicate conceptually + distinct stages which manipulate these data structures, and + the blue components are important helper classes.

+ +
+ + + +
+ + +

Driver Stages

+ + +

The driver functionality is conceptually divided into five stages:

+ +
    +
  1. + Parse: Option Parsing + +

    The command line argument strings are decomposed into + arguments (Arg instances). The driver expects to + understand all available options, although there is some + facility for just passing certain classes of options + through (like -Wl,).

    + +

    Each argument corresponds to exactly one + abstract Option definition, which describes how + the option is parsed along with some additional + metadata. The Arg instances themselves are lightweight and + merely contain enough information for clients to determine + which option they correspond to and their values (if they + have additional parameters).

    + +

    For example, a command line like "-Ifoo -I foo" would + parse to two Arg instances (a JoinedArg and a SeparateArg + instance), but each would refer to the same Option.

    + +

    Options are lazily created in order to avoid populating + all Option classes when the driver is loaded. Most of the + driver code only needs to deal with options by their + unique ID (e.g., options::OPT_I),

    + +

    Arg instances themselves do not generally store the + values of parameters. In many cases, this would + simply result in creating unnecessary string + copies. Instead, Arg instances are always embedded inside + an ArgList structure, which contains the original vector + of argument strings. Each Arg itself only needs to contain + an index into this vector instead of storing its values + directly.

    + +

    The clang driver can dump the results of this + stage using the -ccc-print-options flag (which + must preceed any actual command line arguments). For + example:

    +
    +            $ clang -ccc-print-options -Xarch_i386 -fomit-frame-pointer -Wa,-fast -Ifoo -I foo t.c
    +            Option 0 - Name: "-Xarch_", Values: {"i386", "-fomit-frame-pointer"}
    +            Option 1 - Name: "-Wa,", Values: {"-fast"}
    +            Option 2 - Name: "-I", Values: {"foo"}
    +            Option 3 - Name: "-I", Values: {"foo"}
    +            Option 4 - Name: "<input>", Values: {"t.c"}
    +          
    + +

    After this stage is complete the command line should be + broken down into well defined option objects with their + appropriate parameters. Subsequent stages should rarely, + if ever, need to do any string processing.

    +
  2. + +
  3. + Pipeline: Compilation Job Construction + +

    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 + 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 + one or more top-level actions, each of which generally + corresponds to a single output (for example, an object or + linked executable).

    + +

    The majority of Actions correspond to actual tasks, + however there are two special Actions. The first is + InputAction, which simply serves to adapt an input + argument for use as an input to other Actions. The second + is BindArchAction, which conceptually alters the + architecture to be used for all of its input Actions.

    + +

    The clang driver can dump the results of this + stage using the -ccc-print-phases flag. For + example:

    +
    +            $ clang -ccc-print-phases -x c t.c -x assembler t.s
    +            0: input, "t.c", c
    +            1: preprocessor, {0}, cpp-output
    +            2: compiler, {1}, assembler
    +            3: assembler, {2}, object
    +            4: input, "t.s", assembler
    +            5: assembler, {4}, object
    +            6: linker, {3, 5}, image
    +          
    +

    Here the driver is constructing seven distinct actions, + four to compile the "t.c" input into an object file, two to + assemble the "t.s" input, and one to link them together.

    + +

    A rather different compilation pipeline is shown here; in + this example there are two top level actions to compile + the input files into two separate object files, where each + object file is built using lipo to merge results + built for two separate architectures.

    +
    +            $ clang -ccc-print-phases -c -arch i386 -arch x86_64 t0.c t1.c
    +            0: input, "t0.c", c
    +            1: preprocessor, {0}, cpp-output
    +            2: compiler, {1}, assembler
    +            3: assembler, {2}, object
    +            4: bind-arch, "i386", {3}, object
    +            5: bind-arch, "x86_64", {3}, object
    +            6: lipo, {4, 5}, object
    +            7: input, "t1.c", c
    +            8: preprocessor, {7}, cpp-output
    +            9: compiler, {8}, assembler
    +            10: assembler, {9}, object
    +            11: bind-arch, "i386", {10}, object
    +            12: bind-arch, "x86_64", {10}, object
    +            13: lipo, {11, 12}, object
    +          
    + +

    After this stage is complete the compilation process is + divided into a simple set of actions which need to be + performed to produce intermediate or final outputs (in + some cases, like -fsyntax-only, there is no + "real" final output). Phases are well known compilation + steps, such as "preprocess", "compile", "assemble", + "link", etc.

    +
  4. + +
  5. + Bind: Tool & Filename Selection + +

    This stage (in conjunction with the Translate stage) + turns the tree of Actions into a list of actual subprocess + 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 + to see if it can match additional actions (for example, by + having an integrated preprocessor). + +

    Once Tools have been selected for all actions, the driver + determines how the tools should be connected (for example, + using an inprocess module, pipes, temporary files, or user + provided filenames). If an output file is required, the + driver also computes the appropriate file name (the suffix + and file location depend on the input types and options + such as -save-temps). + +

    The driver interacts with a ToolChain to perform the Tool + bindings. Each ToolChain contains information about all + the tools needed for compilation for a particular + architecture, platform, and operating system. A single + driver invocation may query multiple ToolChains during one + compilation in order to interact with tools for separate + architectures.

    + +

    The results of this stage are not computed directly, but + the driver can print the results via + the -ccc-print-bindings option. For example:

    +
    +            $ clang -ccc-print-bindings -arch i386 -arch ppc t0.c
    +            # "i386-apple-darwin9" - "clang", inputs: ["t0.c"], output: "/tmp/cc-Sn4RKF.s"
    +            # "i386-apple-darwin9" - "darwin::Assemble", inputs: ["/tmp/cc-Sn4RKF.s"], output: "/tmp/cc-gvSnbS.o"
    +            # "i386-apple-darwin9" - "darwin::Link", inputs: ["/tmp/cc-gvSnbS.o"], output: "/tmp/cc-jgHQxi.out"
    +            # "ppc-apple-darwin9" - "gcc::Compile", inputs: ["t0.c"], output: "/tmp/cc-Q0bTox.s"
    +            # "ppc-apple-darwin9" - "gcc::Assemble", inputs: ["/tmp/cc-Q0bTox.s"], output: "/tmp/cc-WCdicw.o"
    +            # "ppc-apple-darwin9" - "gcc::Link", inputs: ["/tmp/cc-WCdicw.o"], output: "/tmp/cc-HHBEBh.out"
    +            # "i386-apple-darwin9" - "darwin::Lipo", inputs: ["/tmp/cc-jgHQxi.out", "/tmp/cc-HHBEBh.out"], output: "a.out"
    +          
    + +

    This shows the tool chain, tool, inputs and outputs which + have been bound for this compilation sequence. Here clang + is being used to compile t0.c on the i386 architecture and + darwin specific versions of the tools are being used to + assemble and link the result, but generic gcc versions of + the tools are being used on PowerPC.

    +
  6. + +
  7. + Translate: Tool Specific Argument Translation + +

    Once a Tool has been selected to perform a particular + Action, the Tool must construct concrete Jobs which will be + executed during compilation. The main work is in translating + from the gcc style command line options to whatever options + the subprocess expects.

    + +

    Some tools, such as the assembler, only interact with a + handful of arguments and just determine the path of the + executable to call and pass on their input and output + arguments. Others, like the compiler or the linker, may + translate a large number of arguments in addition.

    + +

    The ArgList class provides a number of simple helper + methods to assist with translating arguments; for example, + to pass on only the last of arguments corresponding to some + option, or all arguments for an option.

    + +

    The result of this stage is a list of Jobs (executable + paths and argument strings) to execute.

    +
  8. + +
  9. + Execute +

    Finally, the compilation pipeline is executed. This is + mostly straightforward, although there is some interaction + with options + like -pipe, -pass-exit-codes + and -time.

    +
  10. + +
+ + +

Additional Notes

+ + +

The Compilation Object

+ +

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 + able to construct a single long lived driver instance to use + for an entire build, for example.

+ +

The Compilation object holds information that is particular + to each compilation sequence. For example, the list of used + temporary files (which must be removed once compilation is + finished) and result files (which should be removed if + compilation files).

+ +

Unified Parsing & Pipelining

+ +

Parsing and pipeling 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 + driver.

+ +

ToolChain Argument Translation

+ +

In order to match gcc very closely, the clang driver + currently allows tool chains to perform their own translation of + the argument list (into a new ArgList data structure). Although + this allows the clang driver to match gcc easily, it also makes + the driver operation much harder to understand (since the Tools + stop seeing some arguments the user provided, and see new ones + instead).

+ +

For example, on Darwin -gfull gets translated into + two separate arguments, -g + and -fno-eliminate-unused-debug-symbols. Trying to + write Tool logic to do something with -gfull will not + work, because at Tools run after the arguments have been + translated.

+ +

A long term goal is to remove this tool chain specific + translation, and instead force each tool to change its own logic + to do the right thing on the untranslated original arguments.

+ +

Unused Argument Warnings

+

The driver operates by parsing all arguments but giving Tools + the opportunity to choose which arguments to pass on. One + downside of this infrastructure is that if the user misspells + some option, or is confused about which options to use, some + command line arguments the user really cared about may go + unused. This problem is particularly important when using + clang as a compiler, since the clang compiler does not support + anywhere near all the options that gcc does, and we want to make + sure users know which ones are being used.

+ +

To support this, the driver maintains a bit associated with + each argument of whether it has been used (at all) during the + compilation. This bit usually doesn't need to be set by hand, + as the key ArgList accessors will set it automatically.

+ +

When a compilation is successful (there are no errors), the + driver checks the bit and emits an "unused argument" warning for + any arguments which were never accessed. This is conservative + (the argument may not have been used to do what the user wanted) + but still catches the most obvious cases.

+ + +

Relation to GCC Driver Concepts

+ + +

For those familiar with the gcc driver, this section provides + a brief overview of how things from the gcc driver map to the + clang driver.

+ +
    +
  • + Driver Driver +

    The driver driver is fully integrated into the clang + driver. The driver simply constructs additional Actions to + bind the architecture during the Pipeline + phase. The tool chain specific argument translation is + responsible for handling -Xarch_.

    + +

    The one caveat is that this approach + requires -Xarch_ not be used to alter the + compilation itself (for example, one cannot + provide -S as an -Xarch_ argument). The + driver attempts to reject such invocations, and overall + there isn't a good reason to abuse -Xarch_ to + that end in practice.

    + +

    The upside is that the clang driver is more efficient and + does little extra work to support universal builds. It also + provides better error reporting and UI consistency.

    +
  • + +
  • + Specs +

    The clang driver has no direct correspondant for + "specs". The majority of the functionality that is + embedded in specs is in the Tool specific argument + translation routines. The parts of specs which control the + compilation pipeline are generally part of + the Pipeline stage.

    +
  • + +
  • + Toolchains +

    The gcc driver has no direct understanding of tool + chains. Each gcc binary roughly corresponds to the + information which is embedded inside a single + ToolChain.

    + +

    The clang driver is intended to be portable and support + complex compilation environments. All platform and tool + chain specific code should be protected behind either + abstract or well defined interfaces (such as whether the + platform supports use as a driver driver).

    +
  • +
+
+ + diff --git a/docs/InternalsManual.html b/docs/InternalsManual.html new file mode 100644 index 0000000..a4d5a05 --- /dev/null +++ b/docs/InternalsManual.html @@ -0,0 +1,1676 @@ + + +"Clang" CFE Internals Manual + + + + + + + + +
+ +

"Clang" CFE Internals Manual

+ + + + + +

Introduction

+ + +

This document describes some of the more important APIs and internal design +decisions made in the Clang C front-end. The purpose of this document is to +both capture some of this high level information and also describe some of the +design decisions behind it. This is meant for people interested in hacking on +Clang, not for end-users. The description below is categorized by +libraries, and does not describe any of the clients of the libraries.

+ + +

LLVM System and Support Libraries

+ + +

The LLVM libsystem library provides the basic Clang system abstraction layer, +which is used for file system access. The LLVM libsupport library provides many +underlying libraries and data-structures, + including command line option +processing and various containers.

+ + +

The Clang 'Basic' Library

+ + +

This library certainly needs a better name. The 'basic' library contains a +number of low-level utilities for tracking and manipulating source buffers, +locations within the source buffers, diagnostics, tokens, target abstraction, +and information about the subset of the language being compiled for.

+ +

Part of this infrastructure is specific to C (such as the TargetInfo class), +other parts could be reused for other non-C-based languages (SourceLocation, +SourceManager, Diagnostics, FileManager). When and if there is future demand +we can figure out if it makes sense to introduce a new library, move the general +classes somewhere else, or introduce some other solution.

+ +

We describe the roles of these classes in order of their dependencies.

+ + + +

The Diagnostics Subsystem

+ + +

The Clang Diagnostics subsystem is an important part of how the compiler +communicates with the human. Diagnostics are the warnings and errors produced +when the code is incorrect or dubious. In Clang, each diagnostic produced has +(at the minimum) a unique ID, a SourceLocation to +"put the caret", an English translation associated with it, and a severity (e.g. +WARNING or ERROR). They can also optionally include a number +of arguments to the dianostic (which fill in "%0"'s in the string) as well as a +number of source ranges that related to the diagnostic.

+ +

In this section, we'll be giving examples produced by the Clang command line +driver, but diagnostics can be rendered in many +different ways depending on how the DiagnosticClient interface is +implemented. A representative example of a diagonstic is:

+ +
+t.c:38:15: error: invalid operands to binary expression ('int *' and '_Complex float')
+   P = (P-42) + Gamma*4;
+       ~~~~~~ ^ ~~~~~~~
+
+ +

In this example, you can see the English translation, the severity (error), +you can see the source location (the caret ("^") and file/line/column info), +the source ranges "~~~~", arguments to the diagnostic ("int*" and "_Complex +float"). You'll have to believe me that there is a unique ID backing the +diagnostic :).

+ +

Getting all of this to happen has several steps and involves many moving +pieces, this section describes them and talks about best practices when adding +a new diagnostic.

+ + +

The DiagnosticKinds.def file

+ + +

Diagnostics are created by adding an entry to the DiagnosticKinds.def file. This file encodes the unique ID of the +diagnostic (as an enum, the first argument), the severity of the diagnostic +(second argument) and the English translation + format string.

+ +

There is little sanity with the naming of the unique ID's right now. Some +start with err_, warn_, ext_ to encode the severity into the name. Since the +enum is referenced in the C++ code that produces the diagnostic, it is somewhat +useful for it to be reasonably short.

+ +

The severity of the diagnostic comes from the set {NOTE, +WARNING, EXTENSION, EXTWARN, ERROR}. The +ERROR severity is used for diagnostics indicating the program is never +acceptable under any circumstances. When an error is emitted, the AST for the +input code may not be fully built. The EXTENSION and EXTWARN +severities are used for extensions to the language that Clang accepts. This +means that Clang fully understands and can represent them in the AST, but we +produce diagnostics to tell the user their code is non-portable. The difference +is that the former are ignored by default, and the later warn by default. The +WARNING severity is used for constructs that are valid in the currently +selected source language but that are dubious in some way. The NOTE +level is used to staple more information onto previous diagnostics.

+ +

These severities are mapped into a smaller set (the +Diagnostic::Level enum, {Ignored, Note, Warning, +Error, Fatal }) of output levels by the diagnostics +subsystem based on various configuration options. Clang internally supports a +fully fine grained mapping mechanism that allows you to map almost any +diagnostic to the output level that you want. The only diagnostics that cannot +be mapped are NOTEs, which always follow the severity of the previously +emitted diagnostic and ERRORs, which can only be mapped to +Fatal (it is not possible to turn an error into a warning, +for example).

+ +

Diagnostic mappings are used in many ways. For example, if the user +specifies -pedantic, EXTENSION maps to Warning, if +they specify -pedantic-errors, it turns into Error. This is +used to implement options like -Wunused_macros, -Wundef etc. +

+ +

+Mapping to Fatal should only be used for diagnostics that are +considered so severe that error recovery won't be able to recover sensibly from +them (thus spewing a ton of bogus errors). One example of this class of error +are failure to #include a file. +

+ + +

The Format String

+ + +

The format string for the diagnostic is very simple, but it has some power. +It takes the form of a string in English with markers that indicate where and +how arguments to the diagnostic are inserted and formatted. For example, here +are some simple format strings:

+ +
+  "binary integer literals are an extension"
+  "format string contains '\\0' within the string body"
+  "more '%%' conversions than data arguments"
+  "invalid operands to binary expression (%0 and %1)"
+  "overloaded '%0' must be a %select{unary|binary|unary or binary}2 operator"
+       " (has %1 parameter%s1)"
+
+ +

These examples show some important points of format strings. You can use any + plain ASCII character in the diagnostic string except "%" without a problem, + but these are C strings, so you have to use and be aware of all the C escape + sequences (as in the second example). If you want to produce a "%" in the + output, use the "%%" escape sequence, like the third diagnostic. Finally, + Clang uses the "%...[digit]" sequences to specify where and how arguments to + the diagnostic are formatted.

+ +

Arguments to the diagnostic are numbered according to how they are specified + by the C++ code that produces them, and are + referenced by %0 .. %9. If you have more than 10 arguments + to your diagnostic, you are doing something wrong :). Unlike printf, there + is no requirement that arguments to the diagnostic end up in the output in + the same order as they are specified, you could have a format string with + "%1 %0" that swaps them, for example. The text in between the + percent and digit are formatting instructions. If there are no instructions, + the argument is just turned into a string and substituted in.

+ +

Here are some "best practices" for writing the English format string:

+ +
    +
  • Keep the string short. It should ideally fit in the 80 column limit of the + DiagnosticKinds.def file. This avoids the diagnostic wrapping when + printed, and forces you to think about the important point you are conveying + with the diagnostic.
  • +
  • Take advantage of location information. The user will be able to see the + line and location of the caret, so you don't need to tell them that the + problem is with the 4th argument to the function: just point to it.
  • +
  • Do not capitalize the diagnostic string, and do not end it with a + period.
  • +
  • If you need to quote something in the diagnostic string, use single + quotes.
  • +
+ +

Diagnostics should never take random English strings as arguments: you +shouldn't use "you have a problem with %0" and pass in things like +"your argument" or "your return value" as arguments. Doing +this prevents translating the Clang diagnostics to +other languages (because they'll get random English words in their otherwise +localized diagnostic). The exceptions to this are C/C++ language keywords +(e.g. auto, const, mutable, etc) and C/C++ operators (/=). Note +that things like "pointer" and "reference" are not keywords. On the other +hand, you can include anything that comes from the user's source code, +including variable names, types, labels, etc. The 'select' format can be +used to achieve this sort of thing in a localizable way, see below.

+ + +

Formatting a Diagnostic Argument

+ + +

Arguments to diagnostics are fully typed internally, and come from a couple +different classes: integers, types, names, and random strings. Depending on +the class of the argument, it can be optionally formatted in different ways. +This gives the DiagnosticClient information about what the argument means +without requiring it to use a specific presentation (consider this MVC for +Clang :).

+ +

Here are the different diagnostic argument formats currently supported by +Clang:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
"s" format
Example:"requires %1 parameter%s1"
Class:Integers
Description:This is a simple formatter for integers that is + useful when producing English diagnostics. When the integer is 1, it prints + as nothing. When the integer is not 1, it prints as "s". This allows some + simple grammatical forms to be to be handled correctly, and eliminates the + need to use gross things like "requires %1 parameter(s)".
"select" format
Example:"must be a %select{unary|binary|unary or binary}2 + operator"
Class:Integers
Description:This format specifier is used to merge multiple + related diagnostics together into one common one, without requiring the + difference to be specified as an English string argument. Instead of + specifying the string, the diagnostic gets an integer argument and the + format string selects the numbered option. In this case, the "%2" value + must be an integer in the range [0..2]. If it is 0, it prints 'unary', if + it is 1 it prints 'binary' if it is 2, it prints 'unary or binary'. This + allows other language translations to substitute reasonable words (or entire + phrases) based on the semantics of the diagnostic instead of having to do + things textually.
"plural" format
Example:"you have %1 %plural{1:mouse|:mice}1 connected to + your computer"
Class:Integers
Description:

This is a formatter for complex plural forms. + It is designed to handle even the requirements of languages with very + complex plural forms, as many Baltic languages have. The argument consists + of a series of expression/form pairs, separated by ':', where the first form + whose expression evaluates to true is the result of the modifier.

+

An expression can be empty, in which case it is always true. See the + example at the top. Otherwise, it is a series of one or more numeric + conditions, separated by ','. If any condition matches, the expression + matches. Each numeric condition can take one of three forms.

+
    +
  • number: A simple decimal number matches if the argument is the same + as the number. Example: "%plural{1:mouse|:mice}4"
  • +
  • range: A range in square brackets matches if the argument is within + the range. Then range is inclusive on both ends. Example: + "%plural{0:none|1:one|[2,5]:some|:many}2"
  • +
  • modulo: A modulo operator is followed by a number, and + equals sign and either a number or a range. The tests are the + same as for plain + numbers and ranges, but the argument is taken modulo the number first. + Example: "%plural{%100=0:even hundred|%100=[1,50]:lower half|:everything + else}1"
  • +
+

The parser is very unforgiving. A syntax error, even whitespace, will + abort, as will a failure to match the argument against any + expression.

"objcclass" format
Example:"method %objcclass0 not found"
Class:DeclarationName
Description:

This is a simple formatter that indicates the + DeclarationName corresponds to an Objective-C class method selector. As + such, it prints the selector with a leading '+'.

"objcinstance" format
Example:"method %objcinstance0 not found"
Class:DeclarationName
Description:

This is a simple formatter that indicates the + DeclarationName corresponds to an Objective-C instance method selector. As + such, it prints the selector with a leading '-'.

"q" format
Example:"candidate found by name lookup is %q0"
Class:NamedDecl*
Description

This formatter indicates that the fully-qualified name of the declaration should be printed, e.g., "std::vector" rather than "vector".

+ +

It is really easy to add format specifiers to the Clang diagnostics system, +but they should be discussed before they are added. If you are creating a lot +of repetitive diagnostics and/or have an idea for a useful formatter, please +bring it up on the cfe-dev mailing list.

+ + +

Producing the Diagnostic

+ + +

Now that you've created the diagnostic in the DiagnosticKinds.def file, you +need to write the code that detects the condition in question and emits the +new diagnostic. Various components of Clang (e.g. the preprocessor, Sema, +etc) provide a helper function named "Diag". It creates a diagnostic and +accepts the arguments, ranges, and other information that goes along with +it.

+ +

For example, the binary expression error comes from code like this:

+ +
+  if (various things that are bad)
+    Diag(Loc, diag::err_typecheck_invalid_operands)
+      << lex->getType() << rex->getType()
+      << lex->getSourceRange() << rex->getSourceRange();
+
+ +

This shows that use of the Diag method: they take a location (a SourceLocation object) and a diagnostic enum value +(which matches the name from DiagnosticKinds.def). If the diagnostic takes +arguments, they are specified with the << operator: the first argument +becomes %0, the second becomes %1, etc. The diagnostic interface allows you to +specify arguments of many different types, including int and +unsigned for integer arguments, const char* and +std::string for string arguments, DeclarationName and +const IdentifierInfo* for names, QualType for types, etc. +SourceRanges are also specified with the << operator, but do not have a +specific ordering requirement.

+ +

As you can see, adding and producing a diagnostic is pretty straightforward. +The hard part is deciding exactly what you need to say to help the user, picking +a suitable wording, and providing the information needed to format it correctly. +The good news is that the call site that issues a diagnostic should be +completely independent of how the diagnostic is formatted and in what language +it is rendered. +

+ + +

Code Modification Hints

+ + +

In some cases, the front end emits diagnostics when it is clear +that some small change to the source code would fix the problem. For +example, a missing semicolon at the end of a statement or a use of +deprecated syntax that is easily rewritten into a more modern form. +Clang tries very hard to emit the diagnostic and recover gracefully +in these and other cases.

+ +

However, for these cases where the fix is obvious, the diagnostic +can be annotated with a code +modification "hint" that describes how to change the code referenced +by the diagnostic to fix the problem. For example, it might add the +missing semicolon at the end of the statement or rewrite the use of a +deprecated construct into something more palatable. Here is one such +example C++ front end, where we warn about the right-shift operator +changing meaning from C++98 to C++0x:

+ +
+test.cpp:3:7: warning: use of right-shift operator ('>>') in template argument will require parentheses in C++0x
+A<100 >> 2> *a;
+      ^
+  (       )
+
+ +

Here, the code modification hint is suggesting that parentheses be +added, and showing exactly where those parentheses would be inserted +into the source code. The code modification hints themselves describe +what changes to make to the source code in an abstract manner, which +the text diagnostic printer renders as a line of "insertions" below +the caret line. Other diagnostic +clients might choose to render the code differently (e.g., as +markup inline) or even give the user the ability to automatically fix +the problem.

+ +

All code modification hints are described by the +CodeModificationHint class, instances of which should be +attached to the diagnostic using the << operator in the same way +that highlighted source ranges and arguments are passed to the +diagnostic. Code modification hints can be created with one of three +constructors:

+ +
+
CodeModificationHint::CreateInsertion(Loc, Code)
+
Specifies that the given Code (a string) should be inserted + before the source location Loc.
+ +
CodeModificationHint::CreateRemoval(Range)
+
Specifies that the code in the given source Range + should be removed.
+ +
CodeModificationHint::CreateReplacement(Range, Code)
+
Specifies that the code in the given source Range + should be removed, and replaced with the given Code string.
+
+ + +

The DiagnosticClient Interface

+ + +

Once code generates a diagnostic with all of the arguments and the rest of +the relevant information, Clang needs to know what to do with it. As previously +mentioned, the diagnostic machinery goes through some filtering to map a +severity onto a diagnostic level, then (assuming the diagnostic is not mapped to +"Ignore") it invokes an object that implements the DiagnosticClient +interface with the information.

+ +

It is possible to implement this interface in many different ways. For +example, the normal Clang DiagnosticClient (named 'TextDiagnosticPrinter') turns +the arguments into strings (according to the various formatting rules), prints +out the file/line/column information and the string, then prints out the line of +code, the source ranges, and the caret. However, this behavior isn't required. +

+ +

Another implementation of the DiagnosticClient interface is the +'TextDiagnosticBuffer' class, which is used when Clang is in -verify mode. +Instead of formatting and printing out the diagnostics, this implementation just +captures and remembers the diagnostics as they fly by. Then -verify compares +the list of produced diagnostics to the list of expected ones. If they disagree, +it prints out its own output. +

+ +

There are many other possible implementations of this interface, and this is +why we prefer diagnostics to pass down rich structured information in arguments. +For example, an HTML output might want declaration names be linkified to where +they come from in the source. Another example is that a GUI might let you click +on typedefs to expand them. This application would want to pass significantly +more information about types through to the GUI than a simple flat string. The +interface allows this to happen.

+ + +

Adding Translations to Clang

+ + +

Not possible yet! Diagnostic strings should be written in UTF-8, the client +can translate to the relevant code page if needed. Each translation completely +replaces the format string for the diagnostic.

+ + + +

The SourceLocation and SourceManager classes

+ + +

Strangely enough, the SourceLocation class represents a location within the +source code of the program. Important design points include:

+ +
    +
  1. sizeof(SourceLocation) must be extremely small, as these are embedded into + many AST nodes and are passed around often. Currently it is 32 bits.
  2. +
  3. SourceLocation must be a simple value object that can be efficiently + copied.
  4. +
  5. We should be able to represent a source location for any byte of any input + file. This includes in the middle of tokens, in whitespace, in trigraphs, + etc.
  6. +
  7. A SourceLocation must encode the current #include stack that was active when + the location was processed. For example, if the location corresponds to a + token, it should contain the set of #includes active when the token was + lexed. This allows us to print the #include stack for a diagnostic.
  8. +
  9. SourceLocation must be able to describe macro expansions, capturing both + the ultimate instantiation point and the source of the original character + data.
  10. +
+ +

In practice, the SourceLocation works together with the SourceManager class +to encode two pieces of information about a location: it's spelling location +and it's instantiation location. For most tokens, these will be the same. However, +for a macro expansion (or tokens that came from a _Pragma directive) these will +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).

+ +

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.

+ +

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 +Clang depends on being able to find the original input characters for the token. +This concept maps directly to the "spelling location" for the token.

+ + +

The Driver Library

+ + +

The clang Driver and library are documented here.

+ + +

Precompiled Headers

+ + +

Clang supports two implementations of precompiled headers. The + default implementation, precompiled headers (PCH) uses a serialized representation + of Clang's internal data structures, encoded with the LLVM bitstream + format. Pretokenized headers (PTH), on the other hand, contain a + serialized representation of the tokens encountered when + preprocessing a header (and anything that header includes).

+ + + +

The Frontend Library

+ + +

The Frontend library contains functionality useful for building +tools on top of the clang libraries, for example several methods for +outputting diagnostics.

+ + +

The Lexer and Preprocessor Library

+ + +

The Lexer library contains several tightly-connected classes that are involved +with the nasty process of lexing and preprocessing C source code. The main +interface to this library for outside clients is the large Preprocessor class. +It contains the various pieces of state that are required to coherently read +tokens out of a translation unit.

+ +

The core interface to the Preprocessor object (once it is set up) is the +Preprocessor::Lex method, which returns the next Token from +the preprocessor stream. There are two types of token providers that the +preprocessor is capable of reading from: a buffer lexer (provided by the Lexer class) and a buffered token stream (provided by the TokenLexer class). + + + +

The Token class

+ + +

The Token class is used to represent a single lexed token. Tokens are +intended to be used by the lexer/preprocess and parser libraries, but are not +intended to live beyond them (for example, they should not live in the ASTs).

+ +

Tokens most often live on the stack (or some other location that is efficient +to access) as the parser is running, but occasionally do get buffered up. For +example, macro definitions are stored as a series of tokens, and the C++ +front-end periodically needs to buffer tokens up for tentative parsing and +various pieces of look-ahead. As such, the size of a Token matter. On a 32-bit +system, sizeof(Token) is currently 16 bytes.

+ +

Tokens occur in two forms: "Annotation +Tokens" and normal tokens. Normal tokens are those returned by the lexer, +annotation tokens represent semantic information and are produced by the parser, +replacing normal tokens in the token stream. Normal tokens contain the +following information:

+ +
    +
  • A SourceLocation - This indicates the location of the start of the +token.
  • + +
  • A length - This stores the length of the token as stored in the +SourceBuffer. For tokens that include them, this length includes trigraphs and +escaped newlines which are ignored by later phases of the compiler. By pointing +into the original source buffer, it is always possible to get the original +spelling of a token completely accurately.
  • + +
  • IdentifierInfo - If a token takes the form of an identifier, and if +identifier lookup was enabled when the token was lexed (e.g. the lexer was not +reading in 'raw' mode) this contains a pointer to the unique hash value for the +identifier. Because the lookup happens before keyword identification, this +field is set even for language keywords like 'for'.
  • + +
  • TokenKind - This indicates the kind of token as classified by the +lexer. This includes things like tok::starequal (for the "*=" +operator), tok::ampamp for the "&&" token, and keyword values +(e.g. tok::kw_for) for identifiers that correspond to keywords. Note +that some tokens can be spelled multiple ways. For example, C++ supports +"operator keywords", where things like "and" are treated exactly like the +"&&" operator. In these cases, the kind value is set to +tok::ampamp, which is good for the parser, which doesn't have to +consider both forms. For something that cares about which form is used (e.g. +the preprocessor 'stringize' operator) the spelling indicates the original +form.
  • + +
  • Flags - There are currently four flags tracked by the +lexer/preprocessor system on a per-token basis: + +
      +
    1. StartOfLine - This was the first token that occurred on its input + source line.
    2. +
    3. LeadingSpace - There was a space character either immediately + before the token or transitively before the token as it was expanded + through a macro. The definition of this flag is very closely defined by + the stringizing requirements of the preprocessor.
    4. +
    5. DisableExpand - This flag is used internally to the preprocessor to + represent identifier tokens which have macro expansion disabled. This + prevents them from being considered as candidates for macro expansion ever + in the future.
    6. +
    7. NeedsCleaning - This flag is set if the original spelling for the + token includes a trigraph or escaped newline. Since this is uncommon, + many pieces of code can fast-path on tokens that did not need cleaning. +

      +
    +
  • +
+ +

One interesting (and somewhat unusual) aspect of normal tokens is that they +don't contain any semantic information about the lexed value. For example, if +the token was a pp-number token, we do not represent the value of the number +that was lexed (this is left for later pieces of code to decide). Additionally, +the lexer library has no notion of typedef names vs variable names: both are +returned as identifiers, and the parser is left to decide whether a specific +identifier is a typedef or a variable (tracking this requires scope information +among other things). The parser can do this translation by replacing tokens +returned by the preprocessor with "Annotation Tokens".

+ + +

Annotation Tokens

+ + +

Annotation Tokens are tokens that are synthesized by the parser and injected +into the preprocessor's token stream (replacing existing tokens) to record +semantic information found by the parser. For example, if "foo" is found to be +a typedef, the "foo" tok::identifier token is replaced with an +tok::annot_typename. This is useful for a couple of reasons: 1) this +makes it easy to handle qualified type names (e.g. "foo::bar::baz<42>::t") +in C++ as a single "token" in the parser. 2) if the parser backtracks, the +reparse does not need to redo semantic analysis to determine whether a token +sequence is a variable, type, template, etc.

+ +

Annotation Tokens are created by the parser and reinjected into the parser's +token stream (when backtracking is enabled). Because they can only exist in +tokens that the preprocessor-proper is done with, it doesn't need to keep around +flags like "start of line" that the preprocessor uses to do its job. +Additionally, an annotation token may "cover" a sequence of preprocessor tokens +(e.g. a::b::c is five preprocessor tokens). As such, the valid fields +of an annotation token are different than the fields for a normal token (but +they are multiplexed into the normal Token fields):

+ +
    +
  • SourceLocation "Location" - The SourceLocation for the annotation +token indicates the first token replaced by the annotation token. In the example +above, it would be the location of the "a" identifier.
  • + +
  • SourceLocation "AnnotationEndLoc" - This holds the location of the +last token replaced with the annotation token. In the example above, it would +be the location of the "c" identifier.
  • + +
  • void* "AnnotationValue" - This contains an opaque object that the +parser gets from Sema through an Actions module, it is passed around and Sema +intepretes it, based on the type of annotation token.
  • + +
  • TokenKind "Kind" - This indicates the kind of Annotation token this +is. See below for the different valid kinds.
  • +
+ +

Annotation tokens currently come in three kinds:

+ +
    +
  1. tok::annot_typename: This annotation token represents a +resolved typename token that is potentially qualified. The AnnotationValue +field contains a pointer returned by Action::getTypeName(). In the case of the +Sema actions module, this is a Decl* for the type.
  2. + +
  3. tok::annot_cxxscope: This annotation token represents a C++ scope +specifier, such as "A::B::". This corresponds to the grammar productions "::" +and ":: [opt] nested-name-specifier". The AnnotationValue pointer is returned +by the Action::ActOnCXXGlobalScopeSpecifier and +Action::ActOnCXXNestedNameSpecifier callbacks. In the case of Sema, this is a +DeclContext*.
  4. + +
  5. tok::annot_template_id: This annotation token represents a +C++ template-id such as "foo<int, 4>", where "foo" is the name +of a template. The AnnotationValue pointer is a pointer to a malloc'd +TemplateIdAnnotation object. Depending on the context, a parsed template-id that names a type might become a typename annotation token (if all we care about is the named type, e.g., because it occurs in a type specifier) or might remain a template-id token (if we want to retain more source location information or produce a new type, e.g., in a declaration of a class template specialization). template-id annotation tokens that refer to a type can be "upgraded" to typename annotation tokens by the parser.
  6. + +
+ +

As mentioned above, annotation tokens are not returned by the preprocessor, +they are formed on demand by the parser. This means that the parser has to be +aware of cases where an annotation could occur and form it where appropriate. +This is somewhat similar to how the parser handles Translation Phase 6 of C99: +String Concatenation (see C99 5.1.1.2). In the case of string concatenation, +the preprocessor just returns distinct tok::string_literal and +tok::wide_string_literal tokens and the parser eats a sequence of them wherever +the grammar indicates that a string literal can occur.

+ +

In order to do this, whenever the parser expects a tok::identifier or +tok::coloncolon, it should call the TryAnnotateTypeOrScopeToken or +TryAnnotateCXXScopeToken methods to form the annotation token. These methods +will maximally form the specified annotation tokens and replace the current +token with them, if applicable. If the current tokens is not valid for an +annotation token, it will remain an identifier or :: token.

+ + + + +

The Lexer class

+ + +

The Lexer class provides the mechanics of lexing tokens out of a source +buffer and deciding what they mean. The Lexer is complicated by the fact that +it operates on raw buffers that have not had spelling eliminated (this is a +necessity to get decent performance), but this is countered with careful coding +as well as standard performance techniques (for example, the comment handling +code is vectorized on X86 and PowerPC hosts).

+ +

The lexer has a couple of interesting modal features:

+ +
    +
  • The lexer can operate in 'raw' mode. This mode has several features that + make it possible to quickly lex the file (e.g. it stops identifier lookup, + doesn't specially handle preprocessor tokens, handles EOF differently, etc). + This mode is used for lexing within an "#if 0" block, for + example.
  • +
  • The lexer can capture and return comments as tokens. This is required to + support the -C preprocessor mode, which passes comments through, and is + used by the diagnostic checker to identifier expect-error annotations.
  • +
  • The lexer can be in ParsingFilename mode, which happens when preprocessing + after reading a #include directive. This mode changes the parsing of '<' + to return an "angled string" instead of a bunch of tokens for each thing + within the filename.
  • +
  • When parsing a preprocessor directive (after "#") the + ParsingPreprocessorDirective mode is entered. This changes the parser to + return EOM at a newline.
  • +
  • The Lexer uses a LangOptions object to know whether trigraphs are enabled, + whether C++ or ObjC keywords are recognized, etc.
  • +
+ +

In addition to these modes, the lexer keeps track of a couple of other + features that are local to a lexed buffer, which change as the buffer is + lexed:

+ +
    +
  • The Lexer uses BufferPtr to keep track of the current character being + lexed.
  • +
  • The Lexer uses IsAtStartOfLine to keep track of whether the next lexed token + will start with its "start of line" bit set.
  • +
  • The Lexer keeps track of the current #if directives that are active (which + can be nested).
  • +
  • The Lexer keeps track of an + MultipleIncludeOpt object, which is used to + detect whether the buffer uses the standard "#ifndef XX / + #define XX" idiom to prevent multiple inclusion. If a buffer does, + subsequent includes can be ignored if the XX macro is defined.
  • +
+ + +

The TokenLexer class

+ + +

The TokenLexer class is a token provider that returns tokens from a list +of tokens that came from somewhere else. It typically used for two things: 1) +returning tokens from a macro definition as it is being expanded 2) returning +tokens from an arbitrary buffer of tokens. The later use is used by _Pragma and +will most likely be used to handle unbounded look-ahead for the C++ parser.

+ + +

The MultipleIncludeOpt class

+ + +

The MultipleIncludeOpt class implements a really simple little state machine +that is used to detect the standard "#ifndef XX / #define XX" +idiom that people typically use to prevent multiple inclusion of headers. If a +buffer uses this idiom and is subsequently #include'd, the preprocessor can +simply check to see whether the guarding condition is defined or not. If so, +the preprocessor can completely ignore the include of the header.

+ + + + +

The Parser Library

+ + + +

The AST Library

+ + + +

The Type class and its subclasses

+ + +

The Type class (and its subclasses) are an important part of the AST. Types +are accessed through the ASTContext class, which implicitly creates and uniques +them as they are needed. Types have a couple of non-obvious features: 1) they +do not capture type qualifiers like const or volatile (See +QualType), and 2) they implicitly capture typedef +information. Once created, types are immutable (unlike decls).

+ +

Typedefs in C make semantic analysis a bit more complex than it would +be without them. The issue is that we want to capture typedef information +and represent it in the AST perfectly, but the semantics of operations need to +"see through" typedefs. For example, consider this code:

+ + +void func() {
+  typedef int foo;
+  foo X, *Y;
+  typedef foo* bar;
+  bar Z;
+  *X; // error
+  **Y; // error
+  **Z; // error
+}
+
+ +

The code above is illegal, and thus we expect there to be diagnostics emitted +on the annotated lines. In this example, we expect to get:

+ +
+test.c:6:1: error: indirection requires pointer operand ('foo' invalid)
+*X; // error
+^~
+test.c:7:1: error: indirection requires pointer operand ('foo' invalid)
+**Y; // error
+^~~
+test.c:8:1: error: indirection requires pointer operand ('foo' invalid)
+**Z; // error
+^~~
+
+ +

While this example is somewhat silly, it illustrates the point: we want to +retain typedef information where possible, so that we can emit errors about +"std::string" instead of "std::basic_string<char, std:...". +Doing this requires properly keeping typedef information (for example, the type +of "X" is "foo", not "int"), and requires properly propagating it through the +various operators (for example, the type of *Y is "foo", not "int"). In order +to retain this information, the type of these expressions is an instance of the +TypedefType class, which indicates that the type of these expressions is a +typedef for foo. +

+ +

Representing types like this is great for diagnostics, because the +user-specified type is always immediately available. There are two problems +with this: first, various semantic checks need to make judgements about the +actual structure of a type, ignoring typdefs. Second, we need an +efficient way to query whether two types are structurally identical to each +other, ignoring typedefs. The solution to both of these problems is the idea of +canonical types.

+ + +

Canonical Types

+ + +

Every instance of the Type class contains a canonical type pointer. For +simple types with no typedefs involved (e.g. "int", "int*", +"int**"), the type just points to itself. For types that have a +typedef somewhere in their structure (e.g. "foo", "foo*", +"foo**", "bar"), the canonical type pointer points to their +structurally equivalent type without any typedefs (e.g. "int", +"int*", "int**", and "int*" respectively).

+ +

This design provides a constant time operation (dereferencing the canonical +type pointer) that gives us access to the structure of types. For example, +we can trivially tell that "bar" and "foo*" are the same type by dereferencing +their canonical type pointers and doing a pointer comparison (they both point +to the single "int*" type).

+ +

Canonical types and typedef types bring up some complexities that must be +carefully managed. Specifically, the "isa/cast/dyncast" operators generally +shouldn't be used in code that is inspecting the AST. For example, when type +checking the indirection operator (unary '*' on a pointer), the type checker +must verify that the operand has a pointer type. It would not be correct to +check that with "isa<PointerType>(SubExpr->getType())", +because this predicate would fail if the subexpression had a typedef type.

+ +

The solution to this problem are a set of helper methods on Type, used to +check their properties. In this case, it would be correct to use +"SubExpr->getType()->isPointerType()" to do the check. This +predicate will return true if the canonical type is a pointer, which is +true any time the type is structurally a pointer type. The only hard part here +is remembering not to use the isa/cast/dyncast operations.

+ +

The second problem we face is how to get access to the pointer type once we +know it exists. To continue the example, the result type of the indirection +operator is the pointee type of the subexpression. In order to determine the +type, we need to get the instance of PointerType that best captures the typedef +information in the program. If the type of the expression is literally a +PointerType, we can return that, otherwise we have to dig through the +typedefs to find the pointer type. For example, if the subexpression had type +"foo*", we could return that type as the result. If the subexpression +had type "bar", we want to return "foo*" (note that we do +not want "int*"). In order to provide all of this, Type has +a getAsPointerType() method that checks whether the type is structurally a +PointerType and, if so, returns the best one. If not, it returns a null +pointer.

+ +

This structure is somewhat mystical, but after meditating on it, it will +make sense to you :).

+ + +

The QualType class

+ + +

The QualType class is designed as a trivial value class that is small, +passed by-value and is efficient to query. The idea of QualType is that it +stores the type qualifiers (const, volatile, restrict) separately from the types +themselves: QualType is conceptually a pair of "Type*" and bits for the type +qualifiers.

+ +

By storing the type qualifiers as bits in the conceptual pair, it is +extremely efficient to get the set of qualifiers on a QualType (just return the +field of the pair), add a type qualifier (which is a trivial constant-time +operation that sets a bit), and remove one or more type qualifiers (just return +a QualType with the bitfield set to empty).

+ +

Further, because the bits are stored outside of the type itself, we do not +need to create duplicates of types with different sets of qualifiers (i.e. there +is only a single heap allocated "int" type: "const int" and "volatile const int" +both point to the same heap allocated "int" type). This reduces the heap size +used to represent bits and also means we do not have to consider qualifiers when +uniquing types (Type does not even contain qualifiers).

+ +

In practice, on hosts where it is safe, the 3 type qualifiers are stored in +the low bit of the pointer to the Type object. This means that QualType is +exactly the same size as a pointer, and this works fine on any system where +malloc'd objects are at least 8 byte aligned.

+ + +

Declaration names

+ + +

The DeclarationName class represents the name of a + declaration in Clang. Declarations in the C family of languages can + take several different forms. Most declarations are named by + simple identifiers, e.g., "f" and "x" in + the function declaration f(int x). In C++, declaration + names can also name class constructors ("Class" + in struct Class { Class(); }), class destructors + ("~Class"), overloaded operator names ("operator+"), + and conversion functions ("operator void const *"). In + Objective-C, declaration names can refer to the names of Objective-C + methods, which involve the method name and the parameters, + collectively called a selector, e.g., + "setWidth:height:". Since all of these kinds of + entities - variables, functions, Objective-C methods, C++ + constructors, destructors, and operators - are represented as + subclasses of Clang's common NamedDecl + class, DeclarationName is designed to efficiently + represent any kind of name.

+ +

Given + a DeclarationName N, N.getNameKind() + will produce a value that describes what kind of name N + stores. There are 8 options (all of the names are inside + the DeclarationName class)

+
+
Identifier
+
The name is a simple + identifier. Use N.getAsIdentifierInfo() to retrieve the + corresponding IdentifierInfo* pointing to the actual + identifier. Note that C++ overloaded operators (e.g., + "operator+") are represented as special kinds of + identifiers. Use IdentifierInfo's getOverloadedOperatorID + function to determine whether an identifier is an overloaded + operator name.
+ +
ObjCZeroArgSelector, ObjCOneArgSelector, + ObjCMultiArgSelector
+
The name is an Objective-C selector, which can be retrieved as a + Selector instance + via N.getObjCSelector(). The three possible name + kinds for Objective-C reflect an optimization within + the DeclarationName class: both zero- and + one-argument selectors are stored as a + masked IdentifierInfo pointer, and therefore require + very little space, since zero- and one-argument selectors are far + more common than multi-argument selectors (which use a different + structure).
+ +
CXXConstructorName
+
The name is a C++ constructor + name. Use N.getCXXNameType() to retrieve + the type that this constructor is meant to + construct. The type is always the canonical type, since all + constructors for a given type have the same name.
+ +
CXXDestructorName
+
The name is a C++ destructor + name. Use N.getCXXNameType() to retrieve + the type whose destructor is being + named. This type is always a canonical type.
+ +
CXXConversionFunctionName
+
The name is a C++ conversion function. Conversion functions are + named according to the type they convert to, e.g., "operator void + const *". Use N.getCXXNameType() to retrieve + the type that this conversion function converts to. This type is + always a canonical type.
+ +
CXXOperatorName
+
The name is a C++ overloaded operator name. Overloaded operators + are named according to their spelling, e.g., + "operator+" or "operator new + []". Use N.getCXXOverloadedOperator() to + retrieve the overloaded operator (a value of + type OverloadedOperatorKind).
+
+ +

DeclarationNames are cheap to create, copy, and + compare. They require only a single pointer's worth of storage in + the common cases (identifiers, zero- + and one-argument Objective-C selectors) and use dense, uniqued + storage for the other kinds of + names. Two DeclarationNames can be compared for + equality (==, !=) using a simple bitwise + comparison, can be ordered + with <, >, <=, + and >= (which provide a lexicographical ordering for + normal identifiers but an unspecified ordering for other kinds of + names), and can be placed into LLVM DenseMaps + and DenseSets.

+ +

DeclarationName instances can be created in different + ways depending on what kind of name the instance will store. Normal + identifiers (IdentifierInfo pointers) and Objective-C selectors + (Selector) can be implicitly converted + to DeclarationNames. Names for C++ constructors, + destructors, conversion functions, and overloaded operators can be retrieved from + the DeclarationNameTable, an instance of which is + available as ASTContext::DeclarationNames. The member + functions getCXXConstructorName, getCXXDestructorName, + getCXXConversionFunctionName, and getCXXOperatorName, respectively, + return DeclarationName instances for the four kinds of + C++ special function names.

+ + +

Declaration contexts

+ +

Every declaration in a program exists within some declaration + context, such as a translation unit, namespace, class, or + function. Declaration contexts in Clang are represented by + the DeclContext class, from which the various + declaration-context AST nodes + (TranslationUnitDecl, NamespaceDecl, RecordDecl, FunctionDecl, + etc.) will derive. The DeclContext class provides + several facilities common to each declaration context:

+
+
Source-centric vs. Semantics-centric View of Declarations
+
DeclContext provides two views of the declarations + stored within a declaration context. The source-centric view + accurately represents the program source code as written, including + multiple declarations of entities where present (see the + section Redeclarations and + Overloads), while the semantics-centric view represents the + program semantics. The two views are kept synchronized by semantic + analysis while the ASTs are being constructed.
+ +
Storage of declarations within that context
+
Every declaration context can contain some number of + declarations. For example, a C++ class (represented + by RecordDecl) contains various member functions, + fields, nested types, and so on. All of these declarations will be + stored within the DeclContext, and one can iterate + over the declarations via + [DeclContext::decls_begin(), + DeclContext::decls_end()). This mechanism provides + the source-centric view of declarations in the context.
+ +
Lookup of declarations within that context
+
The DeclContext structure provides efficient name + lookup for names within that declaration context. For example, + if N is a namespace we can look for the + name N::f + using DeclContext::lookup. The lookup itself is + based on a lazily-constructed array (for declaration contexts + with a small number of declarations) or hash table (for + declaration contexts with more declarations). The lookup + operation provides the semantics-centric view of the declarations + in the context.
+ +
Ownership of declarations
+
The DeclContext owns all of the declarations that + were declared within its declaration context, and is responsible + for the management of their memory as well as their + (de-)serialization.
+
+ +

All declarations are stored within a declaration context, and one + can query + information about the context in which each declaration lives. One + can retrieve the DeclContext that contains a + particular Decl + using Decl::getDeclContext. However, see the + section Lexical and Semantic + Contexts for more information about how to interpret this + context information.

+ +

Redeclarations and Overloads

+

Within a translation unit, it is common for an entity to be +declared several times. For example, we might declare a function "f" + and then later re-declare it as part of an inlined definition:

+ +
+void f(int x, int y, int z = 1);
+
+inline void f(int x, int y, int z) { /* ... */ }
+
+ +

The representation of "f" differs in the source-centric and + semantics-centric views of a declaration context. In the + source-centric view, all redeclarations will be present, in the + order they occurred in the source code, making + this view suitable for clients that wish to see the structure of + the source code. In the semantics-centric view, only the most recent "f" + will be found by the lookup, since it effectively replaces the first + declaration of "f".

+ +

In the semantics-centric view, overloading of functions is + represented explicitly. For example, given two declarations of a + function "g" that are overloaded, e.g.,

+
+void g();
+void g(int);
+
+

the DeclContext::lookup operation will return + an OverloadedFunctionDecl that contains both + declarations of "g". Clients that perform semantic analysis on a + program that is not concerned with the actual source code will + primarily use this semantics-centric view.

+ +

Lexical and Semantic Contexts

+

Each declaration has two potentially different + declaration contexts: a lexical context, which corresponds to + the source-centric view of the declaration context, and + a semantic context, which corresponds to the + semantics-centric view. The lexical context is accessible + via Decl::getLexicalDeclContext while the + semantic context is accessible + via Decl::getDeclContext, both of which return + DeclContext pointers. For most declarations, the two + contexts are identical. For example:

+ +
+class X {
+public:
+  void f(int x);
+};
+
+ +

Here, the semantic and lexical contexts of X::f are + the DeclContext associated with the + class X (itself stored as a RecordDecl AST + node). However, we can now define X::f out-of-line:

+ +
+void X::f(int x = 17) { /* ... */ }
+
+ +

This definition of has different lexical and semantic + contexts. The lexical context corresponds to the declaration + context in which the actual declaration occurred in the source + code, e.g., the translation unit containing X. Thus, + this declaration of X::f can be found by traversing + the declarations provided by + [decls_begin(), decls_end()) in the + translation unit.

+ +

The semantic context of X::f corresponds to the + class X, since this member function is (semantically) a + member of X. Lookup of the name f into + the DeclContext associated with X will + then return the definition of X::f (including + information about the default argument).

+ +

Transparent Declaration Contexts

+

In C and C++, there are several contexts in which names that are + logically declared inside another declaration will actually "leak" + out into the enclosing scope from the perspective of name + lookup. The most obvious instance of this behavior is in + enumeration types, e.g.,

+
+enum Color {
+  Red, 
+  Green,
+  Blue
+};
+
+ +

Here, Color is an enumeration, which is a declaration + context that contains the + enumerators Red, Green, + and Blue. Thus, traversing the list of declarations + contained in the enumeration Color will + yield Red, Green, + and Blue. However, outside of the scope + of Color one can name the enumerator Red + without qualifying the name, e.g.,

+ +
+Color c = Red;
+
+ +

There are other entities in C++ that provide similar behavior. For + example, linkage specifications that use curly braces:

+ +
+extern "C" {
+  void f(int);
+  void g(int);
+}
+// f and g are visible here
+
+ +

For source-level accuracy, we treat the linkage specification and + enumeration type as a + declaration context in which its enclosed declarations ("Red", + "Green", and "Blue"; "f" and "g") + are declared. However, these declarations are visible outside of the + scope of the declaration context.

+ +

These language features (and several others, described below) have + roughly the same set of + requirements: declarations are declared within a particular lexical + context, but the declarations are also found via name lookup in + scopes enclosing the declaration itself. This feature is implemented + via transparent declaration contexts + (see DeclContext::isTransparentContext()), whose + declarations are visible in the nearest enclosing non-transparent + declaration context. This means that the lexical context of the + declaration (e.g., an enumerator) will be the + transparent DeclContext itself, as will the semantic + context, but the declaration will be visible in every outer context + up to and including the first non-transparent declaration context (since + transparent declaration contexts can be nested).

+ +

The transparent DeclContexts are:

+
    +
  • Enumerations (but not C++0x "scoped enumerations"): +
    +enum Color { 
    +  Red, 
    +  Green, 
    +  Blue 
    +};
    +// Red, Green, and Blue are in scope
    +  
  • +
  • C++ linkage specifications: +
    +extern "C" {
    +  void f(int);
    +  void g(int);
    +}
    +// f and g are in scope
    +  
  • +
  • Anonymous unions and structs: +
    +struct LookupTable {
    +  bool IsVector;
    +  union {
    +    std::vector<Item> *Vector;
    +    std::set<Item> *Set;
    +  };
    +};
    +
    +LookupTable LT;
    +LT.Vector = 0; // Okay: finds Vector inside the unnamed union
    +    
    +
  • +
  • C++0x inline namespaces: +
    +namespace mylib {
    +  inline namespace debug {
    +    class X;
    +  }
    +}
    +mylib::X *xp; // okay: mylib::X refers to mylib::debug::X
    +
    +
  • +
+ + +

Multiply-Defined Declaration Contexts

+

C++ namespaces have the interesting--and, so far, unique--property that +the namespace can be defined multiple times, and the declarations +provided by each namespace definition are effectively merged (from +the semantic point of view). For example, the following two code +snippets are semantically indistinguishable:

+
+// Snippet #1:
+namespace N {
+  void f();
+}
+namespace N {
+  void f(int);
+}
+
+// Snippet #2:
+namespace N {
+  void f();
+  void f(int);
+}
+
+ +

In Clang's representation, the source-centric view of declaration + contexts will actually have two separate NamespaceDecl + nodes in Snippet #1, each of which is a declaration context that + contains a single declaration of "f". However, the semantics-centric + view provided by name lookup into the namespace N for + "f" will return an OverloadedFunctionDecl that contains + both declarations of "f".

+ +

DeclContext manages multiply-defined declaration + contexts internally. The + function DeclContext::getPrimaryContext retrieves the + "primary" context for a given DeclContext instance, + which is the DeclContext responsible for maintaining + the lookup table used for the semantics-centric view. Given the + primary context, one can follow the chain + of DeclContext nodes that define additional + declarations via DeclContext::getNextContext. Note that + these functions are used internally within the lookup and insertion + methods of the DeclContext, so the vast majority of + clients can ignore them.

+ + +

The CFG class

+ + +

The CFG class is designed to represent a source-level +control-flow graph for a single statement (Stmt*). Typically +instances of CFG are constructed for function bodies (usually +an instance of CompoundStmt), but can also be instantiated to +represent the control-flow of any class that subclasses Stmt, +which includes simple expressions. Control-flow graphs are especially +useful for performing +flow- +or path-sensitive program analyses on a given function.

+ + +

Basic Blocks

+ + +

Concretely, an instance of CFG is a collection of basic +blocks. Each basic block is an instance of CFGBlock, which +simply contains an ordered sequence of Stmt* (each referring +to statements in the AST). The ordering of statements within a block +indicates unconditional flow of control from one statement to the +next. Conditional control-flow +is represented using edges between basic blocks. The statements +within a given CFGBlock can be traversed using +the CFGBlock::*iterator interface.

+ +

+A CFG object owns the instances of CFGBlock within +the control-flow graph it represents. Each CFGBlock within a +CFG is also uniquely numbered (accessible +via CFGBlock::getBlockID()). Currently the number is +based on the ordering the blocks were created, but no assumptions +should be made on how CFGBlocks are numbered other than their +numbers are unique and that they are numbered from 0..N-1 (where N is +the number of basic blocks in the CFG).

+ + +

Entry and Exit Blocks

+ + +Each instance of CFG contains two special blocks: +an entry block (accessible via CFG::getEntry()), which +has no incoming edges, and an exit block (accessible +via CFG::getExit()), which has no outgoing edges. Neither +block contains any statements, and they serve the role of providing a +clear entrance and exit for a body of code such as a function body. +The presence of these empty blocks greatly simplifies the +implementation of many analyses built on top of CFGs. + + +

Conditional Control-Flow

+ + +

Conditional control-flow (such as those induced by if-statements +and loops) is represented as edges between CFGBlocks. +Because different C language constructs can induce control-flow, +each CFGBlock also records an extra Stmt* that +represents the terminator of the block. A terminator is simply +the statement that caused the control-flow, and is used to identify +the nature of the conditional control-flow between blocks. For +example, in the case of an if-statement, the terminator refers to +the IfStmt object in the AST that represented the given +branch.

+ +

To illustrate, consider the following code example:

+ + +int foo(int x) {
+  x = x + 1;
+
+  if (x > 2) x++;
+  else {
+    x += 2;
+    x *= 2;
+  }
+
+  return x;
+} +
+ +

After invoking the parser+semantic analyzer on this code fragment, +the AST of the body of foo is referenced by a +single Stmt*. We can then construct an instance +of CFG representing the control-flow graph of this function +body by single call to a static class method:

+ + +  Stmt* FooBody = ...
+  CFG* FooCFG = CFG::buildCFG(FooBody); +
+ +

It is the responsibility of the caller of CFG::buildCFG +to delete the returned CFG* when the CFG is no +longer needed.

+ +

Along with providing an interface to iterate over +its CFGBlocks, the CFG class also provides methods +that are useful for debugging and visualizing CFGs. For example, the +method +CFG::dump() dumps a pretty-printed version of the CFG to +standard error. This is especially useful when one is using a +debugger such as gdb. For example, here is the output +of FooCFG->dump():

+ + + [ B5 (ENTRY) ]
+    Predecessors (0):
+    Successors (1): B4
+
+ [ B4 ]
+    1: x = x + 1
+    2: (x > 2)
+    T: if [B4.2]
+    Predecessors (1): B5
+    Successors (2): B3 B2
+
+ [ B3 ]
+    1: x++
+    Predecessors (1): B4
+    Successors (1): B1
+
+ [ B2 ]
+    1: x += 2
+    2: x *= 2
+    Predecessors (1): B4
+    Successors (1): B1
+
+ [ B1 ]
+    1: return x;
+    Predecessors (2): B2 B3
+    Successors (1): B0
+
+ [ B0 (EXIT) ]
+    Predecessors (1): B1
+    Successors (0): +
+ +

For each block, the pretty-printed output displays for each block +the number of predecessor blocks (blocks that have outgoing +control-flow to the given block) and successor blocks (blocks +that have control-flow that have incoming control-flow from the given +block). We can also clearly see the special entry and exit blocks at +the beginning and end of the pretty-printed output. For the entry +block (block B5), the number of predecessor blocks is 0, while for the +exit block (block B0) the number of successor blocks is 0.

+ +

The most interesting block here is B4, whose outgoing control-flow +represents the branching caused by the sole if-statement +in foo. Of particular interest is the second statement in +the block, (x > 2), and the terminator, printed +as if [B4.2]. The second statement represents the +evaluation of the condition of the if-statement, which occurs before +the actual branching of control-flow. Within the CFGBlock +for B4, the Stmt* for the second statement refers to the +actual expression in the AST for (x > 2). Thus +pointers to subclasses of Expr can appear in the list of +statements in a block, and not just subclasses of Stmt that +refer to proper C statements.

+ +

The terminator of block B4 is a pointer to the IfStmt +object in the AST. The pretty-printer outputs if +[B4.2] because the condition expression of the if-statement +has an actual place in the basic block, and thus the terminator is +essentially +referring to the expression that is the second statement of +block B4 (i.e., B4.2). In this manner, conditions for control-flow +(which also includes conditions for loops and switch statements) are +hoisted into the actual basic block.

+ + + + + + + + + +

Constant Folding in the Clang AST

+ + +

There are several places where constants and constant folding matter a lot to +the Clang front-end. First, in general, we prefer the AST to retain the source +code as close to how the user wrote it as possible. This means that if they +wrote "5+4", we want to keep the addition and two constants in the AST, we don't +want to fold to "9". This means that constant folding in various ways turns +into a tree walk that needs to handle the various cases.

+ +

However, there are places in both C and C++ that require constants to be +folded. For example, the C standard defines what an "integer constant +expression" (i-c-e) is with very precise and specific requirements. The +language then requires i-c-e's in a lot of places (for example, the size of a +bitfield, the value for a case statement, etc). For these, we have to be able +to constant fold the constants, to do semantic checks (e.g. verify bitfield size +is non-negative and that case statements aren't duplicated). We aim for Clang +to be very pedantic about this, diagnosing cases when the code does not use an +i-c-e where one is required, but accepting the code unless running with +-pedantic-errors.

+ +

Things get a little bit more tricky when it comes to compatibility with +real-world source code. Specifically, GCC has historically accepted a huge +superset of expressions as i-c-e's, and a lot of real world code depends on this +unfortuate accident of history (including, e.g., the glibc system headers). GCC +accepts anything its "fold" optimizer is capable of reducing to an integer +constant, which means that the definition of what it accepts changes as its +optimizer does. One example is that GCC accepts things like "case X-X:" even +when X is a variable, because it can fold this to 0.

+ +

Another issue are how constants interact with the extensions we support, such +as __builtin_constant_p, __builtin_inf, __extension__ and many others. C99 +obviously does not specify the semantics of any of these extensions, and the +definition of i-c-e does not include them. However, these extensions are often +used in real code, and we have to have a way to reason about them.

+ +

Finally, this is not just a problem for semantic analysis. The code +generator and other clients have to be able to fold constants (e.g. to +initialize global variables) and has to handle a superset of what C99 allows. +Further, these clients can benefit from extended information. For example, we +know that "foo()||1" always evaluates to true, but we can't replace the +expression with true because it has side effects.

+ + +

Implementation Approach

+ + +

After trying several different approaches, we've finally converged on a +design (Note, at the time of this writing, not all of this has been implemented, +consider this a design goal!). Our basic approach is to define a single +recursive method evaluation method (Expr::Evaluate), which is +implemented in AST/ExprConstant.cpp. Given an expression with 'scalar' +type (integer, fp, complex, or pointer) this method returns the following +information:

+ +
    +
  • Whether the expression is an integer constant expression, a general + constant that was folded but has no side effects, a general constant that + was folded but that does have side effects, or an uncomputable/unfoldable + value. +
  • +
  • If the expression was computable in any way, this method returns the APValue + for the result of the expression.
  • +
  • If the expression is not evaluatable at all, this method returns + information on one of the problems with the expression. This includes a + SourceLocation for where the problem is, and a diagnostic ID that explains + the problem. The diagnostic should be have ERROR type.
  • +
  • If the expression is not an integer constant expression, this method returns + information on one of the problems with the expression. This includes a + SourceLocation for where the problem is, and a diagnostic ID that explains + the problem. The diagnostic should be have EXTENSION type.
  • +
+ +

This information gives various clients the flexibility that they want, and we +will eventually have some helper methods for various extensions. For example, +Sema should have a Sema::VerifyIntegerConstantExpression method, which +calls Evaluate on the expression. If the expression is not foldable, the error +is emitted, and it would return true. If the expression is not an i-c-e, the +EXTENSION diagnostic is emitted. Finally it would return false to indicate that +the AST is ok.

+ +

Other clients can use the information in other ways, for example, codegen can +just use expressions that are foldable in any way.

+ + +

Extensions

+ + +

This section describes how some of the various extensions Clang supports +interacts with constant evaluation:

+ +
    +
  • __extension__: The expression form of this extension causes + any evaluatable subexpression to be accepted as an integer constant + expression.
  • +
  • __builtin_constant_p: This returns true (as a integer + constant expression) if the operand is any evaluatable constant. As a + special case, if __builtin_constant_p is the (potentially + parenthesized) condition of a conditional operator expression ("?:"), only + the true side of the conditional operator is considered, and it is evaluated + with full constant folding.
  • +
  • __builtin_choose_expr: The condition is required to be an + integer constant expression, but we accept any constant as an "extension of + an extension". This only evaluates one operand depending on which way the + condition evaluates.
  • +
  • __builtin_classify_type: This always returns an integer + constant expression.
  • +
  • __builtin_inf,nan,..: These are treated just like a + floating-point literal.
  • +
  • __builtin_abs,copysign,..: These are constant folded as + general constant expressions.
  • +
+ + + + +
+ + diff --git a/docs/LanguageExtensions.html b/docs/LanguageExtensions.html new file mode 100644 index 0000000..c486562 --- /dev/null +++ b/docs/LanguageExtensions.html @@ -0,0 +1,327 @@ + + +Clang Language Extensions + + + + + + + + +
+ +

Clang Language Extensions

+ + + + +

Introduction

+ + +

This document describes the language extensions provided by Clang. In +addition to the langauge extensions listed here, Clang aims to support a broad +range of GCC extensions. Please see the GCC manual for +more information on these extensions.

+ + +

Builtin Macros

+ + +

__BASE_FILE__, __INCLUDE_LEVEL__, __TIMESTAMP__, __COUNTER__

+ + +

Vectors and Extended Vectors

+ + +

Supports the GCC vector extensions, plus some stuff like V[1]. ext_vector +with V.xyzw syntax and other tidbits. See also __builtin_shufflevector.

+ + +

Blocks

+ + +

The syntax and high level language feature description is in BlockLanguageSpec.txt. Implementation and ABI +details for the clang implementation are in BlockImplementation.txt.

+ + +

Function Overloading in C

+ + +

Clang provides support for C++ function overloading in C. Function +overloading in C is introduced using the overloadable attribute. For +example, one might provide several overloaded versions of a tgsin +function that invokes the appropriate standard function computing the sine of a +value with float, double, or long double +precision:

+ +
+
+#include <math.h>
+float __attribute__((overloadable)) tgsin(float x) { return sinf(x); }
+double __attribute__((overloadable)) tgsin(double x) { return sin(x); }
+long double __attribute__((overloadable)) tgsin(long double x) { return sinl(x); }
+
+
+ +

Given these declarations, one can call tgsin with a +float value to receive a float result, with a +double to receive a double result, etc. Function +overloading in C follows the rules of C++ function overloading to pick +the best overload given the call arguments, with a few C-specific +semantics:

+
    +
  • Conversion from float or double to long + double is ranked as a floating-point promotion (per C99) rather + than as a floating-point conversion (as in C++).
  • + +
  • A conversion from a pointer of type T* to a pointer of type + U* is considered a pointer conversion (with conversion + rank) if T and U are compatible types.
  • + +
  • A conversion from type T to a value of type U + is permitted if T and U are compatible types. This + conversion is given "conversion" rank.
  • +
+ +

The declaration of overloadable functions is restricted to +function declarations and definitions. Most importantly, if any +function with a given name is given the overloadable +attribute, then all function declarations and definitions with that +name (and in that scope) must have the overloadable +attribute. This rule even applies to redeclarations of functions whose original +declaration had the overloadable attribute, e.g.,

+ +
+
+int f(int) __attribute__((overloadable));
+float f(float); // error: declaration of "f" must have the "overloadable" attribute
+
+int g(int) __attribute__((overloadable));
+int g(int) { } // error: redeclaration of "g" must also have the "overloadable" attribute
+
+
+ +

Functions marked overloadable must have +prototypes. Therefore, the following code is ill-formed:

+ +
+
+int h() __attribute__((overloadable)); // error: h does not have a prototype
+
+
+ +

However, overloadable functions are allowed to use a +ellipsis even if there are no named parameters (as is permitted in C++). This feature is particularly useful when combined with the unavailable attribute:

+ +
+
+void honeypot(...) __attribute__((overloadable, unavailable)); // calling me is an error
+
+
+ +

Functions declared with the overloadable attribute have +their names mangled according to the same rules as C++ function +names. For example, the three tgsin functions in our +motivating example get the mangled names _Z5tgsinf, +_Z5tgsind, and Z5tgsine, respectively. There are two +caveats to this use of name mangling:

+ +
    + +
  • Future versions of Clang may change the name mangling of + functions overloaded in C, so you should not depend on an specific + mangling. To be completely safe, we strongly urge the use of + static inline with overloadable functions.
  • + +
  • The overloadable attribute has almost no meaning when + used in C++, because names will already be mangled and functions are + already overloadable. However, when an overloadable + function occurs within an extern "C" linkage specification, + it's name will be mangled in the same way as it would in + C.
  • +
+ + +

Builtin Functions

+ + +

Clang supports a number of builtin library functions with the same syntax as +GCC, including things like __builtin_nan, +__builtin_constant_p, __builtin_choose_expr, +__builtin_types_compatible_p, __sync_fetch_and_add, etc. In +addition to the GCC builtins, Clang supports a number of builtins that GCC does +not, which are listed here.

+ +

Please note that Clang does not and will not support all of the GCC builtins +for vector operations. Instead of using builtins, you should use the functions +defined in target-specific header files like <xmmintrin.h>, which +define portable wrappers for these. Many of the Clang versions of these +functions are implemented directly in terms of extended +vector support instead of builtins, in order to reduce the number of +builtins that we need to implement.

+ + +

__builtin_shufflevector

+ + +

__builtin_shufflevector is used to expression generic vector +permutation/shuffle/swizzle operations. This builtin is also very important for +the implementation of various target-specific header files like +<xmmintrin.h>. +

+ +

Syntax:

+ +
+__builtin_shufflevector(vec1, vec2, index1, index2, ...)
+
+ +

Examples:

+ +
+  // Identity operation - return 4-element vector V1.
+  __builtin_shufflevector(V1, V1, 0, 1, 2, 3)
+
+  // "Splat" element 0 of V1 into a 4-element result.
+  __builtin_shufflevector(V1, V1, 0, 0, 0, 0)
+
+  // Reverse 4-element vector V1.
+  __builtin_shufflevector(V1, V1, 3, 2, 1, 0)
+
+  // Concatenate every other element of 4-element vectors V1 and V2.
+  __builtin_shufflevector(V1, V2, 0, 2, 4, 6)
+
+  // Concatenate every other element of 8-element vectors V1 and V2.
+  __builtin_shufflevector(V1, V2, 0, 2, 4, 6, 8, 10, 12, 14)
+
+ +

Description:

+ +

The first two arguments to __builtin_shufflevector are vectors that have the +same element type. The remaining arguments are a list of integers that specify +the elements indices of the first two vectors that should be extracted and +returned in a new vector. These element indices are numbered sequentially +starting with the first vector, continuing into the second vector. Thus, if +vec1 is a 4-element vector, index 5 would refer to the second element of vec2. +

+ +

The result of __builtin_shufflevector is a vector +with the same element type as vec1/vec2 but that has an element count equal to +the number of indices specified. +

+ + +

Target-Specific Extensions

+ + +

Clang supports some language features conditionally on some targets.

+ + +

X86/X86-64 Language Extensions

+ + +

The X86 backend has these language extensions:

+ + +

Memory references off the GS segment

+ + +

Annotating a pointer with address space #256 causes it to be code generated +relative to the X86 GS segment register, and address space #257 causes it to be +relative to the X86 FS segment. Note that this is a very very low-level +feature that should only be used if you know what you're doing (for example in +an OS kernel).

+ +

Here is an example:

+ +
+#define GS_RELATIVE __attribute__((address_space(256)))
+int foo(int GS_RELATIVE *P) {
+  return *P;
+}
+
+ +

Which compiles to (on X86-32):

+ +
+_foo:
+	movl	4(%esp), %eax
+	movl	%gs:(%eax), %eax
+	ret
+
+ + +

Static Analysis-Specific Extensions

+ + +

Clang supports additional attributes that are useful for documenting program +invariants and rules for static analysis tools. The extensions documented here +are used by the path-sensitive static analyzer +engine that is part of Clang's Analysis library.

+ + +

Analyzer Attributes

+ + +

analyzer_noreturn

+ +

Clang's static analysis engine understands the standard noreturn +attribute. This attribute, which is typically affixed to a function prototype, +indicates that a call to a given function never returns. Function prototypes for +common functions like exit are typically annotated with this attribute, +as well as a variety of common assertion handlers. Users can educate the static +analyzer about their own custom assertion handles (thus cutting down on false +positives due to false paths) by marking their own "panic" functions +with this attribute.

+ +

While useful, noreturn is not applicable in all cases. Sometimes +there are special functions that for all intensive purposes should be considered +panic functions (i.e., they are only called when an internal program error +occurs) but may actually return so that the program can fail gracefully. The +analyzer_noreturn attribute allows one to annotate such functions as +being interpreted as "no return" functions by the analyzer (thus +pruning bogus paths) but will not affect compilation (as in the case of +noreturn).

+ +

Usage: The analyzer_noreturn attribute can be placed in the +same places where the noreturn attribute can be placed. It is commonly +placed at the end of function prototypes:

+ +
+  void foo() __attribute__((analyzer_noreturn));
+

+ +
+ + diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..9b706c7 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,97 @@ +##===- docs/Makefile ---------------------------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +LEVEL := ../../.. +DIRS := tools + +ifdef BUILD_FOR_WEBSITE +PROJ_OBJ_DIR = . +DOXYGEN = doxygen + +$(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in + cat $< | sed \ + -e 's/@abs_top_srcdir@/../g' \ + -e 's/@DOT@/dot/g' \ + -e 's/@PACKAGE_VERSION@/mainline/' \ + -e 's/@abs_top_builddir@/../g' > $@ +endif + +include $(LEVEL)/Makefile.common + +HTML := $(wildcard $(PROJ_SRC_DIR)/*.html) \ + $(wildcard $(PROJ_SRC_DIR)/*.css) +#IMAGES := $(wildcard $(PROJ_SRC_DIR)/img/*.*) +DOXYFILES := doxygen.cfg.in doxygen.css doxygen.footer doxygen.header \ + doxygen.intro +EXTRA_DIST := $(HTML) $(DOXYFILES) llvm.css CommandGuide img + +.PHONY: install-html install-doxygen doxygen generated + +install_targets := +ifndef ONLY_MAN_DOCS +install_targets += install-html +endif +ifeq ($(ENABLE_DOXYGEN),1) +install_targets += install-doxygen +endif +install-local:: $(install_targets) + +# Live documentation is generated for the web site using this target: +# 'make generated BUILD_FOR_WEBSITE=1' +generated:: doxygen + +install-html: $(PROJ_OBJ_DIR)/html.tar.gz + $(Echo) Installing HTML documentation + $(Verb) $(MKDIR) $(PROJ_docsdir)/html + $(Verb) $(MKDIR) $(PROJ_docsdir)/html/img + $(Verb) $(DataInstall) $(HTML) $(PROJ_docsdir)/html +# $(Verb) $(DataInstall) $(IMAGES) $(PROJ_docsdir)/html/img + $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(PROJ_docsdir) + +$(PROJ_OBJ_DIR)/html.tar.gz: $(HTML) + $(Echo) Packaging HTML documentation + $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/html.tar + $(Verb) cd $(PROJ_SRC_DIR) && \ + $(TAR) cf $(PROJ_OBJ_DIR)/html.tar *.html + $(Verb) $(GZIP) $(PROJ_OBJ_DIR)/html.tar + +install-doxygen: doxygen + $(Echo) Installing doxygen documentation + $(Verb) $(MKDIR) $(PROJ_docsdir)/html/doxygen + $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_docsdir) + $(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \ + $(FIND) . -type f -exec \ + $(DataInstall) {} $(PROJ_docsdir)/html/doxygen \; + +doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz + +regendoc: + $(Echo) Building doxygen documentation + $(Verb) if test -e $(PROJ_OBJ_DIR)/doxygen ; then \ + $(RM) -rf $(PROJ_OBJ_DIR)/doxygen ; \ + fi + $(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg + +$(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg + $(Echo) Packaging doxygen documentation + $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/doxygen.tar + $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/doxygen.tar doxygen + $(Verb) $(GZIP) $(PROJ_OBJ_DIR)/doxygen.tar + $(Verb) $(CP) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_OBJ_DIR)/doxygen/html/ + +userloc: $(LLVM_SRC_ROOT)/docs/userloc.html + +$(LLVM_SRC_ROOT)/docs/userloc.html: + $(Echo) Making User LOC Table + $(Verb) cd $(LLVM_SRC_ROOT) ; ./utils/userloc.pl -details -recurse \ + -html lib include tools runtime utils examples autoconf test > docs/userloc.html + +uninstall-local:: + $(Echo) Uninstalling Documentation + $(Verb) $(RM) -rf $(PROJ_docsdir) diff --git a/docs/PCHInternals.html b/docs/PCHInternals.html new file mode 100644 index 0000000..d90c446 --- /dev/null +++ b/docs/PCHInternals.html @@ -0,0 +1,71 @@ + + +Precompiled Headers (PCH) + + + + + + +
+ +

Precompiled Headers

+ +

This document describes the design and implementation of Clang's + precompiled headers (PCH). If you are interested in the end-user + view, please see the User's Manual.

+ +

Using precompiled headers with clang-cc

+ +

The low-level Clang compiler, clang-cc, supports two command +line options for generating and using PCH files.

+ +

To generate PCH files using clang-cc, use the option +-emit-pch: + +

 $ clang-cc test.h -emit-pch -o test.h.pch 
+ +

This option is transparently used by clang when generating +PCH files. The resulting PCH file contains the serialized form of the +compiler's internal representation after it has completed parsing and +semantic analysis. The PCH file can then be used as a prefix header +with the -include-pch option:

+ +
+  $ clang-cc -include-pch test.h.pch test.c -o test.s
+
+ +

PCH Design Philosophy

+ +

Precompiled headers are meant to improve overall compile times for + projects, so the design of precompiled headers is entirely driven by + performance concerns. The use case for precompiled headers is + relatively simple: when there is a common set of headers that is + included in nearly every source file in the project, we + precompile that bundle of headers into a single precompiled + header (PCH file). Then, when compiling the source files in the + project, we load the PCH file first (as a prefix header), which acts + as a stand-in for that bundle of headers.

+ +

A precompiled header implementation improves performance when:

+
    +
  • Loading the PCH file is significantly faster than re-parsing the + bundle of headers stored within the PCH file. Thus, a precompiled + header design attempts to minimize the cost of reading the PCH + file. Ideally, this cost should not vary with the size of the + precompiled header file.
  • + +
  • The cost of generating the PCH file initially is not so large + that it counters the per-source-file performance improvement due to + eliminating the need to parse the bundled headers in the first + place. This is particularly important on multi-core systems, because + PCH file generation serializes the build when all compilations + require the PCH file to be up-to-date.
  • +
+ +

More to be written...

+
+ + + diff --git a/docs/PTHInternals.html b/docs/PTHInternals.html new file mode 100644 index 0000000..832d3b0 --- /dev/null +++ b/docs/PTHInternals.html @@ -0,0 +1,177 @@ + + + Pretokenized Headers (PTH) + + + + + + + + +
+ +

Pretokenized Headers (PTH)

+ +

This document first describes the low-level +interface for using PTH and then briefly elaborates on its design and +implementation. If you are interested in the end-user view, please see the +User's Manual.

+ + +

Using Pretokenized Headers with clang-cc (Low-level Interface)

+ +

The low-level Clang compiler tool, clang-cc, supports three command +line options for generating and using PTH files.

+ +

To generate PTH files using clang-cc, use the option +-emit-pth: + +

 $ clang-cc test.h -emit-pth -o test.h.pth 
+ +

This option is transparently used by clang when generating PTH +files. Similarly, PTH files can be used as prefix headers using the +-include-pth option:

+ +
+  $ clang-cc -include-pth test.h.pth test.c -o test.s
+
+ +

Alternatively, Clang's PTH files can be used as a raw "token-cache" +(or "content" cache) of the source included by the original header +file. This means that the contents of the PTH file are searched as substitutes +for any source files that are used by clang-cc to process a +source file. This is done by specifying the -token-cache +option:

+ +
+  $ cat test.h
+  #include <stdio.h>
+  $ clang-cc -emit-pth test.h -o test.h.pth
+  $ cat test.c
+  #include "test.h"
+  $ clang-cc test.c -o test -token-cache test.h.pth
+
+ +

In this example the contents of stdio.h (and the files it includes) +will be retrieved from test.h.pth, as the PTH file is being used in +this case as a raw cache of the contents of test.h. This is a low-level +interface used to both implement the high-level PTH interface as well as to +provide alternative means to use PTH-style caching.

+ +

PTH Design and Implementation

+ +

Unlike GCC's precompiled headers, which cache the full ASTs and preprocessor +state of a header file, Clang's pretokenized header files mainly cache the raw +lexer tokens that are needed to segment the stream of characters in a +source file into keywords, identifiers, and operators. Consequently, PTH serves +to mainly directly speed up the lexing and preprocessing of a source file, while +parsing and type-checking must be completely redone every time a PTH file is +used.

+ +

Basic Design Tradeoffs

+ +

In the long term there are plans to provide an alternate PCH implementation +for Clang that also caches the work for parsing and type checking the contents +of header files. The current implementation of PCH in Clang as pretokenized +header files was motivated by the following factors:

+ +

    + +
  • Language independence: PTH files work with any language that +Clang's lexer can handle, including C, Objective-C, and (in the early stages) +C++. This means development on language features at the parsing level or above +(which is basically almost all interesting pieces) does not require PTH to be +modified.

  • + +
  • Simple design: Relatively speaking, PTH has a simple design and +implementation, making it easy to test. Further, because the machinery for PTH +resides at the lower-levels of the Clang library stack it is fairly +straightforward to profile and optimize.
  • +
+ +

Further, compared to GCC's PCH implementation (which is the dominate +precompiled header file implementation that Clang can be directly compared +against) the PTH design in Clang yields several attractive features:

+ +
    + +
  • Architecture independence: In contrast to GCC's PCH files (and +those of several other compilers), Clang's PTH files are architecture +independent, requiring only a single PTH file when building an program for +multiple architectures.

    + +

    For example, on Mac OS X one may wish to +compile a "universal binary" that runs on PowerPC, 32-bit Intel +(i386), and 64-bit Intel architectures. In contrast, GCC requires a PCH file for +each architecture, as the definitions of types in the AST are +architecture-specific. Since a Clang PTH file essentially represents a lexical +cache of header files, a single PTH file can be safely used when compiling for +multiple architectures. This can also reduce compile times because only a single +PTH file needs to be generated during a build instead of several.

  • + +
  • Reduced memory pressure: Similar to GCC, +Clang reads PTH files via the use of memory mapping (i.e., mmap). +Clang, however, memory maps PTH files as read-only, meaning that multiple +invocations of clang-cc can share the same pages in memory from a +memory-mapped PTH file. In comparison, GCC also memory maps its PCH files but +also modifies those pages in memory, incurring the copy-on-write costs. The +read-only nature of PTH can greatly reduce memory pressure for builds involving +multiple cores, thus improving overall scalability.

  • + +
  • Fast generation: PTH files can be generated in a small fraction +of the time needed to generate GCC's PCH files. Since PTH/PCH generation is a +serial operation that typically blocks progress during a build, faster +generation time leads to improved processor utilization with parallel builds on +multicore machines.

  • + +
+ +

Despite these strengths, PTH's simple design suffers some algorithmic +handicaps compared to other PCH strategies such as those used by GCC. While PTH +can greatly speed up the processing time of a header file, the amount of work +required to process a header file is still roughly linear in the size of the +header file. In contrast, the amount of work done by GCC to process a +precompiled header is (theoretically) constant (the ASTs for the header are +literally memory mapped into the compiler). This means that only the pieces of +the header file that are referenced by the source file including the header are +the only ones the compiler needs to process during actual compilation. While +GCC's particular implementation of PCH mitigates some of these algorithmic +strengths via the use of copy-on-write pages, the approach itself can +fundamentally dominate at an algorithmic level, especially when one considers +header files of arbitrary size.

+ +

There are plans to potentially implement an complementary PCH implementation +for Clang based on the lazy deserialization of ASTs. This approach would +theoretically have the same constant-time algorithmic advantages just mentioned +but would also retain some of the strengths of PTH such as reduced memory +pressure (ideal for multi-core builds).

+ +

Internal PTH Optimizations

+ +

While the main optimization employed by PTH is to reduce lexing time of +header files by caching pre-lexed tokens, PTH also employs several other +optimizations to speed up the processing of header files:

+ +
    + +
  • stat caching: PTH files cache information obtained via +calls to stat that clang-cc uses to resolve which files are +included by #include directives. This greatly reduces the overhead +involved in context-switching to the kernel to resolve included files.

  • + +
  • Fasting skipping of #ifdef...#endif chains: +PTH files record the basic structure of nested preprocessor blocks. When the +condition of the preprocessor block is false, all of its tokens are immediately +skipped instead of requiring them to be handled by Clang's +preprocessor.

  • + +
+ +
+ + diff --git a/docs/UsersManual.html b/docs/UsersManual.html new file mode 100644 index 0000000..3f48c4abe --- /dev/null +++ b/docs/UsersManual.html @@ -0,0 +1,688 @@ + + +Clang Compiler User's Manual + + + + + + + + +
+ +

Clang Compiler User's Manual

+ + + + + +

Introduction

+ + +

The Clang Compiler is an open-source compiler for the C family of programming +languages, aiming to be the best in class implementation of these languages. +Clang builds on the LLVM optimizer and code generator, allowing it to provide +high-quality optimization and code generation support for many targets. For +more general information, please see the Clang +Web Site or the LLVM Web Site.

+ +

This document describes important notes about using Clang as a compiler for +an end-user, documenting the supported features, command line options, etc. If +you are interested in using Clang to build a tool that processes code, please +see the Clang Internals Manual. If you are +interested in the Clang +Static Analyzer, please see its web page.

+ +

Clang is designed to support the C family of programming languages, which +includes C, Objective-C, C++, and Objective-C++ as well as many +dialects of those. For language-specific information, please see the +corresponding language specific section:

+ + + +

In addition to these base languages and their dialects, Clang supports a +broad variety of language extensions, which are documented in the corresponding +language section. These extensions are provided to be compatible with the GCC, +Microsoft, and other popular compilers as well as to improve functionality +through Clang-specific features. The Clang driver and language features are +intentionally designed to be as compatible with the GNU GCC compiler as +reasonably possible, easing migration from GCC to Clang. In most cases, code +"just works".

+ +

In addition to language specific features, Clang has a variety of features +that depend on what CPU architecture or operating system is being compiled for. +Please see the Target-Specific Features and +Limitations section for more details.

+ +

The rest of the introduction introduces some basic compiler terminology that is used throughout this manual +and contains a basic introduction to using Clang +as a command line compiler.

+ + +

Terminology

+ + +

Front end, parser, backend, preprocessor, undefined behavior, diagnostic, + optimizer

+ + +

Basic Usage

+ + +

Intro to how to use a C compiler for newbies.

+

+compile + link + +compile then link + +debug info + +enabling optimizations + +picking a language to use, defaults to C99 by default. Autosenses based on +extension. + +using a makefile +

+ + + +

Command Line Options

+ + +

+This section is generally an index into other sections. It does not go into +depth on the ones that are covered by other sections. However, the first part +introduces the language selection and other high level options like -c, -g, etc. +

+ + + +

Options to Control Error and Warning Messages

+ + +

-Werror: Turn warnings into errors.

+

-Werror=foo: Turn warning "foo" into an error.

+

-Wno-error=foo: Turn warning "foo" into an warning even if -Werror is + specified.

+

-Wfoo: Enable warning foo

+

-Wno-foo: Disable warning foo

+

-w: Disable all warnings.

+

-pedantic: Warn on language extensions.

+

-pedantic-errors: Error on language extensions.

+

-Wsystem-headers: Enable warnings from system headers.

+ + +

Formatting of Diagnostics

+ + +

Clang aims to produce beautiful diagnostics by default, particularly for new +users that first come to Clang. However, different people have different +preferences, and sometimes Clang is driven by another program that wants to +parse simple and consistent output, not a person. For these cases, Clang +provides a wide range of options to control the exact output format of the +diagnostics that it generates.

+ +
+ + +
-f[no-]show-column: Print column number in +diagnostic.
+
This option, which defaults to on, controls whether or not Clang prints the +column number of a diagnostic. For example, when this is enabled, Clang will +print something like:

+ +
+  test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
+  #endif bad
+         ^
+         //
+
+ +

When this is disabled, Clang will print "test.c:28: warning..." with no +column number.

+
+ + +
-f[no-]show-source-location: Print +source file/line/column information in diagnostic.
+
This option, which defaults to on, controls whether or not Clang prints the +filename, line number and column number of a diagnostic. For example, +when this is enabled, Clang will print something like:

+ +
+  test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
+  #endif bad
+         ^
+         //
+
+ +

When this is disabled, Clang will not print the "test.c:28:8: " part.

+
+ + +
-f[no-]caret-diagnostics: Print source +line and ranges from source code in diagnostic.
+
This option, which defaults to on, controls whether or not Clang prints the +source line, source ranges, and caret when emitting a diagnostic. For example, +when this is enabled, Clang will print something like:

+ +
+  test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
+  #endif bad
+         ^
+         //
+
+ +

When this is disabled, Clang will just print:

+ +
+  test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
+
+ +
+ + +
-f[no-]diagnostics-show-option: +Enable [-Woption] information in diagnostic line.
+
This option, which defaults to on, +controls whether or not Clang prints the associated warning group option name when outputting +a warning diagnostic. For example, in this output:

+ +
+  test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
+  #endif bad
+         ^
+         //
+
+ +

Passing -fno-diagnostics-show-option will prevent Clang from printing +the [-Wextra-tokens] information in the +diagnostic. This information tells you the flag needed to enable or disable the +diagnostic, either from the command line or through #pragma GCC diagnostic.

+ + + +
-f[no-]diagnostics-fixit-info: +Enable "FixIt" information in the diagnostics output.
+
This option, which defaults to on, controls whether or not Clang prints the +information on how to fix a specific diagnostic underneath it when it knows. +For example, in this output:

+ +
+  test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
+  #endif bad
+         ^
+         //
+
+ +

Passing -fno-diagnostics-fixit-info will prevent Clang from printing +the "//" line at the end of the message. This information is useful for users +who may not understand what is wrong, but can be confusing for machine +parsing.

+
+ + +
+-f[no-]diagnostics-print-source-range-info: +Print machine parsable information about source ranges.
+
This option, which defaults to off, controls whether or not Clang prints +information about source ranges in a machine parsable format after the +file/line/column number information. The information is a simple sequence of +brace enclosed ranges, where each range lists the start and end line/column +locations. For example, in this output:

+ +
+exprs.c:47:15:{47:8-47:14}{47:17-47:24}: error: invalid operands to binary expression ('int *' and '_Complex float')
+   P = (P-42) + Gamma*4;
+       ~~~~~~ ^ ~~~~~~~
+
+ +

The {}'s are generated by -fdiagnostics-print-source-range-info.

+
+ + +
+ + + + + +

Individual Warning Groups

+ + +

TODO: Generate this from tblgen. Define one anchor per warning group.

+ + +
+ + + +
-Wextra-tokens: Warn about excess tokens at + the end of a preprocessor directive.
+
This option, which defaults to on, enables warnings about extra tokens at +the end of preprocessor directives. For example:

+ +
+  test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
+  #endif bad
+         ^
+
+ +

These extra tokens are not strictly conforming, and are usually best handled +by commenting them out.

+ +

This option is also enabled by -Wfoo, -Wbar, + and -Wbaz.

+
+ +
+ + +

Language and Target-Independent Features

+ + + + +

Controlling Errors and Warnings

+ + +

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.

+ +

Controlling How Clang Displays Diagnostics

+ +

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 +the ability to print this information, and these are the options that control +it:

+ +

+

    +
  1. A file/line/column indicator that shows exactly where the diagnostic occurs + in your code [-fshow-column, -fshow-source-location].
  2. +
  3. A categorization of the diagnostic as a note, warning, error, or fatal + error.
  4. +
  5. A text string that describes what the problem is.
  6. +
  7. An option that indicates how to control the diagnostic (for diagnostics that + support it) [-fdiagnostics-show-option].
  8. +
  9. The line of source code that the issue occurs on, along with a caret and + ranges that indicate the important locations [-fcaret-diagnostics].
  10. +
  11. "FixIt" information, which is a concise explanation of how to fix the + problem (when Clang is certain it knows) [-fdiagnostics-fixit-info].
  12. +
  13. A machine-parsable representation of the ranges involved (off by + default) [-fdiagnostics-print-source-range-info].
  14. +

+ +

For more information please see Formatting of +Diagnostics.

+ +

Controlling Which Diagnostics Clang Generates

+ +

mappings: ignore, note, warning, error, fatal

+ +

+The two major classes are control from the command line and control via pragmas +in your code.

+ + +

-W flags, -pedantic, etc

+ +

pragma GCC diagnostic

+ + +

Precompiled Headers

+ + +

Precompiled +headers are a general approach employed by many compilers to reduce +compilation time. The underlying motivation of the approach is that it is +common for the same (and often large) header files to be included by +multiple source files. Consequently, compile times can often be greatly improved +by caching some of the (redundant) work done by a compiler to process headers. +Precompiled header files, which represent one of many ways to implement +this optimization, are literally files that represent an on-disk cache that +contains the vital information necessary to reduce some of the work +needed to process a corresponding header file. While details of precompiled +headers vary between compilers, precompiled headers have been shown to be a +highly effective at speeding up program compilation on systems with very large +system headers (e.g., Mac OS/X).

+ +

Clang supports an implementation of precompiled headers known as +pre-tokenized headers (PTH). Clang's pre-tokenized headers support most +of same interfaces as GCC's pre-compiled headers (as well as others) but are +completely different in their implementation. If you are interested in how +PTH is implemented, please see the PTH Internals + document.

+ +

Generating a PTH File

+ +

To generate a PTH file using Clang, one invokes Clang with +the -x <language>-header option. This mirrors the +interface in GCC for generating PCH files:

+ +
+  $ gcc -x c-header test.h -o test.h.gch
+  $ clang -x c-header test.h -o test.h.pth
+
+ +

Using a PTH File

+ +

A PTH file can then be used as a prefix header when a +-include option is passed to clang:

+ +
+  $ clang -include test.h test.c -o test
+
+ +

The clang driver will first check if a PTH file for test.h +is available; if so, the contents of test.h (and the files it includes) +will be processed from the PTH file. Otherwise, Clang falls back to +directly processing the content of test.h. This mirrors the behavior of +GCC.

+ +

NOTE: Clang does not automatically use PTH files +for headers that are directly included within a source file. For example:

+ +
+  $ clang -x c-header test.h -o test.h.pth
+  $ cat test.c
+  #include "test.h"
+  $ clang test.c -o test
+
+ +

In this example, clang will not automatically use the PTH file for +test.h since test.h was included directly in the source file +and not specified on the command line using -include.

+ + + +

C Language Features

+ + +

The support for standard C in clang is feature-complete except for the C99 +floating-point pragmas.

+ + +

Extensions supported by clang

+ + +

See clang language extensions.

+ + +

Differences between various standard modes

+ + +

clang supports the -std option, which changes what language mode clang uses. +The supported modes for C are c89, gnu89, c94, c99, gnu99 and various aliases +for those modes. If no -std option is specified, clang defaults to gnu99 mode. +

+ +

Differences between all c* and gnu* modes:

+
    +
  • c* modes define "__STRICT_ANSI__".
  • +
  • Target-specific defines not prefixed by underscores, like "linux", are +defined in gnu* modes.
  • +
  • Trigraphs default to being off in gnu* modes; they can be enabled by the +-trigraphs option.
  • +
  • The parser recognizes "asm" and "typeof" as keywords in gnu* modes; the +variants "__asm__" and "__typeof__" are recognized in all modes.
  • +
  • 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.
  • +
  • Some warnings are different.
  • +
+ +

Differences between *89 and *99 modes:

+
    +
  • The *99 modes default to implementing "inline" as specified in C99, while +the *89 modes implement the GNU version. This can be overridden for individual +functions with the __gnu_inline__ attribute.
  • +
  • Digraphs are not recognized in c89 mode.
  • +
  • The scope of names defined inside a "for", "if", "switch", "while", or "do" +statement is different. (example: "if ((struct x {int x;}*)0) {}".)
  • +
  • __STDC_VERSION__ is not defined in *89 modes.
  • +
  • "inline" is not recognized as a keyword in c89 mode.
  • +
  • "restrict" is not recognized as a keyword in *89 modes.
  • +
  • Commas are allowed in integer constant expressions in *99 modes.
  • +
  • Arrays which are not lvalues are not implicitly promoted to pointers in +*89 modes.
  • +
  • Some warnings are different.
  • +
+ +

c94 mode is identical to c89 mode except that digraphs are enabled in +c94 mode (FIXME: And __STDC_VERSION__ should be defined!).

+ + +

GCC extensions not implemented yet

+ + +

clang tries to be compatible with gcc as much as possible, but some gcc +extensions are not implemented yet:

+ +
    +
  • clang does not support __label__ +(bug 3429). This is +a relatively small feature, so it is likely to be implemented relatively +soon.
  • + +
  • clang does not support attributes on function pointers +(bug 2461). This is +a relatively important feature, so it is likely to be implemented relatively +soon.
  • + +
  • clang does not support #pragma weak +(bug 3679). Due to +the uses described in the bug, this is likely to be implemented at some +point, at least partially.
  • + +
  • clang does not support #pragma align +(bug 3811). This is a +relatively small feature, so it is likely to be implemented relatively +soon.
  • + +
  • clang does not support code generation for local variables pinned to +registers (bug 3933). +This is a relatively small feature, so it is likely to be implemented +relatively soon.
  • + +
  • clang does not support decimal floating point types (_Decimal32 and +friends) or fixed-point types (_Fract and friends); nobody has expressed +interest in these features yet, so it's hard to say when they will be +implemented.
  • + +
  • clang does not support nested functions; this is a complex feature which +is infrequently used, so it is unlikely to be implemented anytime soon.
  • + +
  • clang does not support __builtin_apply and friends; this extension requires +complex code generator support that does not currently exist in LLVM, and there +is very little demand, so it is unlikely to be implemented anytime soon.
  • + +
  • clang does not support global register variables, this is unlikely +to be implemented soon.
  • + +
  • clang does not support static initialization of flexible array +members. This appears to be a rarely used extension, but could be +implemented pending user demand.
  • + +
+ +

This is not a complete list; if you find an unsupported extension +missing from this list, please send an e-mail to cfe-dev. This list +currently excludes C++; see C++ Language Features. +Also, this list does not include bugs in mostly-implemented features; please +see the +bug tracker for known existing bugs (FIXME: Is there a section for +bug-reporting guidelines somewhere?).

+ + +

Intentionally unsupported GCC extensions

+ + +

clang does not support the gcc extension that allows variable-length arrays +in structures. This is for a few of reasons: one, it is tricky +to implement, two, the extension is completely undocumented, and three, the +extension appears to be very rarely used.

+ + +

Microsoft extensions

+ + +

clang has some experimental support for extensions from +Microsoft Visual C++; to enable it, use the -fms-extensions command-line +option. Eventually, this will be the default for Windows targets. +These extensions are not anywhere near complete, so please do not +file bugs; patches are welcome, though.

+ +
  • clang does not support the Microsoft extension where anonymous +record members can be declared using user defined typedefs.
  • + +
  • clang supports the Microsoft "#pragma pack" feature for +controlling record layout. GCC also contains support for this feature, +however where MSVC and GCC are incompatible clang follows the MSVC +definition.
  • + + +

    Objective-C Language Features

    + + + + +

    Intentional Incompatibilities with GCC

    + + +

    No cast of super, no lvalue casts.

    + + + + +

    C++ Language Features

    + + +

    At this point, Clang C++ is not generally useful. However, Clang C++ support +is under active development and is progressing rapidly. Please see the C++ Status page for details or +ask on the mailing list about how you can help.

    + +

    Note that the clang driver will refuse to even try to use clang to compile +C++ code unless you pass the -ccc-clang-cxx option to the driver. If +you really want to play with Clang's C++ support, please pass that flag.

    + + +

    Objective C++ Language Features

    + + +

    At this point, Clang C++ support is not generally useful (and therefore, +neither is Objective-C++). Please see the C++ section for +more information.

    + + +

    Target-Specific Features and Limitations

    + + + + +

    CPU Architectures Features and Limitations

    + + + +

    X86

    + + + + +

    Operating System Features and Limitations

    + + + +

    Darwin (Mac OS/X)

    + + +

    No __thread support, 64-bit ObjC support requires SL tools.

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

    clang API Documentation

    diff --git a/docs/doxygen.intro b/docs/doxygen.intro new file mode 100644 index 0000000..accab72 --- /dev/null +++ b/docs/doxygen.intro @@ -0,0 +1,15 @@ +/// @mainpage clang +/// +/// @section main_intro Introduction +/// Welcome to the clang project. +/// +/// This documentation describes the @b internal software that makes +/// up clang, not the @b external use of clang. There are no instructions +/// here on how to use clang, only the APIs that make up the software. For +/// usage instructions, please see the programmer's guide or reference +/// manual. +/// +/// @section main_caveat Caveat +/// This documentation is generated directly from the source code with doxygen. +/// Since clang is constantly under active development, what you're about to +/// read is out of date! diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..d741b68 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,4 @@ +'clang' C frontend documentation + +None yet, sorry :( + diff --git a/docs/tools/Makefile b/docs/tools/Makefile new file mode 100644 index 0000000..90eb776 --- /dev/null +++ b/docs/tools/Makefile @@ -0,0 +1,112 @@ +##===- docs/tools/Makefile ---------------------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +ifdef BUILD_FOR_WEBSITE + +# FIXME: This was copied from the CommandGuide makefile. Figure out +# how to get this stuff on the website. + +# This special case is for keeping the CommandGuide on the LLVM web site +# up to date automatically as the documents are checked in. It must build +# the POD files to HTML only and keep them in the src directories. It must also +# build in an unconfigured tree, hence the ifdef. To use this, run +# make -s BUILD_FOR_WEBSITE=1 inside the cvs commit script. +SRC_DOC_DIR= +DST_HTML_DIR=html/ +DST_MAN_DIR=man/man1/ +DST_PS_DIR=ps/ + +# If we are in BUILD_FOR_WEBSITE mode, default to the all target. +all:: html man ps + +clean: + rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS) + +# To create other directories, as needed, and timestamp their creation +%/.dir: + -mkdir $* > /dev/null + date > $@ + +else + +# Otherwise, if not in BUILD_FOR_WEBSITE mode, use the project info. +LEVEL := ../../../.. +include $(LEVEL)/Makefile.common + +SRC_DOC_DIR=$(PROJ_SRC_DIR)/ +DST_HTML_DIR=$(PROJ_OBJ_DIR)/ +DST_MAN_DIR=$(PROJ_OBJ_DIR)/ +DST_PS_DIR=$(PROJ_OBJ_DIR)/ + +endif + + +POD := $(wildcard $(SRC_DOC_DIR)*.pod) +HTML := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_HTML_DIR)%.html, $(POD)) +MAN := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_MAN_DIR)%.1, $(POD)) +PS := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_PS_DIR)%.ps, $(POD)) + +ifdef ONLY_MAN_DOCS +INSTALL_TARGETS := install-man +else +INSTALL_TARGETS := install-html install-man install-ps +endif + +.SUFFIXES: +.SUFFIXES: .html .pod .1 .ps + +$(DST_HTML_DIR)%.html: %.pod $(DST_HTML_DIR)/.dir + pod2html --css=manpage.css --htmlroot=. \ + --podpath=. --infile=$< --outfile=$@ --title=$* + +$(DST_MAN_DIR)%.1: %.pod $(DST_MAN_DIR)/.dir + pod2man --release "clang 1.0" --center="Clang Tools Documentation" $< $@ + +$(DST_PS_DIR)%.ps: $(DST_MAN_DIR)%.1 $(DST_PS_DIR)/.dir + groff -Tps -man $< > $@ + + +html: $(HTML) +man: $(MAN) +ps: $(PS) + +EXTRA_DIST := $(POD) + +clean-local:: + $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS) + +HTML_DIR := $(PROJ_docsdir)/html/clang +MAN_DIR := $(PROJ_mandir)/man1 +PS_DIR := $(PROJ_docsdir)/ps + +install-html:: $(HTML) + $(Echo) Installing HTML Clang Tools Documentation + $(Verb) $(MKDIR) $(HTML_DIR) + $(Verb) $(DataInstall) $(HTML) $(HTML_DIR) + $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/manpage.css $(HTML_DIR) + +install-man:: $(MAN) + $(Echo) Installing MAN Clang Tools Documentation + $(Verb) $(MKDIR) $(MAN_DIR) + $(Verb) $(DataInstall) $(MAN) $(MAN_DIR) + +install-ps:: $(PS) + $(Echo) Installing PS Clang Tools Documentation + $(Verb) $(MKDIR) $(PS_DIR) + $(Verb) $(DataInstall) $(PS) $(PS_DIR) + +install-local:: $(INSTALL_TARGETS) + +uninstall-local:: + $(Echo) Uninstalling Clang Tools Documentation + $(Verb) $(RM) -rf $(HTML_DIR) $(MAN_DIR) $(PS_DIR) + +printvars:: + $(Echo) "POD : " '$(POD)' + $(Echo) "HTML : " '$(HTML)' diff --git a/docs/tools/clang.pod b/docs/tools/clang.pod new file mode 100644 index 0000000..c520f93 --- /dev/null +++ b/docs/tools/clang.pod @@ -0,0 +1,514 @@ +=pod + +=head1 NAME + +clang - the Clang C and Objective-C compiler + +=head1 SYNOPSIS + +B [B<-c>|B<-S>|B<-E>] B<-std=>I B<-g> + [B<-O0>|B<-O1>|B<-O2>|B<-Os>|B<-O3>|B<-O4>] + B<-W>I B<-pedantic> + B<-I>I B<-L>I + B<-D>I + B<-f>I + B<-m>I + B<-o> I + I + +=head1 DESCRIPTION + +B is a C and Objective-C compiler which encompasses preprocessing, +parsing, optimization, code generation, assembly, and linking. Depending on +which high-level mode setting is passed, Clang will stop before doing a full +link. While Clang is highly integrated, it is important to understand the +stages of compilation, to understand how to invoke it. These stages are: + +=over + +=item B + +The B executable is actually a small driver which controls the overall +execution of other tools such as the compiler, assembler and linker. Typically +you do not need to interact with the driver, but you transparently use it to run +the other tools. + +=item B + +This stage handles tokenization of the input source file, macro expansion, +#include expansion and handling of other preprocessor directives. The output of +this stage is typically called a ".i" (for C) or ".mi" (for Objective-C) file. + +=item B + +This stage parses the input file, translating preprocessor tokens into a parse +tree. Once in the form of a parser tree, it applies semantic analysis to compute +types for expressions as well and determine whether the code is well formed. This +stage is responsible for generating most of the compiler warnings as well as +parse errors. The output of this stage is an "Abstract Syntax Tree" (AST). + +=item B + +This stage translates an AST into low-level intermediate code (known as "LLVM +IR") and ultimately to machine code (depending on the optimization level). This +phase is responsible for optimizing the generated code and handling +target-specfic code generation. The output of this stage is typically called a +".s" file or "assembly" file. + +=item B + +This stage runs the target assembler to translate the output of the compiler +into a target object file. The output of this stage is typically called a ".o" +file or "object" file. + +=item B + +This stage runs the target linker to merge multiple object files into an +executable or dynamic library. The output of this stage is typically called an +"a.out", ".dylib" or ".so" file. + +=back + +The Clang compiler supports a large number of options to control each of these +stages. In addition to compilation of code, Clang also supports other tools: + +B + +The Clang Static Analyzer is a tool that scans source code to try to find bugs +though code analysis. This tool uses many parts of Clang and is built into the +same driver. + + +=head1 OPTIONS + +=head2 Stage Selection Options + +=over + +=item B<-E> + +Run the preprocessor stage. + +=item B<-fsyntax-only> + +Run the preprocessor, parser and type checking stages. + +=item B<-S> + +Run the previous stages as well as LLVM generation and optimization stages and +target-specific code generation, producing an assembly file. + +=item B<-c> + +Run all of the above, plus the assembler, generating a target ".o" object file. + +=item B + +If no stage selection option is specified, all stages above are run, and the +linker is run to combine the results into an executable or shared library. + +=item B<--analyze> + +Run the Clang Static Analyzer. + +=back + + + +=head2 Language Selection and Mode Options + +=over + +=item B<-x> I + +Treat subsequent input files as having type I. + +=item B<-std>=I + +Specify the language standard to compile for. + +=item B<-ansi> + +Same as B<-std=c89>. + +=item B<-ObjC++> + +Treat source input files as Objective-C++ inputs. + +=item B<-ObjC> + +Treat source input files as Objective-C inputs. + +=item B<-trigraphs> + +Enable trigraphs. + +=item B<-ffreestanding> + +Indicate that the file should be compiled for a freestanding, not a hosted, +environment. + +=item B<-fno-builtin> + +Disable special handling and optimizations of builtin functions like strlen and +malloc. + +=item B<-fmath-errno> + +Indicate that math functions should be treated as updating errno. + +=item B<-fpascal-strings> + +Enable support for Pascal-style strings with "\pfoo". + +=item B<-fms-extensions> + +Enable support for Microsoft extensions. + +=item B<-fwritable-strings> + +Make all string literals default to writable. This disables uniquing of +strings and other optimizations. + +=item B<-flax-vector-conversions> + +Allow loose type checking rules for implicit vector conversions. + +=item B<-fblocks> + +Enable the "Blocks" language feature. + + +=item B<-fobjc-gc-only> + +Indicate that Objective-C code should be compiled in GC-only mode, which only +works when Objective-C Garbage Collection is enabled. + +=item B<-fobjc-gc> + +Indicate that Objective-C code should be compiled in hybrid-GC mode, which works +with both GC and non-GC mode. + +=back + + + +=head2 Target Selection Options + +Clang fully supports cross compilation as an inherent part of its design. +Depending on how your version of Clang is configured, it may have support for +a number of cross compilers, or may only support a native target. + +=over + +=item B<-arch> I + +Specify the architecture to build for. + +=item B<-mmacosx-version-min>=I + +When building for Mac OS/X, specify the minimum version supported by your +application. + +=item B<-miphoneos-version-min> + +When building for iPhone OS, specify the minimum version supported by your +application. + + +=item B<-march>=I + +Specify that Clang should generate code for a specific processor family member +and later. For example, if you specify -march=i486, the compiler is allowed to +generate instructions that are valid on i486 and later processors, but which +may not exist on earlier ones. + +=back + + +=head2 Code Generation Options + +=over + +=item B<-O0> B<-O1> B<-O2> B<-Os> B<-O3> B<-O4> + +Specify which optimization level to use. B<-O0> means "no optimization": this +level compiles the fastest and generates the most debuggable code. B<-O2> is a +moderate level of optimization which enables most optimizations. B<-Os> is like +B<-O2> with extra optimizations to reduce code size. B<-O3> is like B<-O2>, +except that it enables optimizations that take longer to perform or that may +generate larger code (in an attempt to make the program run faster). On +supported platforms, B<-O4> enables link-time optimization; object files are +stored in the LLVM bitcode file format and whole program optimization is done at +link time. B<-O1> is somewhere between B<-O0> and B<-O2>. + +=item B<-g> + +Generate debug information. Note that Clang debug information works best at +B<-O0>. At higher optimization levels, only line number information is +currently available. + +=item B<-fexceptions> + +Enable generation of unwind information, this allows exceptions to be thrown +through Clang compiled stack frames. This is on by default in x86-64. + +=item B<-ftrapv> + +Generate code to catch integer overflow errors. Signed integer overflow is +undefined in C, with this flag, extra code is generated to detect this and abort +when it happens. + + +=item B<-fvisibility> + +This flag sets the default visibility level. + +=item B<-fcommon> + +This flag specifies that variables without initializers get common linkage. It +can be disabled with B<-fno-common>. + +=item B<-flto> B<-emit-llvm> + +Generate output files in LLVM formats, suitable for link time optimization. When +used with B<-S> this generates LLVM intermediate language assembly files, +otherwise this generates LLVM bitcode format object files (which may be passed +to the linker depending on the stage selection options). + +=cut + +##=item B<-fnext-runtime> B<-fobjc-nonfragile-abi> B<-fgnu-runtime> +##These options specify which Objective-C runtime the code generator should +##target. FIXME: we don't want people poking these generally. + +=pod + +=back + + +=head2 Driver Options + +=over + +=item B<-###> + +Print the commands to run for this compilation. + +=item B<--help> + +Display available options. + +=item B<-Qunused-arguments> + +Don't emit warning for unused driver arguments. + +=item B<-Wa,>I + +Pass the comma separated arguments in I to the assembler. + +=item B<-Wl,>I + +Pass the comma separated arguments in I to the linker. + +=item B<-Wp,>I + +Pass the comma separated arguments in I to the preprocessor. + +=item B<-Xanalyzer> I + +Pass I to the static analyzer. + +=item B<-Xassembler> I + +Pass I to the assembler. + +=item B<-Xclang> I + +Pass I to the clang compiler. + +=item B<-Xlinker> I + +Pass I to the linker. + +=item B<-Xpreprocessor> I + +Pass I to the preprocessor. + +=item B<-o> I + +Write output to I. + +=item B<-print-file-name>=I + +Print the full library path of I. + +=item B<-print-libgcc-file-name> + +Print the library path for "libgcc.a". + +=item B<-print-prog-name>=I + +Print the full program path of I. + +=item B<-print-search-dirs> + +Print the paths used for finding libraries and programs. + +=item B<-save-temps> + +Save intermediate compilation results. + +=item B<-time> + +Time individual commands. + +=item B<-ftime-report> + +Print timing summary of each stage of compilation. + +=item B<-v> + +Show commands to run and use verbose output. + +=back + + +=head2 Diagnostics Options + +=over + +=item +B<-fshow-column> +B<-fshow-source-location> +B<-fcaret-diagnostics> +B<-fdiagnostics-fixit-info> +B<-fdiagnostics-print-source-range-info> +B<-fprint-source-range-info> +B<-fdiagnostics-show-option> +B<-fmessage-length> + +These options control how Clang prints out information about diagnostics (errors +and warnings). Please see the Clang User's Manual for more information. + +=back + + +=head2 Preprocessor Options + +=over + +=item B<-D>I + +Adds an implicit #define into the predefines buffer which is read before the +source file is preprocessed. + +=item B<-U>I + +Adds an implicit #undef into the predefines buffer which is read before the +source file is preprocessed. + +=item B<-include> I + +Adds an implicit #include into the predefines buffer which is read before the +source file is preprocessed. + +=item B<-I>I + +Add the specified directory to the search path for include files. + +=item B<-F>I + +Add the specified directory to the search path for framework include files. + +=item B<-nostdinc> + +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 +=item B<-iquote>I +=item B<-isystem>I +=item B<-iprefix>I +=item B<-iwithprefix>I +=item B<-iwithprefixbefore>I +=item B<-isysroot> +=pod + + +=back + + + +=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 + +=pod + + +=head1 ENVIRONMENT + +=over + +=item B, B, B + +These environment variables are checked, in order, for the location to +write temporary files used during the compilation process. + +=item B + +If this environment variable is present, it is treated as a delimited +list of paths to be added to the default system include path list. The +delimiter is the platform dependent delimitor, as used in the I +environment variable. + +Empty components in the environment variable are ignored. + +=item B, B, B, +B + +These environment variables specify additional paths, as for CPATH, +which are only used when processing the appropriate language. + +=item B + +If -mmacosx-version-min is unspecified, the default deployment target +is read from this environment variable. This option only affects darwin +targets. + +=back + +=head1 BUGS + +Clang currently does not have C++ support, and this manual page is incomplete. +To report bugs, please visit L. Most bug reports should +include preprocessed source files (use the B<-E> option) and the full output of +the compiler, along with information to reproduce. + +=head1 SEE ALSO + + as(1), ld(1) + +=head1 AUTHOR + +Maintained by the Clang / LLVM Team (L). + +=cut diff --git a/docs/tools/manpage.css b/docs/tools/manpage.css new file mode 100644 index 0000000..c922564 --- /dev/null +++ b/docs/tools/manpage.css @@ -0,0 +1,256 @@ +/* Based on http://www.perldoc.com/css/perldoc.css */ + +@import url("../llvm.css"); + +body { font-family: Arial,Helvetica; } + +blockquote { margin: 10pt; } + +h1, a { color: #336699; } + + +/*** Top menu style ****/ +.mmenuon { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #ff6600; font-size: 10pt; +} +.mmenuoff { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #ffffff; font-size: 10pt; +} +.cpyright { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #ffffff; font-size: xx-small; +} +.cpyrightText { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #ffffff; font-size: xx-small; +} +.sections { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: 11pt; +} +.dsections { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: 12pt; +} +.slink { + font-family: Arial,Helvetica; font-weight: normal; text-decoration: none; + color: #000000; font-size: 9pt; +} + +.slink2 { font-family: Arial,Helvetica; text-decoration: none; color: #336699; } + +.maintitle { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: 18pt; +} +.dblArrow { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: small; +} +.menuSec { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: small; +} + +.newstext { + font-family: Arial,Helvetica; font-size: small; +} + +.linkmenu { + font-family: Arial,Helvetica; color: #000000; font-weight: bold; + text-decoration: none; +} + +P { + font-family: Arial,Helvetica; +} + +PRE { + font-size: 10pt; +} +.quote { + font-family: Times; text-decoration: none; + color: #000000; font-size: 9pt; font-style: italic; +} +.smstd { font-family: Arial,Helvetica; color: #000000; font-size: x-small; } +.std { font-family: Arial,Helvetica; color: #000000; } +.meerkatTitle { + font-family: sans-serif; font-size: x-small; color: black; } + +.meerkatDescription { font-family: sans-serif; font-size: 10pt; color: black } +.meerkatCategory { + font-family: sans-serif; font-size: 9pt; font-weight: bold; font-style: italic; + color: brown; } +.meerkatChannel { + font-family: sans-serif; font-size: 9pt; font-style: italic; color: brown; } +.meerkatDate { font-family: sans-serif; font-size: xx-small; color: #336699; } + +.tocTitle { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #333333; font-size: 10pt; +} + +.toc-item { + font-family: Arial,Helvetica; font-weight: bold; + color: #336699; font-size: 10pt; text-decoration: underline; +} + +.perlVersion { + font-family: Arial,Helvetica; font-weight: bold; + color: #336699; font-size: 10pt; text-decoration: none; +} + +.podTitle { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #000000; +} + +.docTitle { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #000000; font-size: 10pt; +} +.dotDot { + font-family: Arial,Helvetica; font-weight: bold; + color: #000000; font-size: 9pt; +} + +.docSec { + font-family: Arial,Helvetica; font-weight: normal; + color: #333333; font-size: 9pt; +} +.docVersion { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: 10pt; +} + +.docSecs-on { + font-family: Arial,Helvetica; font-weight: normal; text-decoration: none; + color: #ff0000; font-size: 10pt; +} +.docSecs-off { + font-family: Arial,Helvetica; font-weight: normal; text-decoration: none; + color: #333333; font-size: 10pt; +} + +h2 { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: medium; +} +h1 { + font-family: Verdana,Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: large; +} + +DL { + font-family: Arial,Helvetica; font-weight: normal; text-decoration: none; + color: #333333; font-size: 10pt; +} + +UL > LI > A { + font-family: Arial,Helvetica; font-weight: bold; + color: #336699; font-size: 10pt; +} + +.moduleInfo { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #333333; font-size: 11pt; +} + +.moduleInfoSec { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: 10pt; +} + +.moduleInfoVal { + font-family: Arial,Helvetica; font-weight: normal; text-decoration: underline; + color: #000000; font-size: 10pt; +} + +.cpanNavTitle { + font-family: Arial,Helvetica; font-weight: bold; + color: #ffffff; font-size: 10pt; +} +.cpanNavLetter { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #333333; font-size: 9pt; +} +.cpanCat { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: 9pt; +} + +.bttndrkblue-bkgd-top { + background-color: #225688; + background-image: url(/global/mvc_objects/images/bttndrkblue_bgtop.gif); +} +.bttndrkblue-bkgd-left { + background-color: #225688; + background-image: url(/global/mvc_objects/images/bttndrkblue_bgleft.gif); +} +.bttndrkblue-bkgd { + padding-top: 0px; + padding-bottom: 0px; + margin-bottom: 0px; + margin-top: 0px; + background-repeat: no-repeat; + background-color: #225688; + background-image: url(/global/mvc_objects/images/bttndrkblue_bgmiddle.gif); + vertical-align: top; +} +.bttndrkblue-bkgd-right { + background-color: #225688; + background-image: url(/global/mvc_objects/images/bttndrkblue_bgright.gif); +} +.bttndrkblue-bkgd-bottom { + background-color: #225688; + background-image: url(/global/mvc_objects/images/bttndrkblue_bgbottom.gif); +} +.bttndrkblue-text a { + color: #ffffff; + text-decoration: none; +} +a.bttndrkblue-text:hover { + color: #ffDD3C; + text-decoration: none; +} +.bg-ltblue { + background-color: #f0f5fa; +} + +.border-left-b { + background: #f0f5fa url(/i/corner-leftline.gif) repeat-y; +} + +.border-right-b { + background: #f0f5fa url(/i/corner-rightline.gif) repeat-y; +} + +.border-top-b { + background: #f0f5fa url(/i/corner-topline.gif) repeat-x; +} + +.border-bottom-b { + background: #f0f5fa url(/i/corner-botline.gif) repeat-x; +} + +.border-right-w { + background: #ffffff url(/i/corner-rightline.gif) repeat-y; +} + +.border-top-w { + background: #ffffff url(/i/corner-topline.gif) repeat-x; +} + +.border-bottom-w { + background: #ffffff url(/i/corner-botline.gif) repeat-x; +} + +.bg-white { + background-color: #ffffff; +} + +.border-left-w { + background: #ffffff url(/i/corner-leftline.gif) repeat-y; +} diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt new file mode 100644 index 0000000..253a09b --- /dev/null +++ b/include/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(clang) diff --git a/include/Makefile b/include/Makefile new file mode 100644 index 0000000..47daabc --- /dev/null +++ b/include/Makefile @@ -0,0 +1,4 @@ +LEVEL = ../../.. +DIRS := clang + +include $(LEVEL)/Makefile.common diff --git a/include/clang/AST/APValue.h b/include/clang/AST/APValue.h new file mode 100644 index 0000000..5d5abfe --- /dev/null +++ b/include/clang/AST/APValue.h @@ -0,0 +1,253 @@ +//===--- APValue.h - Union class for APFloat/APSInt/Complex -----*- 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 APValue class. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_APVALUE_H +#define LLVM_CLANG_AST_APVALUE_H + +#include "llvm/ADT/APSInt.h" +#include "llvm/ADT/APFloat.h" + +namespace clang { + class Expr; + +/// APValue - This class implements a discriminated union of [uninitialized] +/// [APSInt] [APFloat], [Complex APSInt] [Complex APFloat], [Expr + Offset]. +class APValue { + typedef llvm::APSInt APSInt; + typedef llvm::APFloat APFloat; +public: + enum ValueKind { + Uninitialized, + Int, + Float, + ComplexInt, + ComplexFloat, + LValue, + Vector + }; +private: + ValueKind Kind; + + 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; + }; + struct Vec { + APValue *Elts; + unsigned NumElts; + Vec() : Elts(0), NumElts(0) {} + ~Vec() { delete[] Elts; } + }; + + enum { + 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*)]; + +public: + APValue() : Kind(Uninitialized) {} + explicit APValue(const APSInt &I) : Kind(Uninitialized) { + MakeInt(); setInt(I); + } + explicit APValue(const APFloat &F) : Kind(Uninitialized) { + MakeFloat(); setFloat(F); + } + explicit APValue(const APValue *E, unsigned N) : Kind(Uninitialized) { + MakeVector(); setVector(E, N); + } + APValue(const APSInt &R, const APSInt &I) : Kind(Uninitialized) { + MakeComplexInt(); setComplexInt(R, I); + } + APValue(const APFloat &R, const APFloat &I) : Kind(Uninitialized) { + MakeComplexFloat(); setComplexFloat(R, I); + } + APValue(const APValue &RHS) : Kind(Uninitialized) { + *this = RHS; + } + APValue(Expr* B, uint64_t O) : Kind(Uninitialized) { + MakeLValue(); setLValue(B, O); + } + ~APValue() { + MakeUninit(); + } + + ValueKind getKind() const { return Kind; } + bool isUninit() const { return Kind == Uninitialized; } + bool isInt() const { return Kind == Int; } + bool isFloat() const { return Kind == Float; } + bool isComplexInt() const { return Kind == ComplexInt; } + 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; + } + const APSInt &getInt() const { + return const_cast(this)->getInt(); + } + + APFloat &getFloat() { + assert(isFloat() && "Invalid accessor"); + return *(APFloat*)(void*)Data; + } + const APFloat &getFloat() const { + return const_cast(this)->getFloat(); + } + + APValue &getVectorElt(unsigned i) const { + assert(isVector() && "Invalid accessor"); + return ((Vec*)(void*)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; + } + const APSInt &getComplexIntReal() const { + return const_cast(this)->getComplexIntReal(); + } + + APSInt &getComplexIntImag() { + assert(isComplexInt() && "Invalid accessor"); + return ((ComplexAPSInt*)(void*)Data)->Imag; + } + const APSInt &getComplexIntImag() const { + return const_cast(this)->getComplexIntImag(); + } + + APFloat &getComplexFloatReal() { + assert(isComplexFloat() && "Invalid accessor"); + return ((ComplexAPFloat*)(void*)Data)->Real; + } + const APFloat &getComplexFloatReal() const { + return const_cast(this)->getComplexFloatReal(); + } + + APFloat &getComplexFloatImag() { + assert(isComplexFloat() && "Invalid accessor"); + return ((ComplexAPFloat*)(void*)Data)->Imag; + } + const APFloat &getComplexFloatImag() const { + return const_cast(this)->getComplexFloatImag(); + } + + Expr* getLValueBase() const { + assert(isLValue() && "Invalid accessor"); + return ((const LV*)(const void*)Data)->Base; + } + uint64_t getLValueOffset() const { + assert(isLValue() && "Invalid accessor"); + return ((const LV*)(const void*)Data)->Offset; + } + + void setInt(const APSInt &I) { + assert(isInt() && "Invalid accessor"); + *(APSInt*)(void*)Data = I; + } + void setFloat(const APFloat &F) { + assert(isFloat() && "Invalid accessor"); + *(APFloat*)(void*)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; + for (unsigned i = 0; i != N; ++i) + ((Vec*)(void*)Data)->Elts[i] = E[i]; + } + void setComplexInt(const APSInt &R, const APSInt &I) { + assert(R.getBitWidth() == I.getBitWidth() && + "Invalid complex int (type mismatch)."); + assert(isComplexInt() && "Invalid accessor"); + ((ComplexAPSInt*)(void*)Data)->Real = R; + ((ComplexAPSInt*)(void*)Data)->Imag = I; + } + void setComplexFloat(const APFloat &R, const APFloat &I) { + assert(&R.getSemantics() == &I.getSemantics() && + "Invalid complex float (type mismatch)."); + assert(isComplexFloat() && "Invalid accessor"); + ((ComplexAPFloat*)(void*)Data)->Real = R; + ((ComplexAPFloat*)(void*)Data)->Imag = I; + } + void setLValue(Expr *B, uint64_t O) { + assert(isLValue() && "Invalid accessor"); + ((LV*)(void*)Data)->Base = B; + ((LV*)(void*)Data)->Offset = O; + } + + const APValue &operator=(const APValue &RHS); + +private: + void MakeUninit(); + void MakeInt() { + assert(isUninit() && "Bad state change"); + new ((void*)Data) APSInt(1); + Kind = Int; + } + void MakeFloat() { + assert(isUninit() && "Bad state change"); + new ((APFloat*)(void*)Data) APFloat(0.0); + Kind = Float; + } + void MakeVector() { + assert(isUninit() && "Bad state change"); + new ((Vec*)(void*)Data) Vec(); + Kind = Vector; + } + void MakeComplexInt() { + assert(isUninit() && "Bad state change"); + new ((ComplexAPSInt*)(void*)Data) ComplexAPSInt(); + Kind = ComplexInt; + } + void MakeComplexFloat() { + assert(isUninit() && "Bad state change"); + new ((ComplexAPFloat*)(void*)Data) ComplexAPFloat(); + Kind = ComplexFloat; + } + void MakeLValue() { + assert(isUninit() && "Bad state change"); + new ((LV*)(void*)Data) LV(); + Kind = LValue; + } +}; + +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/AST.h b/include/clang/AST/AST.h new file mode 100644 index 0000000..164c5fb --- /dev/null +++ b/include/clang/AST/AST.h @@ -0,0 +1,28 @@ +//===--- AST.h - "Umbrella" header for AST library --------------*- 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 interface to the AST classes. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_AST_H +#define LLVM_CLANG_AST_AST_H + +// This header exports all AST interfaces. +#include "clang/AST/ASTContext.h" +#include "clang/AST/Decl.h" +#include "clang/AST/DeclCXX.h" +#include "clang/AST/DeclObjC.h" +#include "clang/AST/DeclTemplate.h" +#include "clang/AST/Expr.h" +#include "clang/AST/ExprObjC.h" +#include "clang/AST/Type.h" +#include "clang/AST/StmtVisitor.h" + +#endif diff --git a/include/clang/AST/ASTConsumer.h b/include/clang/AST/ASTConsumer.h new file mode 100644 index 0000000..6dc7e13 --- /dev/null +++ b/include/clang/AST/ASTConsumer.h @@ -0,0 +1,81 @@ +//===--- ASTConsumer.h - Abstract interface for reading ASTs ----*- 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 ASTConsumer class. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_ASTCONSUMER_H +#define LLVM_CLANG_AST_ASTCONSUMER_H + +namespace clang { + class ASTContext; + class DeclGroupRef; + class TagDecl; + class HandleTagDeclDefinition; + class SemaConsumer; // layering violation required for safe SemaConsumer + class VarDecl; + +/// ASTConsumer - This is an abstract interface that should be implemented by +/// clients that read ASTs. This abstraction layer allows the client to be +/// independent of the AST producer (e.g. parser vs AST dump file reader, etc). +class ASTConsumer { + /// \brief Whether this AST consumer also requires information about + /// semantic analysis. + bool SemaConsumer; + + friend class SemaConsumer; + +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) {} + + /// 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. + /// + /// The variable declaration itself will be a tentative + /// definition. If it had an incomplete array type, its type will + /// have already been changed to an array of size 1. However, the + /// declaration remains a tentative definition and has not been + /// modified by the introduction of an implicit zero initializer. + virtual void CompleteTentativeDefinition(VarDecl *D) {} + + /// PrintStats - If desired, print any statistics. + virtual void PrintStats() { + } + + // Support isa/cast/dyn_cast + static bool classof(const ASTConsumer *) { return true; } +}; + +} // end namespace clang. + +#endif diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h new file mode 100644 index 0000000..e99e9f2 --- /dev/null +++ b/include/clang/AST/ASTContext.h @@ -0,0 +1,857 @@ +//===--- ASTContext.h - Context to hold long-lived AST nodes ----*- 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 ASTContext interface. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_ASTCONTEXT_H +#define LLVM_CLANG_AST_ASTCONTEXT_H + +#include "clang/Basic/IdentifierTable.h" +#include "clang/Basic/LangOptions.h" +#include "clang/AST/Attr.h" +#include "clang/AST/Builtins.h" +#include "clang/AST/Decl.h" +#include "clang/AST/NestedNameSpecifier.h" +#include "clang/AST/PrettyPrinter.h" +#include "clang/AST/TemplateName.h" +#include "clang/AST/Type.h" +#include "clang/Basic/SourceLocation.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/FoldingSet.h" +#include "llvm/ADT/OwningPtr.h" +#include "llvm/Support/Allocator.h" +#include + +namespace llvm { + struct fltSemantics; +} + +namespace clang { + class FileManager; + class ASTRecordLayout; + class Expr; + class ExternalASTSource; + class IdentifierTable; + class SelectorTable; + class SourceManager; + class TargetInfo; + // Decls + class Decl; + class ObjCPropertyDecl; + class RecordDecl; + class TagDecl; + class TranslationUnitDecl; + class TypeDecl; + class TypedefDecl; + class TemplateTypeParmDecl; + class FieldDecl; + class ObjCIvarRefExpr; + class ObjCIvarDecl; + +/// 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 { + std::vector Types; + llvm::FoldingSet ExtQualTypes; + llvm::FoldingSet ComplexTypes; + llvm::FoldingSet PointerTypes; + llvm::FoldingSet BlockPointerTypes; + llvm::FoldingSet LValueReferenceTypes; + llvm::FoldingSet RValueReferenceTypes; + llvm::FoldingSet MemberPointerTypes; + llvm::FoldingSet ConstantArrayTypes; + llvm::FoldingSet IncompleteArrayTypes; + std::vector VariableArrayTypes; + std::vector DependentSizedArrayTypes; + llvm::FoldingSet VectorTypes; + llvm::FoldingSet FunctionNoProtoTypes; + llvm::FoldingSet FunctionProtoTypes; + llvm::FoldingSet TemplateTypeParmTypes; + llvm::FoldingSet TemplateSpecializationTypes; + llvm::FoldingSet QualifiedNameTypes; + llvm::FoldingSet TypenameTypes; + llvm::FoldingSet ObjCQualifiedInterfaceTypes; + llvm::FoldingSet ObjCQualifiedIdTypes; + + llvm::FoldingSet QualifiedTemplateNames; + llvm::FoldingSet DependentTemplateNames; + + /// \brief The set of nested name specifiers. + /// + /// This set is managed by the NestedNameSpecifier class. + llvm::FoldingSet NestedNameSpecifiers; + NestedNameSpecifier *GlobalNestedNameSpecifier; + friend class NestedNameSpecifier; + + /// ASTRecordLayouts - A cache mapping from RecordDecls to ASTRecordLayouts. + /// This is lazily created. This is intentionally not serialized. + llvm::DenseMap ASTRecordLayouts; + llvm::DenseMap ObjCLayouts; + + llvm::DenseMap SignedFixedWidthIntTypes; + llvm::DenseMap 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; + + /// 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 ObjCConstantStringType; + RecordDecl *CFConstantStringTypeDecl; + + RecordDecl *ObjCFastEnumerationStateTypeDecl; + + 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; + + /// MallocAlloc/BumpAlloc - The allocator objects used to create AST objects. + bool FreeMemory; + llvm::MallocAllocator MallocAlloc; + llvm::BumpPtrAllocator BumpAlloc; +public: + TargetInfo &Target; + IdentifierTable &Idents; + SelectorTable &Selectors; + DeclarationNameTable DeclarationNames; + llvm::OwningPtr ExternalSource; + clang::PrintingPolicy PrintingPolicy; + + 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) { + if (FreeMemory) + MallocAlloc.Deallocate(Ptr); + } + const LangOptions& getLangOptions() const { return LangOpts; } + + FullSourceLoc getFullLoc(SourceLocation Loc) const { + return FullSourceLoc(Loc,SourceMgr); + } + + TranslationUnitDecl *getTranslationUnitDecl() const { return TUDecl; } + + Builtin::Context BuiltinInfo; + + // Builtin Types. + QualType VoidTy; + QualType BoolTy; + QualType CharTy; + QualType WCharTy; // [C++ 3.9.1p5], integer type in C99. + QualType SignedCharTy, ShortTy, IntTy, LongTy, LongLongTy, Int128Ty; + QualType UnsignedCharTy, UnsignedShortTy, UnsignedIntTy, UnsignedLongTy; + QualType UnsignedLongLongTy, UnsignedInt128Ty; + QualType FloatTy, DoubleTy, LongDoubleTy; + QualType FloatComplexTy, DoubleComplexTy, LongDoubleComplexTy; + QualType VoidPtrTy, NullPtrTy; + QualType OverloadTy; + QualType DependentTy; + + ASTContext(const LangOptions& LOpts, SourceManager &SM, TargetInfo &t, + IdentifierTable &idents, SelectorTable &sels, + bool FreeMemory = true, unsigned size_reserve=0, + bool InitializeBuiltins = true); + + ~ASTContext(); + + /// \brief Initialize builtins. + /// + /// Typically, this routine will be called automatically by the + /// constructor. However, in certain cases (e.g., when there is a + /// PCH file to be loaded), the constructor does not perform + /// initialization for builtins. This routine can be called to + /// perform the initialization. + void InitializeBuiltins(IdentifierTable &idents); + + /// \brief Attach an external AST source to the AST context. + /// + /// The external AST source provides the ability to load parts of + /// the abstract syntax tree as needed from some external storage, + /// e.g., a precompiled header. + void setExternalSource(llvm::OwningPtr &Source); + + /// \brief Retrieve a pointer to the external AST source associated + /// with this AST context, if any. + ExternalASTSource *getExternalSource() const { return ExternalSource.get(); } + + void PrintStats() const; + const std::vector& getTypes() const { return Types; } + + //===--------------------------------------------------------------------===// + // 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 + /// 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); + + /// 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); + + /// getBlockPointerType - Return the uniqued reference to the type for a block + /// of the specified type. + QualType getBlockPointerType(QualType T); + + /// getLValueReferenceType - Return the uniqued reference to the type for an + /// lvalue reference to the specified type. + QualType getLValueReferenceType(QualType T); + + /// getRValueReferenceType - Return the uniqued reference to the type for an + /// rvalue reference to the specified type. + QualType getRValueReferenceType(QualType T); + + /// getMemberPointerType - Return the uniqued reference to the type for a + /// member pointer to the specified type in the specified class. The class + /// is a Type because it could be a dependent name. + QualType getMemberPointerType(QualType T, const Type *Cls); + + /// getVariableArrayType - Returns a non-unique reference to the type for a + /// variable array of the specified element type. + QualType getVariableArrayType(QualType EltTy, Expr *NumElts, + ArrayType::ArraySizeModifier ASM, + unsigned EltTypeQuals); + + /// 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); + + /// getIncompleteArrayType - Returns a unique reference to the type for a + /// incomplete array of the specified element type. + QualType getIncompleteArrayType(QualType EltTy, + ArrayType::ArraySizeModifier ASM, + unsigned EltTypeQuals); + + /// getConstantArrayType - Return the unique reference to the type for a + /// constant array of the specified element type. + QualType getConstantArrayType(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); + + /// getExtVectorType - Return the unique reference to an extended vector type + /// of the specified element type and size. VectorType must be a built-in + /// type. + QualType getExtVectorType(QualType VectorType, unsigned NumElts); + + /// getFunctionNoProtoType - Return a K&R style C function type like 'int()'. + /// + QualType getFunctionNoProtoType(QualType ResultTy); + + /// getFunctionType - Return a normal function type with a typed argument + /// list. isVariadic indicates whether the argument list includes '...'. + QualType getFunctionType(QualType ResultTy, const QualType *ArgArray, + unsigned NumArgs, bool isVariadic, + unsigned TypeQuals, bool hasExceptionSpec = false, + bool hasAnyExceptionSpec = false, + unsigned NumExs = 0, const QualType *ExArray = 0); + + /// getTypeDeclType - Return the unique reference to the type for + /// the specified type declaration. + QualType getTypeDeclType(TypeDecl *Decl, TypeDecl* PrevDecl=0); + + /// 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, + IdentifierInfo *Name = 0); + + QualType getTemplateSpecializationType(TemplateName T, + const TemplateArgument *Args, + unsigned NumArgs, + QualType Canon = QualType()); + + QualType getQualifiedNameType(NestedNameSpecifier *NNS, + QualType NamedType); + QualType getTypenameType(NestedNameSpecifier *NNS, + const IdentifierInfo *Name, + QualType Canon = QualType()); + QualType getTypenameType(NestedNameSpecifier *NNS, + const TemplateSpecializationType *TemplateId, + QualType Canon = QualType()); + + /// getObjCQualifiedInterfaceType - Return a + /// ObjCQualifiedInterfaceType type for the given interface decl and + /// the conforming protocol list. + QualType getObjCQualifiedInterfaceType(ObjCInterfaceDecl *Decl, + ObjCProtocolDecl **ProtocolList, + unsigned NumProtocols); + + /// getObjCQualifiedIdType - Return an ObjCQualifiedIdType for a + /// given 'id' and conforming protocol list. + QualType getObjCQualifiedIdType(ObjCProtocolDecl **ProtocolList, + unsigned NumProtocols); + + + /// getTypeOfType - GCC extension. + QualType getTypeOfExprType(Expr *e); + QualType getTypeOfType(QualType t); + + /// getTagDeclType - Return the unique reference to the type for the + /// specified TagDecl (struct/union/class/enum) decl. + QualType getTagDeclType(TagDecl *Decl); + + /// getSizeType - Return the unique type for "size_t" (C99 7.17), defined + /// in . The sizeof operator requires this (C99 6.5.3.4p4). + QualType getSizeType() const; + + /// getWCharType - In C++, this returns the unique wchar_t type. In C99, this + /// returns a type compatible with the type defined in as defined + /// by the target. + QualType getWCharType() const { return WCharTy; } + + /// getSignedWCharType - Return the type of "signed wchar_t". + /// Used when in C++, as a GCC extension. + QualType getSignedWCharType() const; + + /// 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 . Pointer - pointer requires this (C99 6.5.6p9). + QualType getPointerDiffType() const; + + // getCFConstantStringType - Return the C structure type used to represent + // constant CFStrings. + QualType getCFConstantStringType(); + + /// Get the structure type used to representation CFStrings, or NULL + /// if it hasn't yet been built. + QualType getRawCFConstantStringType() { + if (CFConstantStringTypeDecl) + return getTagDeclType(CFConstantStringTypeDecl); + return QualType(); + } + void setCFConstantStringType(QualType T); + + // This setter/getter represents the ObjC type for an NSConstantString. + void setObjCConstantStringInterface(ObjCInterfaceDecl *Decl); + 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() { + if (ObjCFastEnumerationStateTypeDecl) + return getTagDeclType(ObjCFastEnumerationStateTypeDecl); + return QualType(); + } + + void setObjCFastEnumerationStateType(QualType T); + + /// 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, + const FieldDecl *Field=0); + + void getLegacyIntegralTypeEncoding(QualType &t) const; + + // Put the string version of type qualifiers into S. + 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, + const Decl *Container, + std::string &S); + + /// 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; } + 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; } + void setObjCClassType(QualType T); + + void setBuiltinVaListType(QualType T); + QualType getBuiltinVaListType() const { return BuiltinVaListType; } + + QualType getFixedWidthIntType(unsigned Width, bool Signed); + + TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, + bool TemplateKeyword, + TemplateDecl *Template); + + TemplateName getDependentTemplateName(NestedNameSpecifier *NNS, + const IdentifierInfo *Name); + +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

    (qualified + /// ID type). + bool isObjCObjectPointerType(QualType Ty) const; + + /// getObjCGCAttr - Returns one of GCNone, Weak or Strong objc's + /// garbage collection attribute. + /// + QualType::GCAttrTypes 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 getTypeInfo(const Type *T); + std::pair 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) { + return getTypeInfo(T).first; + } + 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) { + return getTypeInfo(T).second; + } + 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); + + /// getASTObjCImplementationLayout - Get or compute information about + /// the layout of the specified Objective-C implementation. This may + /// differ from the interface if synthesized ivars are present. + const ASTRecordLayout & + getASTObjCImplementationLayout(const ObjCImplementationDecl *D); + + void CollectObjCIvars(const ObjCInterfaceDecl *OI, + llvm::SmallVectorImpl &Fields); + + void CollectSynthesizedIvars(const ObjCInterfaceDecl *OI, + llvm::SmallVectorImpl &Ivars); + void CollectProtocolSynthesizedIvars(const ObjCProtocolDecl *PD, + llvm::SmallVectorImpl &Ivars); + + //===--------------------------------------------------------------------===// + // 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); + const Type *getCanonicalType(const Type *T) { + return T->getCanonicalTypeInternal().getTypePtr(); + } + + /// \brief Determine whether the given types are equivalent. + 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) { + T1 = getCanonicalType(T1); + T2 = getCanonicalType(T2); + 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(getCanonicalDecl((Decl *)Tag)); + } + + /// \brief Retrieves the "canonical" declaration of + + /// \brief Retrieves the "canonical" nested name specifier for a + /// given nested name specifier. + /// + /// The canonical nested name specifier is a nested name specifier + /// that uniquely identifies a type or namespace within the type + /// system. For example, given: + /// + /// \code + /// namespace N { + /// struct S { + /// template struct X { typename T* type; }; + /// }; + /// } + /// + /// template struct Y { + /// typename N::S::X::type member; + /// }; + /// \endcode + /// + /// Here, the nested-name-specifier for N::S::X:: will be + /// S::X, since 'S' and 'X' are uniquely defined + /// by declarations in the type system and the canonical type for + /// the template type parameter 'T' is template-param-0-0. + NestedNameSpecifier * + getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS); + + /// \brief Retrieves the "canonical" template name that refers to a + /// given template. + /// + /// The canonical template name is the simplest expression that can + /// be used to refer to a given template. For most templates, this + /// expression is just the template declaration itself. For example, + /// the template std::vector can be referred to via a variety of + /// names---std::vector, ::std::vector, vector (if vector is in + /// scope), etc.---but all of these names map down to the same + /// TemplateDecl, which is used to form the canonical template name. + /// + /// Dependent template names are more interesting. Here, the + /// template name could be something like T::template apply or + /// std::allocator::template rebind, where the nested name + /// specifier itself is dependent. In this case, the canonical + /// template name uses the shortest form of the dependent + /// nested-name-specifier, which itself contains all canonical + /// types, values, and templates. + TemplateName getCanonicalTemplateName(TemplateName Name); + + /// 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 + /// canonicalization, e.g. to move type qualifiers into the element type. + const ArrayType *getAsArrayType(QualType T); + const ConstantArrayType *getAsConstantArrayType(QualType T) { + return dyn_cast_or_null(getAsArrayType(T)); + } + const VariableArrayType *getAsVariableArrayType(QualType T) { + return dyn_cast_or_null(getAsArrayType(T)); + } + const IncompleteArrayType *getAsIncompleteArrayType(QualType T) { + return dyn_cast_or_null(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); + + /// 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, + /// this returns a pointer to a properly qualified element of the array. + /// + /// See C99 6.7.5.3p7 and C99 6.3.2.1p3. + QualType getArrayDecayedType(QualType T); + + /// 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. + 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. + int getFloatingTypeOrder(QualType LHS, QualType RHS); + + /// 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 typeDomain) const; + +private: + // Helper for integer ordering + unsigned getIntegerRank(Type* T); + +public: + + //===--------------------------------------------------------------------===// + // Type Compatibility Predicates + //===--------------------------------------------------------------------===// + + /// Compatibility predicates used to check assignment expressions. + bool typesAreCompatible(QualType, QualType); // C99 6.2.7p1 + bool typesAreBlockCompatible(QualType lhs, QualType rhs); + + 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; + } + 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; + } + bool isObjCSelType(QualType T) const { + assert(SelStructType && "isObjCSelType used before 'SEL' type is built"); + return T->getAsStructureType() == SelStructType; + } + + // Check the safety of assignment from LHS to RHS + bool canAssignObjCInterfaces(const ObjCInterfaceType *LHS, + const ObjCInterfaceType *RHS); + bool areComparableObjCPointerTypes(QualType LHS, QualType RHS); + + // Functions for calculating composite types + QualType mergeTypes(QualType, QualType); + QualType mergeFunctionTypes(QualType, QualType); + + //===--------------------------------------------------------------------===// + // Integer Predicates + //===--------------------------------------------------------------------===// + + // The width of an integer, as defined in C99 6.2.6.2. This is the number + // of bits in an integer type excluding any padding bits. + unsigned getIntWidth(QualType T); + + // Per C99 6.2.5p6, for every signed integer type, there is a corresponding + // unsigned integer type. This method takes a signed type, and returns the + // corresponding unsigned integer type. + QualType getCorrespondingUnsignedType(QualType T); + + //===--------------------------------------------------------------------===// + // Type Iterators. + //===--------------------------------------------------------------------===// + + typedef std::vector::iterator type_iterator; + typedef std::vector::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(); } + + //===--------------------------------------------------------------------===// + // Integer Values + //===--------------------------------------------------------------------===// + + /// MakeIntValue - Make an APSInt of the appropriate width and + /// signedness for the given \arg Value and integer \arg Type. + llvm::APSInt MakeIntValue(uint64_t Value, QualType Type) { + llvm::APSInt Res(getIntWidth(Type), !Type->isSignedIntegerType()); + Res = Value; + return Res; + } + +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, + bool ExpandPointedToStructures, + bool ExpandStructures, + const FieldDecl *Field, + bool OutermostType = false, + bool EncodingProperty = false); + + const ASTRecordLayout &getObjCLayout(const ObjCInterfaceDecl *D, + const ObjCImplementationDecl *Impl); +}; + +} // end namespace clang + +// operator new and delete aren't allowed inside namespaces. +// The throw specifications are mandated by the standard. +/// @brief Placement new for using the ASTContext's allocator. +/// +/// This placement form of operator new uses the ASTContext's allocator for +/// obtaining memory. It is a non-throwing new, which means that it returns +/// null on error. (If that is what the allocator does. The current does, so if +/// this ever changes, this operator will have to be changed, too.) +/// Usage looks like this (assuming there's an ASTContext 'Context' in scope): +/// @code +/// // Default alignment (16) +/// IntegerLiteral *Ex = new (Context) IntegerLiteral(arguments); +/// // Specific alignment +/// IntegerLiteral *Ex2 = new (Context, 8) IntegerLiteral(arguments); +/// @endcode +/// Please note that you cannot use delete on the pointer; it must be +/// deallocated using an explicit destructor call followed by +/// @c Context.Deallocate(Ptr). +/// +/// @param Bytes The number of bytes to allocate. Calculated by the compiler. +/// @param C The ASTContext that provides the allocator. +/// @param Alignment The alignment of the allocated memory (if the underlying +/// allocator supports it). +/// @return The allocated memory. Could be NULL. +inline void *operator new(size_t Bytes, clang::ASTContext &C, + size_t Alignment) throw () { + return C.Allocate(Bytes, Alignment); +} +/// @brief Placement delete companion to the new above. +/// +/// This operator is just a companion to the new above. There is no way of +/// invoking it directly; see the new operator for more details. This operator +/// is called implicitly by the compiler if a placement new expression using +/// the ASTContext throws in the object constructor. +inline void operator delete(void *Ptr, clang::ASTContext &C, size_t) + throw () { + C.Deallocate(Ptr); +} + +/// This placement form of operator new[] uses the ASTContext's allocator for +/// obtaining memory. It is a non-throwing new[], which means that it returns +/// null on error. +/// Usage looks like this (assuming there's an ASTContext 'Context' in scope): +/// @code +/// // Default alignment (16) +/// char *data = new (Context) char[10]; +/// // Specific alignment +/// char *data = new (Context, 8) char[10]; +/// @endcode +/// Please note that you cannot use delete on the pointer; it must be +/// deallocated using an explicit destructor call followed by +/// @c Context.Deallocate(Ptr). +/// +/// @param Bytes The number of bytes to allocate. Calculated by the compiler. +/// @param C The ASTContext that provides the allocator. +/// @param Alignment The alignment of the allocated memory (if the underlying +/// allocator supports it). +/// @return The allocated memory. Could be NULL. +inline void *operator new[](size_t Bytes, clang::ASTContext& C, + size_t Alignment = 16) throw () { + return C.Allocate(Bytes, Alignment); +} + +/// @brief Placement delete[] companion to the new[] above. +/// +/// This operator is just a companion to the new[] above. There is no way of +/// invoking it directly; see the new[] operator for more details. This operator +/// is called implicitly by the compiler if a placement new[] expression using +/// the ASTContext throws in the object constructor. +inline void operator delete[](void *Ptr, clang::ASTContext &C) throw () { + C.Deallocate(Ptr); +} + +#endif diff --git a/include/clang/AST/ASTDiagnostic.h b/include/clang/AST/ASTDiagnostic.h new file mode 100644 index 0000000..244ca9e --- /dev/null +++ b/include/clang/AST/ASTDiagnostic.h @@ -0,0 +1,27 @@ +//===--- DiagnosticAST.h - Diagnostics for the AST library ------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_DIAGNOSTICAST_H +#define LLVM_CLANG_DIAGNOSTICAST_H + +#include "clang/Basic/Diagnostic.h" + +namespace clang { + namespace diag { + enum { +#define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP) ENUM, +#define ASTSTART +#include "clang/Basic/DiagnosticASTKinds.inc" +#undef DIAG + NUM_BUILTIN_AST_DIAGNOSTICS + }; + } // end namespace diag +} // end namespace clang + +#endif diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h new file mode 100644 index 0000000..0427f00 --- /dev/null +++ b/include/clang/AST/Attr.h @@ -0,0 +1,506 @@ +//===--- Attr.h - Classes for representing expressions ----------*- 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 Attr interface and subclasses. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_ATTR_H +#define LLVM_CLANG_AST_ATTR_H + +#include +#include +#include +#include + +namespace clang { + class ASTContext; +} + + +// Defined in ASTContext.cpp +void *operator new(size_t Bytes, clang::ASTContext &C, + size_t Alignment = 16) throw (); + +namespace clang { + +/// Attr - This represents one attribute. +class Attr { +public: + enum Kind { + Alias, + Aligned, + AlwaysInline, + AnalyzerNoReturn, // Clang-specific. + Annotate, + AsmLabel, // Represent GCC asm label extension. + Blocks, + Cleanup, + Const, + Constructor, + DLLExport, + DLLImport, + Deprecated, + Destructor, + FastCall, + Format, + FormatArg, + GNUInline, + IBOutletKind, // Clang-specific. Use "Kind" suffix to not conflict with + NoReturn, + NoThrow, + Nodebug, + Noinline, + NonNull, + ObjCException, + ObjCNSObject, + CFReturnsRetained, // Clang/Checker-specific. + NSReturnsRetained, // Clang/Checker-specific. + Overloadable, // Clang-specific + Packed, + Pure, + Regparm, + Section, + Sentinel, + StdCall, + TransparentUnion, + Unavailable, + Unused, + Used, + Visibility, + WarnUnusedResult, + Weak, + WeakImport + }; + +private: + Attr *Next; + Kind AttrKind; + bool Inherited : 1; + +protected: + void* operator new(size_t bytes) throw() { + assert(0 && "Attrs cannot be allocated with regular 'new'."); + return 0; + } + 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; } + + Kind getKind() const { return AttrKind; } + + Attr *getNext() { return Next; } + const Attr *getNext() const { return Next; } + void setNext(Attr *next) { Next = next; } + + 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; + + // Implement isa/cast/dyncast/etc. + static bool classof(const Attr *) { return true; } +}; + +#define DEF_SIMPLE_ATTR(ATTR) \ +class ATTR##Attr : public Attr { \ +public: \ + ATTR##Attr() : Attr(ATTR) {} \ + virtual Attr *clone(ASTContext &C) const { return ::new (C) ATTR##Attr; }\ + static bool classof(const Attr *A) { return A->getKind() == ATTR; } \ + static bool classof(const ATTR##Attr *A) { return true; } \ +} + +class PackedAttr : public Attr { + unsigned Alignment; + +public: + PackedAttr(unsigned alignment) : Attr(Packed), Alignment(alignment) {} + + /// getAlignment - The specified alignment in bits. + unsigned getAlignment() const { return Alignment; } + + virtual Attr* clone(ASTContext &C) const { + return ::new (C) PackedAttr(Alignment); + } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Attr *A) { + return A->getKind() == Packed; + } + static bool classof(const PackedAttr *A) { return true; } +}; + +class AlignedAttr : public Attr { + unsigned Alignment; +public: + AlignedAttr(unsigned alignment) : Attr(Aligned), Alignment(alignment) {} + + /// 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; + } + static bool classof(const AlignedAttr *A) { return true; } +}; + +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; + } + static bool classof(const AnnotateAttr *A) { return true; } +}; + +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; + } + static bool classof(const AsmLabelAttr *A) { return true; } +}; + +DEF_SIMPLE_ATTR(AlwaysInline); + +class AliasAttr : public Attr { + std::string Aliasee; +public: + AliasAttr(const std::string &aliasee) : Attr(Alias), Aliasee(aliasee) {} + + const std::string& getAliasee() const { return Aliasee; } + + virtual Attr *clone(ASTContext &C) const { return ::new (C) AliasAttr(Aliasee); } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Attr *A) { return A->getKind() == Alias; } + static bool classof(const AliasAttr *A) { return true; } +}; + +class ConstructorAttr : public Attr { + int priority; +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 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 DestructorAttr *A) { return true; } +}; + +class GNUInlineAttr : public Attr { +public: + GNUInlineAttr() : Attr(GNUInline) {} + + virtual Attr *clone(ASTContext &C) const { return ::new (C) GNUInlineAttr; } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Attr *A) { + return A->getKind() == GNUInline; + } + static bool classof(const GNUInlineAttr *A) { return true; } +}; + +class IBOutletAttr : public Attr { +public: + IBOutletAttr() : Attr(IBOutletKind) {} + + virtual Attr *clone(ASTContext &C) const { return ::new (C) IBOutletAttr; } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Attr *A) { + return A->getKind() == IBOutletKind; + } + static bool classof(const IBOutletAttr *A) { return true; } +}; + +DEF_SIMPLE_ATTR(NoReturn); +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); } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Attr *A) { + return A->getKind() == Section; + } + static bool classof(const SectionAttr *A) { return true; } +}; + +DEF_SIMPLE_ATTR(Unavailable); +DEF_SIMPLE_ATTR(Unused); +DEF_SIMPLE_ATTR(Used); +DEF_SIMPLE_ATTR(Weak); +DEF_SIMPLE_ATTR(WeakImport); +DEF_SIMPLE_ATTR(NoThrow); +DEF_SIMPLE_ATTR(Const); +DEF_SIMPLE_ATTR(Pure); + +class NonNullAttr : public Attr { + unsigned* ArgNums; + unsigned Size; +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; + } + + typedef const unsigned *iterator; + iterator begin() const { return ArgNums; } + iterator end() const { return ArgNums + Size; } + unsigned size() const { return Size; } + + 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); } + + static bool classof(const Attr *A) { return A->getKind() == NonNull; } + static bool classof(const NonNullAttr *A) { return true; } +}; + +class FormatAttr : public Attr { + std::string Type; + int formatIdx, firstArg; +public: + FormatAttr(const std::string &type, int idx, int first) : Attr(Format), + Type(type), formatIdx(idx), firstArg(first) {} + + const std::string& getType() const { return Type; } + void setType(const std::string &type) { Type = type; } + int getFormatIdx() const { return formatIdx; } + int getFirstArg() const { return firstArg; } + + virtual Attr *clone(ASTContext &C) const { + return ::new (C) FormatAttr(Type, formatIdx, firstArg); + } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Attr *A) { return A->getKind() == Format; } + static bool classof(const FormatAttr *A) { return true; } +}; + +class FormatArgAttr : public Attr { + int formatIdx; +public: + FormatArgAttr(int idx) : Attr(FormatArg), formatIdx(idx) {} + int getFormatIdx() const { return formatIdx; } + + virtual Attr *clone(ASTContext &C) const { + return ::new (C) FormatArgAttr(formatIdx); + } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Attr *A) { return A->getKind() == FormatArg; } + static bool classof(const FormatArgAttr *A) { return true; } +}; + +class SentinelAttr : public Attr { + int sentinel, NullPos; +public: + SentinelAttr(int sentinel_val, int nullPos) : Attr(Sentinel), + sentinel(sentinel_val), NullPos(nullPos) {} + int getSentinel() const { return sentinel; } + int getNullPos() const { return NullPos; } + + virtual Attr *clone(ASTContext &C) const { + return ::new (C) SentinelAttr(sentinel, NullPos); + } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Attr *A) { return A->getKind() == Sentinel; } + static bool classof(const SentinelAttr *A) { return true; } +}; + +class VisibilityAttr : public Attr { +public: + /// @brief An enumeration for the kinds of visibility of symbols. + enum VisibilityTypes { + DefaultVisibility = 0, + HiddenVisibility, + ProtectedVisibility + }; +private: + VisibilityTypes VisibilityType; +public: + VisibilityAttr(VisibilityTypes v) : Attr(Visibility), + VisibilityType(v) {} + + VisibilityTypes getVisibility() const { return VisibilityType; } + + virtual Attr *clone(ASTContext &C) const { return ::new (C) VisibilityAttr(VisibilityType); } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Attr *A) { return A->getKind() == Visibility; } + static bool classof(const VisibilityAttr *A) { return true; } +}; + +DEF_SIMPLE_ATTR(DLLImport); +DEF_SIMPLE_ATTR(DLLExport); +DEF_SIMPLE_ATTR(FastCall); +DEF_SIMPLE_ATTR(StdCall); +DEF_SIMPLE_ATTR(TransparentUnion); +DEF_SIMPLE_ATTR(ObjCNSObject); +DEF_SIMPLE_ATTR(ObjCException); + +class OverloadableAttr : public Attr { +public: + OverloadableAttr() : Attr(Overloadable) { } + + virtual bool isMerged() const { return false; } + + virtual Attr *clone(ASTContext &C) const { + return ::new (C) OverloadableAttr; + } + + static bool classof(const Attr *A) { return A->getKind() == Overloadable; } + static bool classof(const OverloadableAttr *) { return true; } +}; + +class BlocksAttr : public Attr { +public: + enum BlocksAttrTypes { + ByRef = 0 + }; +private: + BlocksAttrTypes BlocksAttrType; +public: + BlocksAttr(BlocksAttrTypes t) : Attr(Blocks), BlocksAttrType(t) {} + + BlocksAttrTypes getType() const { return BlocksAttrType; } + + virtual Attr *clone(ASTContext &C) const { return ::new (C) BlocksAttr(BlocksAttrType); } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Attr *A) { return A->getKind() == Blocks; } + static bool classof(const BlocksAttr *A) { return true; } +}; + +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. + static bool classof(const Attr *A) { return A->getKind() == Cleanup; } + static bool classof(const CleanupAttr *A) { return true; } +}; + +DEF_SIMPLE_ATTR(Nodebug); +DEF_SIMPLE_ATTR(WarnUnusedResult); +DEF_SIMPLE_ATTR(Noinline); + +class RegparmAttr : public Attr { + unsigned NumParams; + +public: + RegparmAttr(unsigned np) : Attr(Regparm), NumParams(np) {} + + unsigned getNumParams() const { return NumParams; } + + virtual Attr *clone(ASTContext &C) const { + return ::new (C) RegparmAttr(NumParams); + } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Attr *A) { return A->getKind() == Regparm; } + static bool classof(const RegparmAttr *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/Builtins.def b/include/clang/AST/Builtins.def new file mode 100644 index 0000000..671c4bd --- /dev/null +++ b/include/clang/AST/Builtins.def @@ -0,0 +1,389 @@ +//===--- Builtins.def - Builtin function info database ----------*- 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 standard builtin function database. Users of this file +// must define the BUILTIN macro to make use of this information. +// +//===----------------------------------------------------------------------===// + +// FIXME: this needs to be the full list supported by GCC. Right now, I'm just +// adding stuff on demand. +// +// FIXME: This should really be a .td file, but that requires modifying tblgen. +// Perhaps tblgen should have plugins. + +// The first value provided to the macro specifies the function name of the +// builtin, and results in a clang::builtin::BIXX enum value for XX. + +// The second value provided to the macro specifies the type of the function +// (result value, then each argument) as follows: +// v -> void +// b -> boolean +// c -> char +// s -> short +// i -> int +// f -> float +// d -> double +// z -> size_t +// F -> constant CFString +// a -> __builtin_va_list +// A -> "reference" to __builtin_va_list +// V -> Vector, following num elements and a base type. +// P -> FILE +// . -> "...". This may only occur at the end of the function list. +// +// Types maybe prefixed with the following modifiers: +// L -> long (e.g. Li for 'long int') +// LL -> long long +// LLL -> __int128_t (e.g. LLLi) +// S -> signed +// U -> unsigned +// +// Types may be postfixed with the following modifiers: +// * -> pointer +// & -> reference +// C -> const + +// The third value provided to the macro specifies information about attributes +// of the function. These must be kept in sync with the predicates in the +// Builtin::Context class. Currently we have: +// n -> nothrow +// c -> const +// F -> this is a libc/libm function with a '__builtin_' prefix added. +// f -> this is a libc/libm function without the '__builtin_' prefix. It can +// be followed by ':headername:' to state which header this function +// comes from. +// p:N: -> this is a printf-like function whose Nth argument is the format +// string. +// P:N: -> similar to the p:N: attribute, but the function is like vprintf +// in that it accepts its arguments as a va_list rather than +// through an ellipsis +// e -> const, but only when -fmath-errno=0 +// FIXME: gcc has nonnull + +#if defined(BUILTIN) && !defined(LIBBUILTIN) +# define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) BUILTIN(ID, TYPE, ATTRS) +#endif + +// Standard libc/libm functions: +BUILTIN(__builtin_huge_val, "d", "nc") +BUILTIN(__builtin_huge_valf, "f", "nc") +BUILTIN(__builtin_huge_vall, "Ld", "nc") +BUILTIN(__builtin_inf , "d" , "nc") +BUILTIN(__builtin_inff , "f" , "nc") +BUILTIN(__builtin_infl , "Ld" , "nc") +BUILTIN(__builtin_nan, "dcC*" , "ncF") +BUILTIN(__builtin_nanf, "fcC*" , "ncF") +BUILTIN(__builtin_nanl, "LdcC*", "ncF") +BUILTIN(__builtin_nans, "dcC*" , "ncF") +BUILTIN(__builtin_nansf, "fcC*" , "ncF") +BUILTIN(__builtin_nansl, "LdcC*", "ncF") +BUILTIN(__builtin_abs , "ii" , "ncF") +BUILTIN(__builtin_fabs , "dd" , "ncF") +BUILTIN(__builtin_fabsf, "ff" , "ncF") +BUILTIN(__builtin_fabsl, "LdLd", "ncF") +BUILTIN(__builtin_copysign, "ddd", "ncF") +BUILTIN(__builtin_copysignf, "fff", "ncF") +BUILTIN(__builtin_copysignl, "LdLdLd", "ncF") +BUILTIN(__builtin_powi , "ddi" , "nc") +BUILTIN(__builtin_powif, "ffi" , "nc") +BUILTIN(__builtin_powil, "LdLdi", "nc") + +// FP Comparisons. +BUILTIN(__builtin_isgreater , "i.", "nc") +BUILTIN(__builtin_isgreaterequal, "i.", "nc") +BUILTIN(__builtin_isless , "i.", "nc") +BUILTIN(__builtin_islessequal , "i.", "nc") +BUILTIN(__builtin_islessgreater , "i.", "nc") +BUILTIN(__builtin_isunordered , "i.", "nc") + +// Builtins for arithmetic. +BUILTIN(__builtin_clz , "iUi" , "nc") +BUILTIN(__builtin_clzl , "iULi" , "nc") +BUILTIN(__builtin_clzll, "iULLi", "nc") +// TODO: int clzimax(uintmax_t) +BUILTIN(__builtin_ctz , "iUi" , "nc") +BUILTIN(__builtin_ctzl , "iULi" , "nc") +BUILTIN(__builtin_ctzll, "iULLi", "nc") +// TODO: int ctzimax(uintmax_t) +BUILTIN(__builtin_ffs , "iUi" , "nc") +BUILTIN(__builtin_ffsl , "iULi" , "nc") +BUILTIN(__builtin_ffsll, "iULLi", "nc") +BUILTIN(__builtin_parity , "iUi" , "nc") +BUILTIN(__builtin_parityl , "iULi" , "nc") +BUILTIN(__builtin_parityll, "iULLi", "nc") +BUILTIN(__builtin_popcount , "iUi" , "nc") +BUILTIN(__builtin_popcountl , "iULi" , "nc") +BUILTIN(__builtin_popcountll, "iULLi", "nc") + +// FIXME: These type signatures are not correct for targets with int != 32-bits +// or with ULL != 64-bits. +BUILTIN(__builtin_bswap32, "UiUi", "nc") +BUILTIN(__builtin_bswap64, "ULLiULLi", "nc") + +// Random GCC builtins +BUILTIN(__builtin_constant_p, "Us.", "nc") +BUILTIN(__builtin_classify_type, "i.", "nc") +BUILTIN(__builtin___CFStringMakeConstantString, "FC*cC*", "nc") +BUILTIN(__builtin_va_start, "vA.", "n") +BUILTIN(__builtin_va_end, "vA", "n") +BUILTIN(__builtin_va_copy, "vAA", "n") +BUILTIN(__builtin_stdarg_start, "vA.", "n") +BUILTIN(__builtin_bcmp, "iv*v*z", "n") +BUILTIN(__builtin_bcopy, "vv*v*z", "n") +BUILTIN(__builtin_bzero, "vv*z", "n") +BUILTIN(__builtin_memcmp, "ivC*vC*z", "nF") +BUILTIN(__builtin_memcpy, "v*v*vC*z", "nF") +BUILTIN(__builtin_memmove, "v*v*vC*z", "nF") +BUILTIN(__builtin_mempcpy, "v*v*vC*z", "nF") +BUILTIN(__builtin_memset, "v*v*iz", "nF") +BUILTIN(__builtin_stpcpy, "c*c*cC*", "nF") +BUILTIN(__builtin_stpncpy, "c*c*cC*z", "nF") +BUILTIN(__builtin_strcasecmp, "icC*cC*", "nF") +BUILTIN(__builtin_strcat, "c*c*cC*", "nF") +BUILTIN(__builtin_strchr, "c*cC*i", "nF") +BUILTIN(__builtin_strcmp, "icC*cC*", "nF") +BUILTIN(__builtin_strcpy, "c*c*cC*", "nF") +BUILTIN(__builtin_strcspn, "zcC*cC*", "nF") +BUILTIN(__builtin_strdup, "c*cC*", "nF") +BUILTIN(__builtin_strlen, "zcC*", "nF") +BUILTIN(__builtin_strncasecmp, "icC*cC*z", "nF") +BUILTIN(__builtin_strncat, "c*c*cC*z", "nF") +BUILTIN(__builtin_strncmp, "icC*cC*z", "nF") +BUILTIN(__builtin_strncpy, "c*c*cC*z", "nF") +BUILTIN(__builtin_strndup, "c*cC*z", "nF") +BUILTIN(__builtin_strpbrk, "c*cC*cC*", "nF") +BUILTIN(__builtin_strrchr, "c*cC*i", "nF") +BUILTIN(__builtin_strspn, "zcC*cC*", "nF") +BUILTIN(__builtin_strstr, "c*cC*cC*", "nF") +BUILTIN(__builtin_return_address, "v*Ui", "n") +BUILTIN(__builtin_extract_return_addr, "v*v*", "n") +BUILTIN(__builtin_frame_address, "v*Ui", "n") +BUILTIN(__builtin_flt_rounds, "i", "nc") +BUILTIN(__builtin_setjmp, "iv**", "") +BUILTIN(__builtin_longjmp, "vv**i", "") +BUILTIN(__builtin_unwind_init, "v", "") + +// GCC Object size checking builtins +BUILTIN(__builtin_object_size, "zv*i", "n") +BUILTIN(__builtin___memcpy_chk, "v*v*vC*zz", "nF") +BUILTIN(__builtin___memmove_chk, "v*v*vC*zz", "nF") +BUILTIN(__builtin___mempcpy_chk, "v*v*vC*zz", "nF") +BUILTIN(__builtin___memset_chk, "v*v*izz", "nF") +BUILTIN(__builtin___stpcpy_chk, "c*c*cC*z", "nF") +BUILTIN(__builtin___strcat_chk, "c*c*cC*z", "nF") +BUILTIN(__builtin___strcpy_chk, "c*c*cC*z", "nF") +BUILTIN(__builtin___strncat_chk, "c*c*cC*zz", "nF") +BUILTIN(__builtin___strncpy_chk, "c*c*cC*zz", "nF") +BUILTIN(__builtin___snprintf_chk, "ic*zizcC*.", "Fp:4:") +BUILTIN(__builtin___sprintf_chk, "ic*izcC*.", "Fp:3:") +BUILTIN(__builtin___vsnprintf_chk, "ic*zizcC*a", "FP:4:") +BUILTIN(__builtin___vsprintf_chk, "ic*izcC*a", "FP:3:") +BUILTIN(__builtin___fprintf_chk, "iP*icC*.", "Fp:2:") +BUILTIN(__builtin___printf_chk, "iicC*.", "Fp:1:") +BUILTIN(__builtin___vfprintf_chk, "iP*icC*a", "FP:2:") +BUILTIN(__builtin___vprintf_chk, "iicC*a", "FP:1:") + +BUILTIN(__builtin_expect, "iii" , "nc") +BUILTIN(__builtin_prefetch, "vvC*.", "nc") +BUILTIN(__builtin_trap, "v", "n") + +BUILTIN(__builtin_shufflevector, "v." , "nc") + +BUILTIN(__builtin_alloca, "v*z" , "n") + +// "Overloaded" Atomic operator builtins. These are overloaded to support data +// types of i8, i16, i32, i64, and i128. The front-end sees calls to the +// non-suffixed version of these (which has a bogus type) and transforms them to +// the right overloaded version in Sema (plus casts). + +// FIXME: These assume that char -> i8, short -> i16, int -> i32, +// long long -> i64. + +BUILTIN(__sync_fetch_and_add, "v.", "") +BUILTIN(__sync_fetch_and_add_1, "cc*c.", "n") +BUILTIN(__sync_fetch_and_add_2, "ss*s.", "n") +BUILTIN(__sync_fetch_and_add_4, "ii*i.", "n") +BUILTIN(__sync_fetch_and_add_8, "LLiLLi*LLi.", "n") +BUILTIN(__sync_fetch_and_add_16, "LLLiLLLi*LLLi.", "n") + +BUILTIN(__sync_fetch_and_sub, "v.", "") +BUILTIN(__sync_fetch_and_sub_1, "cc*c.", "n") +BUILTIN(__sync_fetch_and_sub_2, "ss*s.", "n") +BUILTIN(__sync_fetch_and_sub_4, "ii*i.", "n") +BUILTIN(__sync_fetch_and_sub_8, "LLiLLi*LLi.", "n") +BUILTIN(__sync_fetch_and_sub_16, "LLLiLLLi*LLLi.", "n") + +BUILTIN(__sync_fetch_and_or, "v.", "") +BUILTIN(__sync_fetch_and_or_1, "cc*c.", "n") +BUILTIN(__sync_fetch_and_or_2, "ss*s.", "n") +BUILTIN(__sync_fetch_and_or_4, "ii*i.", "n") +BUILTIN(__sync_fetch_and_or_8, "LLiLLi*LLi.", "n") +BUILTIN(__sync_fetch_and_or_16, "LLLiLLLi*LLLi.", "n") + +BUILTIN(__sync_fetch_and_and, "v.", "") +BUILTIN(__sync_fetch_and_and_1, "cc*c.", "n") +BUILTIN(__sync_fetch_and_and_2, "ss*s.", "n") +BUILTIN(__sync_fetch_and_and_4, "ii*i.", "n") +BUILTIN(__sync_fetch_and_and_8, "LLiLLi*LLi.", "n") +BUILTIN(__sync_fetch_and_and_16, "LLLiLLLi*LLLi.", "n") + +BUILTIN(__sync_fetch_and_xor, "v.", "") +BUILTIN(__sync_fetch_and_xor_1, "cc*c.", "n") +BUILTIN(__sync_fetch_and_xor_2, "ss*s.", "n") +BUILTIN(__sync_fetch_and_xor_4, "ii*i.", "n") +BUILTIN(__sync_fetch_and_xor_8, "LLiLLi*LLi.", "n") +BUILTIN(__sync_fetch_and_xor_16, "LLLiLLLi*LLLi.", "n") + +BUILTIN(__sync_fetch_and_nand, "v.", "") +BUILTIN(__sync_fetch_and_nand_1, "cc*c.", "n") +BUILTIN(__sync_fetch_and_nand_2, "ss*s.", "n") +BUILTIN(__sync_fetch_and_nand_4, "ii*i.", "n") +BUILTIN(__sync_fetch_and_nand_8, "LLiLLi*LLi.", "n") +BUILTIN(__sync_fetch_and_nand_16, "LLLiLLLi*LLLi.", "n") + + +BUILTIN(__sync_add_and_fetch, "v.", "") +BUILTIN(__sync_add_and_fetch_1, "cc*c.", "n") +BUILTIN(__sync_add_and_fetch_2, "ss*s.", "n") +BUILTIN(__sync_add_and_fetch_4, "ii*i.", "n") +BUILTIN(__sync_add_and_fetch_8, "LLiLLi*LLi.", "n") +BUILTIN(__sync_add_and_fetch_16, "LLLiLLLi*LLLi.", "n") + +BUILTIN(__sync_sub_and_fetch, "v.", "") +BUILTIN(__sync_sub_and_fetch_1, "cc*c.", "n") +BUILTIN(__sync_sub_and_fetch_2, "ss*s.", "n") +BUILTIN(__sync_sub_and_fetch_4, "ii*i.", "n") +BUILTIN(__sync_sub_and_fetch_8, "LLiLLi*LLi.", "n") +BUILTIN(__sync_sub_and_fetch_16, "LLLiLLLi*LLLi.", "n") + +BUILTIN(__sync_or_and_fetch, "v.", "") +BUILTIN(__sync_or_and_fetch_1, "cc*c.", "n") +BUILTIN(__sync_or_and_fetch_2, "ss*s.", "n") +BUILTIN(__sync_or_and_fetch_4, "ii*i.", "n") +BUILTIN(__sync_or_and_fetch_8, "LLiLLi*LLi.", "n") +BUILTIN(__sync_or_and_fetch_16, "LLLiLLLi*LLLi.", "n") + +BUILTIN(__sync_and_and_fetch, "v.", "") +BUILTIN(__sync_and_and_fetch_1, "cc*c.", "n") +BUILTIN(__sync_and_and_fetch_2, "ss*s.", "n") +BUILTIN(__sync_and_and_fetch_4, "ii*i.", "n") +BUILTIN(__sync_and_and_fetch_8, "LLiLLi*LLi.", "n") +BUILTIN(__sync_and_and_fetch_16, "LLLiLLLi*LLLi.", "n") + +BUILTIN(__sync_xor_and_fetch, "v.", "") +BUILTIN(__sync_xor_and_fetch_1, "cc*c.", "n") +BUILTIN(__sync_xor_and_fetch_2, "ss*s.", "n") +BUILTIN(__sync_xor_and_fetch_4, "ii*i.", "n") +BUILTIN(__sync_xor_and_fetch_8, "LLiLLi*LLi.", "n") +BUILTIN(__sync_xor_and_fetch_16, "LLLiLLLi*LLLi.", "n") + +BUILTIN(__sync_nand_and_fetch, "v.", "") +BUILTIN(__sync_nand_and_fetch_1, "cc*c.", "n") +BUILTIN(__sync_nand_and_fetch_2, "ss*s.", "n") +BUILTIN(__sync_nand_and_fetch_4, "ii*i.", "n") +BUILTIN(__sync_nand_and_fetch_8, "LLiLLi*LLi.", "n") +BUILTIN(__sync_nand_and_fetch_16, "LLLiLLLi*LLLi.", "n") + + +BUILTIN(__sync_bool_compare_and_swap, "v.", "") +BUILTIN(__sync_bool_compare_and_swap_1, "bc*cc.", "n") +BUILTIN(__sync_bool_compare_and_swap_2, "bs*ss.", "n") +BUILTIN(__sync_bool_compare_and_swap_4, "bi*ii.", "n") +BUILTIN(__sync_bool_compare_and_swap_8, "bLLi*LLi.", "n") +BUILTIN(__sync_bool_compare_and_swap_16, "bLLLi*LLLiLLLi.", "n") + +BUILTIN(__sync_val_compare_and_swap, "v.", "") +BUILTIN(__sync_val_compare_and_swap_1, "cc*cc.", "n") +BUILTIN(__sync_val_compare_and_swap_2, "ss*ss.", "n") +BUILTIN(__sync_val_compare_and_swap_4, "ii*ii.", "n") +BUILTIN(__sync_val_compare_and_swap_8, "LLiLLi*LLi.", "n") +BUILTIN(__sync_val_compare_and_swap_16, "LLLiLLLi*LLLiLLLi.", "n") + +BUILTIN(__sync_lock_test_and_set, "v.", "") +BUILTIN(__sync_lock_test_and_set_1, "cc*c.", "n") +BUILTIN(__sync_lock_test_and_set_2, "ss*s.", "n") +BUILTIN(__sync_lock_test_and_set_4, "ii*i.", "n") +BUILTIN(__sync_lock_test_and_set_8, "LLiLLi*LLi.", "n") +BUILTIN(__sync_lock_test_and_set_16, "LLLiLLLi*LLLi.", "n") + +BUILTIN(__sync_lock_release, "v.", "") +BUILTIN(__sync_lock_release_1, "vc*.", "n") +BUILTIN(__sync_lock_release_2, "vs*.", "n") +BUILTIN(__sync_lock_release_4, "vi*.", "n") +BUILTIN(__sync_lock_release_8, "vLLi*.", "n") +BUILTIN(__sync_lock_release_16, "vLLLi*.", "n") + + + +// Non-overloaded atomic builtins. +BUILTIN(__sync_synchronize, "v.", "n") +// LLVM instruction builtin [Clang extension]. +BUILTIN(__builtin_llvm_memory_barrier,"vbbbbb", "n") +// GCC does not support these, they are a Clang extension. +BUILTIN(__sync_fetch_and_min, "ii*i", "n") +BUILTIN(__sync_fetch_and_max, "ii*i", "n") +BUILTIN(__sync_fetch_and_umin, "UiUi*Ui", "n") +BUILTIN(__sync_fetch_and_umax, "UiUi*Ui", "n") + +// Builtin library functions +LIBBUILTIN(alloca, "v*z", "f", "stdlib.h") +LIBBUILTIN(calloc, "v*zz", "f", "stdlib.h") +LIBBUILTIN(malloc, "v*z", "f", "stdlib.h") +LIBBUILTIN(realloc, "v*v*z", "f", "stdlib.h") +LIBBUILTIN(memcpy, "v*v*vC*z", "f", "string.h") +LIBBUILTIN(memmove, "v*v*vC*z", "f", "string.h") +LIBBUILTIN(memset, "v*v*iz", "f", "string.h") +LIBBUILTIN(strcat, "c*c*cC*", "f", "string.h") +LIBBUILTIN(strchr, "c*cC*i", "f", "string.h") +LIBBUILTIN(strcpy, "c*c*cC*", "f", "string.h") +LIBBUILTIN(strcspn, "zcC*cC*", "f", "string.h") +LIBBUILTIN(strlen, "zcC*", "f", "string.h") +LIBBUILTIN(strncat, "c*c*cC*z", "f", "string.h") +LIBBUILTIN(strncpy, "c*c*cC*z", "f", "string.h") +LIBBUILTIN(strpbrk, "c*cC*cC*", "f", "string.h") +LIBBUILTIN(strrchr, "c*cC*i", "f", "string.h") +LIBBUILTIN(strspn, "zcC*cC*", "f", "string.h") +LIBBUILTIN(strstr, "c*cC*cC*", "f", "string.h") +LIBBUILTIN(printf, "icC*.", "fp:0:", "stdio.h") +LIBBUILTIN(fprintf, "iP*cC*.", "fp:1:", "stdio.h") +LIBBUILTIN(snprintf, "ic*zcC*.", "fp:2:", "stdio.h") +LIBBUILTIN(sprintf, "ic*cC*.", "fp:1:", "stdio.h") +LIBBUILTIN(vprintf, "icC*a", "fP:0:", "stdio.h") +LIBBUILTIN(vfprintf, "iP*cC*a", "fP:1:", "stdio.h") +LIBBUILTIN(vsnprintf, "ic*zcC*a", "fP:2:", "stdio.h") +LIBBUILTIN(vsprintf, "ic*cC*a", "fP:1:", "stdio.h") + +// FIXME: This type isn't very correct, it should be +// id objc_msgSend(id, SEL) +// but we need new type letters for that. +LIBBUILTIN(objc_msgSend, "v*.", "f", "objc/message.h") + +// FIXME: asprintf and vasprintf aren't C99 functions. Should they be +// target-specific builtins, perhaps? + +// Builtin math library functions +LIBBUILTIN(pow, "ddd", "fe", "math.h") +LIBBUILTIN(powl, "LdLdLd", "fe", "math.h") +LIBBUILTIN(powf, "fff", "fe", "math.h") + +LIBBUILTIN(sqrt, "dd", "fe", "math.h") +LIBBUILTIN(sqrtl, "LdLd", "fe", "math.h") +LIBBUILTIN(sqrtf, "ff", "fe", "math.h") + +LIBBUILTIN(sin, "dd", "fe", "math.h") +LIBBUILTIN(sinl, "LdLd", "fe", "math.h") +LIBBUILTIN(sinf, "ff", "fe", "math.h") + +LIBBUILTIN(cos, "dd", "fe", "math.h") +LIBBUILTIN(cosl, "LdLd", "fe", "math.h") +LIBBUILTIN(cosf, "ff", "fe", "math.h") + +#undef BUILTIN +#undef LIBBUILTIN diff --git a/include/clang/AST/Builtins.h b/include/clang/AST/Builtins.h new file mode 100644 index 0000000..b16d3bf --- /dev/null +++ b/include/clang/AST/Builtins.h @@ -0,0 +1,137 @@ +//===--- Builtins.h - Builtin function header -------------------*- 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 enum values for all the target-independent builtin +// functions. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_BUILTINS_H +#define LLVM_CLANG_AST_BUILTINS_H + +#include +#include +#include "llvm/ADT/SmallVector.h" + +namespace clang { + class TargetInfo; + class IdentifierTable; + class ASTContext; + class QualType; + +namespace Builtin { +enum ID { + NotBuiltin = 0, // This is not a builtin function. +#define BUILTIN(ID, TYPE, ATTRS) BI##ID, +#include "clang/AST/Builtins.def" + FirstTSBuiltin +}; + +struct Info { + const char *Name, *Type, *Attributes, *HeaderName; + bool Suppressed; + + bool operator==(const Info &RHS) const { + return !strcmp(Name, RHS.Name) && + !strcmp(Type, RHS.Type) && + !strcmp(Attributes, RHS.Attributes); + } + bool operator!=(const Info &RHS) const { return !(*this == RHS); } +}; + +/// Builtin::Context - This holds information about target-independent and +/// target-specific builtins, allowing easy queries by clients. +class Context { + const Info *TSRecords; + unsigned NumTSRecords; +public: + Context() : TSRecords(0), NumTSRecords(0) {} + + /// \brief Load all of the target builtins. This should be called + /// prior to initializing the builtin identifiers. + void InitializeTargetBuiltins(const TargetInfo &Target); + + /// InitializeBuiltins - Mark the identifiers for all the builtins with their + /// appropriate builtin ID # and mark any non-portable builtin identifiers as + /// such. + void InitializeBuiltins(IdentifierTable &Table, bool NoBuiltins = false); + + /// \brief Popular the vector with the names of all of the builtins. + void GetBuiltinNames(llvm::SmallVectorImpl &Names, + bool NoBuiltins); + + /// Builtin::GetName - Return the identifier name for the specified builtin, + /// e.g. "__builtin_abs". + const char *GetName(unsigned ID) const { + return GetRecord(ID).Name; + } + + /// isConst - Return true if this function has no side effects and doesn't + /// read memory. + bool isConst(unsigned ID) const { + return strchr(GetRecord(ID).Attributes, 'c') != 0; + } + + /// isNoThrow - Return true if we know this builtin never throws an exception. + bool isNoThrow(unsigned ID) const { + return strchr(GetRecord(ID).Attributes, 'n') != 0; + } + + /// isLibFunction - Return true if this is a builtin for a libc/libm function, + /// with a "__builtin_" prefix (e.g. __builtin_abs). + bool isLibFunction(unsigned ID) const { + return strchr(GetRecord(ID).Attributes, 'F') != 0; + } + + /// \brief Determines whether this builtin is a predefined libc/libm + /// function, such as "malloc", where we know the signature a + /// priori. + bool isPredefinedLibFunction(unsigned ID) const { + return strchr(GetRecord(ID).Attributes, 'f') != 0; + } + + /// \brief If this is a library function that comes from a specific + /// header, retrieve that header name. + const char *getHeaderName(unsigned ID) const { + return GetRecord(ID).HeaderName; + } + + /// \brief Determine whether this builtin is like printf in its + /// formatting rules and, if so, set the index to the format string + /// argument and whether this function as a va_list argument. + bool isPrintfLike(unsigned ID, unsigned &FormatIdx, bool &HasVAListArg); + + /// hasVAListUse - Return true of the specified builtin uses __builtin_va_list + /// as an operand or return type. + bool hasVAListUse(unsigned ID) const { + return strpbrk(GetRecord(ID).Type, "Aa") != 0; + } + + /// isConstWithoutErrno - Return true if this function has no side + /// effects and doesn't read memory, except for possibly errno. Such + /// functions can be const when the MathErrno lang option is + /// disabled. + bool isConstWithoutErrno(unsigned ID) const { + return strchr(GetRecord(ID).Attributes, 'e') != 0; + } + + /// GetBuiltinType - Return the type for the specified builtin. + enum GetBuiltinTypeError { + GE_None, //< No error + GE_Missing_FILE //< Missing the FILE type from + }; + QualType GetBuiltinType(unsigned ID, ASTContext &Context, + GetBuiltinTypeError &Error) const; +private: + const Info &GetRecord(unsigned ID) const; +}; + +} +} // end namespace clang +#endif diff --git a/include/clang/AST/CFG.h b/include/clang/AST/CFG.h new file mode 100644 index 0000000..7a9ee01 --- /dev/null +++ b/include/clang/AST/CFG.h @@ -0,0 +1,405 @@ +//===--- CFG.h - Classes for representing and building CFGs------*- 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 CFG and CFGBuilder classes for representing and +// building Control-Flow Graphs (CFGs) from ASTs. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_CFG_H +#define LLVM_CLANG_CFG_H + +#include "llvm/ADT/GraphTraits.h" +#include "llvm/Support/Allocator.h" +#include "llvm/Support/raw_ostream.h" +#include +#include +#include + +namespace clang { + class Stmt; + class Expr; + class CFG; + class PrinterHelper; + class BlockEdge; + +/// CFGBlock - Represents a single basic block in a source-level CFG. +/// It consists of: +/// +/// (1) A set of statements/expressions (which may contain subexpressions). +/// (2) A "terminator" statement (not in the set of statements). +/// (3) A list of successors and predecessors. +/// +/// Terminator: The terminator represents the type of control-flow that occurs +/// at the end of the basic block. The terminator is a Stmt* referring to an +/// AST node that has control-flow: if-statements, breaks, loops, etc. +/// If the control-flow is conditional, the condition expression will appear +/// within the set of statements in the block (usually the last statement). +/// +/// Predecessors: the order in the set of predecessors is arbitrary. +/// +/// Successors: the order in the set of successors is NOT arbitrary. We +/// currently have the following orderings based on the terminator: +/// +/// Terminator Successor Ordering +/// ----------------------------------------------------- +/// if Then Block; Else Block +/// ? operator LHS expression; RHS expression +/// &&, || expression that uses result of && or ||, RHS +/// +class CFGBlock { + typedef std::vector StatementListTy; + /// Stmts - The set of statements in the basic block. + StatementListTy Stmts; + + /// Label - An (optional) label that prefixes the executable + /// statements in the block. When this variable is non-NULL, it is + /// either an instance of LabelStmt or SwitchCase. + Stmt *Label; + + /// Terminator - The terminator for a basic block that + /// indicates the type of control-flow that occurs between a block + /// and its successors. + Stmt *Terminator; + + /// LoopTarget - Some blocks are used to represent the "loop edge" to + /// the start of a loop from within the loop body. This Stmt* will be + /// refer to the loop statement for such blocks (and be null otherwise). + const Stmt *LoopTarget; + + /// BlockID - A numerical ID assigned to a CFGBlock during construction + /// of the CFG. + unsigned BlockID; + + /// Predecessors/Successors - Keep track of the predecessor / successor + /// CFG blocks. + typedef std::vector AdjacentBlocks; + AdjacentBlocks Preds; + AdjacentBlocks Succs; + +public: + explicit CFGBlock(unsigned blockid) : Label(NULL), Terminator(NULL), + LoopTarget(NULL), BlockID(blockid) {} + ~CFGBlock() {}; + + // Statement iterators + typedef StatementListTy::iterator iterator; + typedef StatementListTy::const_iterator const_iterator; + typedef std::reverse_iterator const_reverse_iterator; + typedef std::reverse_iterator reverse_iterator; + + Stmt* front() const { return Stmts.front(); } + Stmt* back() const { return Stmts.back(); } + + iterator begin() { return Stmts.begin(); } + iterator end() { return Stmts.end(); } + const_iterator begin() const { return Stmts.begin(); } + const_iterator end() const { return Stmts.end(); } + + reverse_iterator rbegin() { return Stmts.rbegin(); } + reverse_iterator rend() { return Stmts.rend(); } + const_reverse_iterator rbegin() const { return Stmts.rbegin(); } + const_reverse_iterator rend() const { return Stmts.rend(); } + + unsigned size() const { return Stmts.size(); } + bool empty() const { return Stmts.empty(); } + + Stmt* operator[](size_t i) const { assert (i < size()); return Stmts[i]; } + + // CFG iterators + typedef AdjacentBlocks::iterator pred_iterator; + typedef AdjacentBlocks::const_iterator const_pred_iterator; + typedef AdjacentBlocks::reverse_iterator pred_reverse_iterator; + typedef AdjacentBlocks::const_reverse_iterator const_pred_reverse_iterator; + + typedef AdjacentBlocks::iterator succ_iterator; + typedef AdjacentBlocks::const_iterator const_succ_iterator; + typedef AdjacentBlocks::reverse_iterator succ_reverse_iterator; + typedef AdjacentBlocks::const_reverse_iterator const_succ_reverse_iterator; + + pred_iterator pred_begin() { return Preds.begin(); } + pred_iterator pred_end() { return Preds.end(); } + const_pred_iterator pred_begin() const { return Preds.begin(); } + const_pred_iterator pred_end() const { return Preds.end(); } + + pred_reverse_iterator pred_rbegin() { return Preds.rbegin(); } + pred_reverse_iterator pred_rend() { return Preds.rend(); } + const_pred_reverse_iterator pred_rbegin() const { return Preds.rbegin(); } + const_pred_reverse_iterator pred_rend() const { return Preds.rend(); } + + succ_iterator succ_begin() { return Succs.begin(); } + succ_iterator succ_end() { return Succs.end(); } + const_succ_iterator succ_begin() const { return Succs.begin(); } + const_succ_iterator succ_end() const { return Succs.end(); } + + succ_reverse_iterator succ_rbegin() { return Succs.rbegin(); } + succ_reverse_iterator succ_rend() { return Succs.rend(); } + const_succ_reverse_iterator succ_rbegin() const { return Succs.rbegin(); } + const_succ_reverse_iterator succ_rend() const { return Succs.rend(); } + + unsigned succ_size() const { return Succs.size(); } + bool succ_empty() const { return Succs.empty(); } + + unsigned pred_size() const { return Preds.size(); } + bool pred_empty() const { return Preds.empty(); } + + // Manipulation of block contents + + void appendStmt(Stmt* Statement) { Stmts.push_back(Statement); } + void setTerminator(Stmt* Statement) { Terminator = Statement; } + void setLabel(Stmt* Statement) { Label = Statement; } + void setLoopTarget(const Stmt *loopTarget) { LoopTarget = loopTarget; } + + Stmt* getTerminator() { return Terminator; } + const Stmt* getTerminator() const { return Terminator; } + + Stmt* getTerminatorCondition(); + + const Stmt* getTerminatorCondition() const { + return const_cast(this)->getTerminatorCondition(); + } + + const Stmt *getLoopTarget() const { return LoopTarget; } + + bool hasBinaryBranchTerminator() const; + + Stmt* getLabel() { return Label; } + const Stmt* getLabel() const { return Label; } + + void reverseStmts(); + + void addSuccessor(CFGBlock* Block) { + Block->Preds.push_back(this); + Succs.push_back(Block); + } + + unsigned getBlockID() const { return BlockID; } + + void dump(const CFG* cfg) const; + void print(llvm::raw_ostream& OS, const CFG* cfg) const; + void printTerminator(llvm::raw_ostream& OS) const; +}; + + +/// CFG - Represents a source-level, intra-procedural CFG that represents the +/// control-flow of a Stmt. The Stmt can represent an entire function body, +/// or a single expression. A CFG will always contain one empty block that +/// represents the Exit point of the CFG. A CFG will also contain a designated +/// Entry block. The CFG solely represents control-flow; it consists of +/// CFGBlocks which are simply containers of Stmt*'s in the AST the CFG +/// was constructed from. +class CFG { +public: + //===--------------------------------------------------------------------===// + // CFG Construction & Manipulation. + //===--------------------------------------------------------------------===// + + /// buildCFG - Builds a CFG from an AST. The responsibility to free the + /// constructed CFG belongs to the caller. + static CFG* buildCFG(Stmt* AST); + + /// createBlock - Create a new block in the CFG. The CFG owns the block; + /// the caller should not directly free it. + CFGBlock* createBlock(); + + /// setEntry - Set the entry block of the CFG. This is typically used + /// only during CFG construction. Most CFG clients expect that the + /// entry block has no predecessors and contains no statements. + void setEntry(CFGBlock *B) { Entry = B; } + + /// setExit - Set the exit block of the CFG. This is typically used + /// only during CFG construction. Most CFG clients expect that the + /// exit block has no successors and contains no statements. + void setIndirectGotoBlock(CFGBlock* B) { IndirectGotoBlock = B; } + + //===--------------------------------------------------------------------===// + // Block Iterators + //===--------------------------------------------------------------------===// + + typedef std::list CFGBlockListTy; + + typedef CFGBlockListTy::iterator iterator; + typedef CFGBlockListTy::const_iterator const_iterator; + typedef std::reverse_iterator reverse_iterator; + typedef std::reverse_iterator const_reverse_iterator; + + CFGBlock& front() { return Blocks.front(); } + CFGBlock& back() { return Blocks.back(); } + + iterator begin() { return Blocks.begin(); } + iterator end() { return Blocks.end(); } + const_iterator begin() const { return Blocks.begin(); } + const_iterator end() const { return Blocks.end(); } + + reverse_iterator rbegin() { return Blocks.rbegin(); } + reverse_iterator rend() { return Blocks.rend(); } + const_reverse_iterator rbegin() const { return Blocks.rbegin(); } + const_reverse_iterator rend() const { return Blocks.rend(); } + + CFGBlock& getEntry() { return *Entry; } + const CFGBlock& getEntry() const { return *Entry; } + CFGBlock& getExit() { return *Exit; } + const CFGBlock& getExit() const { return *Exit; } + + CFGBlock* getIndirectGotoBlock() { return IndirectGotoBlock; } + const CFGBlock* getIndirectGotoBlock() const { return IndirectGotoBlock; } + + //===--------------------------------------------------------------------===// + // Member templates useful for various batch operations over CFGs. + //===--------------------------------------------------------------------===// + + template + void VisitBlockStmts(CALLBACK& O) const { + for (const_iterator I=begin(), E=end(); I != E; ++I) + for (CFGBlock::const_iterator BI=I->begin(), BE=I->end(); BI != BE; ++BI) + O(*BI); + } + + //===--------------------------------------------------------------------===// + // CFG Introspection. + //===--------------------------------------------------------------------===// + + struct BlkExprNumTy { + const signed Idx; + explicit BlkExprNumTy(signed idx) : Idx(idx) {} + explicit BlkExprNumTy() : Idx(-1) {} + operator bool() const { return Idx >= 0; } + operator unsigned() const { assert(Idx >=0); return (unsigned) Idx; } + }; + + bool isBlkExpr(const Stmt* S) { return getBlkExprNum(S); } + BlkExprNumTy getBlkExprNum(const Stmt* S); + unsigned getNumBlkExprs(); + + unsigned getNumBlockIDs() const { return NumBlockIDs; } + + //===--------------------------------------------------------------------===// + // CFG Debugging: Pretty-Printing and Visualization. + //===--------------------------------------------------------------------===// + + void viewCFG() const; + void print(llvm::raw_ostream& OS) const; + void dump() const; + + //===--------------------------------------------------------------------===// + // Internal: constructors and data. + //===--------------------------------------------------------------------===// + + CFG() : Entry(NULL), Exit(NULL), IndirectGotoBlock(NULL), NumBlockIDs(0), + BlkExprMap(NULL) {}; + + ~CFG(); + + llvm::BumpPtrAllocator& getAllocator() { + return Alloc; + } + +private: + CFGBlock* Entry; + CFGBlock* Exit; + CFGBlock* IndirectGotoBlock; // Special block to contain collective dispatch + // for indirect gotos + CFGBlockListTy Blocks; + unsigned NumBlockIDs; + + // BlkExprMap - An opaque pointer to prevent inclusion of DenseMap.h. + // It represents a map from Expr* to integers to record the set of + // block-level expressions and their "statement number" in the CFG. + void* BlkExprMap; + + /// Alloc - An internal allocator. + llvm::BumpPtrAllocator Alloc; +}; +} // end namespace clang + +//===----------------------------------------------------------------------===// +// GraphTraits specializations for CFG basic block graphs (source-level CFGs) +//===----------------------------------------------------------------------===// + +namespace llvm { + +// Traits for: CFGBlock + +template <> struct GraphTraits { + typedef clang::CFGBlock NodeType; + typedef clang::CFGBlock::succ_iterator ChildIteratorType; + + static NodeType* getEntryNode(clang::CFGBlock* BB) + { return BB; } + + static inline ChildIteratorType child_begin(NodeType* N) + { return N->succ_begin(); } + + static inline ChildIteratorType child_end(NodeType* N) + { return N->succ_end(); } +}; + +template <> struct GraphTraits { + typedef const clang::CFGBlock NodeType; + typedef clang::CFGBlock::const_succ_iterator ChildIteratorType; + + static NodeType* getEntryNode(const clang::CFGBlock* BB) + { return BB; } + + static inline ChildIteratorType child_begin(NodeType* N) + { return N->succ_begin(); } + + static inline ChildIteratorType child_end(NodeType* N) + { return N->succ_end(); } +}; + +template <> struct GraphTraits > { + typedef const clang::CFGBlock NodeType; + typedef clang::CFGBlock::const_pred_iterator ChildIteratorType; + + static NodeType *getEntryNode(Inverse G) + { return G.Graph; } + + static inline ChildIteratorType child_begin(NodeType* N) + { return N->pred_begin(); } + + static inline ChildIteratorType child_end(NodeType* N) + { return N->pred_end(); } +}; + +// Traits for: CFG + +template <> struct GraphTraits + : public GraphTraits { + + typedef clang::CFG::iterator nodes_iterator; + + static NodeType *getEntryNode(clang::CFG* F) { return &F->getEntry(); } + static nodes_iterator nodes_begin(clang::CFG* F) { return F->begin(); } + static nodes_iterator nodes_end(clang::CFG* F) { return F->end(); } +}; + +template <> struct GraphTraits< const clang::CFG* > + : public GraphTraits< const clang::CFGBlock* > { + + typedef clang::CFG::const_iterator nodes_iterator; + + static NodeType *getEntryNode( const clang::CFG* F) { return &F->getEntry(); } + static nodes_iterator nodes_begin( const clang::CFG* F) { return F->begin(); } + static nodes_iterator nodes_end( const clang::CFG* F) { return F->end(); } +}; + +template <> struct GraphTraits > + : public GraphTraits > { + + typedef clang::CFG::const_iterator nodes_iterator; + + static NodeType *getEntryNode(const clang::CFG* F) { return &F->getExit(); } + static nodes_iterator nodes_begin(const clang::CFG* F) { return F->begin();} + static nodes_iterator nodes_end(const clang::CFG* F) { return F->end(); } +}; + +} // end llvm namespace + +#endif diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h new file mode 100644 index 0000000..e134aed --- /dev/null +++ b/include/clang/AST/Decl.h @@ -0,0 +1,1409 @@ +//===--- Decl.h - Classes for representing declarations ---------*- 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 Decl subclasses. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_DECL_H +#define LLVM_CLANG_AST_DECL_H + +#include "clang/AST/APValue.h" +#include "clang/AST/DeclBase.h" +#include "clang/AST/DeclarationName.h" +#include "clang/AST/ExternalASTSource.h" + +namespace clang { +class Expr; +class FunctionTemplateDecl; +class Stmt; +class CompoundStmt; +class StringLiteral; + +/// TranslationUnitDecl - The top declaration context. +class TranslationUnitDecl : public Decl, public DeclContext { + TranslationUnitDecl() + : Decl(TranslationUnit, 0, SourceLocation()), + DeclContext(TranslationUnit) {} +public: + 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 DeclContext *castToDeclContext(const TranslationUnitDecl *D) { + return static_cast(const_cast(D)); + } + static TranslationUnitDecl *castFromDeclContext(const DeclContext *DC) { + return static_cast(const_cast(DC)); + } +}; + +/// NamedDecl - This represents a decl with a name. Many decls have names such +/// as ObjCMethodDecl, but not @class, etc. +class NamedDecl : public Decl { + /// Name - The name of this declaration, which is typically a normal + /// identifier but may also be a special kind of name (C++ + /// constructor, Objective-C selector, etc.) + DeclarationName Name; + +protected: + NamedDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N) + : Decl(DK, DC, L), Name(N) { } + +public: + /// getIdentifier - Get the identifier that names this declaration, + /// if there is one. This will return NULL if this declaration has + /// no name (e.g., for an unnamed class) or if the name is a special + /// name (C++ constructor, Objective-C selector, etc.). + IdentifierInfo *getIdentifier() const { return Name.getAsIdentifierInfo(); } + + /// getNameAsCString - Get the name of identifier for this declaration as a + /// C string (const char*). This requires that the declaration have a name + /// and that it be a simple identifier. + const char *getNameAsCString() const { + assert(getIdentifier() && "Name is not a simple identifier"); + return getIdentifier()->getName(); + } + + /// getDeclName - Get the actual, stored name of the declaration, + /// which may be a special name. + DeclarationName getDeclName() const { return Name; } + + /// \brief Set the name of this declaration. + void setDeclName(DeclarationName N) { Name = N; } + + /// getNameAsString - Get a human-readable name for the declaration, even if + /// it is one of the special kinds of names (C++ constructor, Objective-C + /// selector, etc). Creating this name requires expensive string + /// 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, + /// namespace), it will return same result as getNameAsString(). + /// Creating this name is expensive, so it should be called only when + /// performance doesn't matter. + std::string getQualifiedNameAsString() const; + + /// declarationReplaces - Determine whether this declaration, if + /// known to be well-formed within its context, will replace the + /// declaration OldD if introduced into scope. A declaration will + /// replace another declaration if, for example, it is a + /// redeclaration of the same variable or function, but not if it is + /// a declaration of a different kind (function vs. class) or an + /// overloaded function. + bool declarationReplaces(NamedDecl *OldD) const; + + /// \brief Determine whether this declaration has linkage. + bool hasLinkage() const; + + static bool classof(const Decl *D) { + return D->getKind() >= NamedFirst && D->getKind() <= NamedLast; + } + static bool classof(const NamedDecl *D) { return true; } +}; + +/// NamespaceDecl - Represent a C++ namespace. +class NamespaceDecl : public NamedDecl, public DeclContext { + SourceLocation LBracLoc, RBracLoc; + + // For extended namespace definitions: + // + // namespace A { int x; } + // namespace A { int y; } + // + // there will be one NamespaceDecl for each declaration. + // NextNamespace points to the next extended declaration. + // 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; + NextNamespace = 0; + } +public: + static NamespaceDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, IdentifierInfo *Id); + + virtual void Destroy(ASTContext& C); + + NamespaceDecl *getNextNamespace() { return NextNamespace; } + const NamespaceDecl *getNextNamespace() const { return NextNamespace; } + void setNextNamespace(NamespaceDecl *ND) { NextNamespace = ND; } + + NamespaceDecl *getOriginalNamespace() const { + return OrigNamespace; + } + void setOriginalNamespace(NamespaceDecl *ND) { OrigNamespace = ND; } + + SourceRange getSourceRange() const { + return SourceRange(LBracLoc, RBracLoc); + } + + SourceLocation getLBracLoc() const { return LBracLoc; } + 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; } + static DeclContext *castToDeclContext(const NamespaceDecl *D) { + return static_cast(const_cast(D)); + } + static NamespaceDecl *castFromDeclContext(const DeclContext *DC) { + return static_cast(const_cast(DC)); + } +}; + +/// 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. +class ValueDecl : public NamedDecl { + QualType DeclType; + +protected: + ValueDecl(Kind DK, DeclContext *DC, SourceLocation L, + 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; + } + static bool classof(const ValueDecl *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). +struct EvaluatedStmt { + EvaluatedStmt() : WasEvaluated(false), CheckedICE(false), IsICE(false) { } + + /// \brief Whether this statement was already evaluated. + bool WasEvaluated : 1; + + /// \brief Whether we already checked whether this statement was an + /// integral constant expression. + bool CheckedICE : 1; + + /// \brief Whether this statement is an integral constant + /// expression. Only valid if CheckedICE is true. + bool IsICE : 1; + + Stmt *Value; + APValue Evaluated; +}; + +/// VarDecl - An instance of this class is created to represent a variable +/// declaration or definition. +class VarDecl : public ValueDecl { +public: + enum StorageClass { + None, Auto, Register, Extern, Static, PrivateExtern + }; + + /// getStorageClassSpecifierString - Return the string used to + /// specify the storage class \arg SC. + /// + /// It is illegal to call this function with SC == None. + static const char *getStorageClassSpecifierString(StorageClass SC); + +private: + mutable llvm::PointerUnion Init; + // FIXME: This can be packed into the bitfields in Decl. + unsigned SClass : 3; + bool ThreadSpecified : 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(), + ThreadSpecified(false), HasCXXDirectInit(false), + DeclaredInCondition(false), PreviousDeclaration(0), + TypeSpecStartLoc(TSSL) { + SClass = SC; + } +public: + static VarDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, IdentifierInfo *Id, + QualType T, StorageClass S, + SourceLocation TypeSpecStartLoc = SourceLocation()); + + virtual ~VarDecl(); + virtual void Destroy(ASTContext& C); + + StorageClass getStorageClass() const { return (StorageClass)SClass; } + void setStorageClass(StorageClass SC) { SClass = SC; } + + SourceLocation getTypeSpecStartLoc() const { return TypeSpecStartLoc; } + void setTypeSpecStartLoc(SourceLocation SL) { + TypeSpecStartLoc = SL; + } + + const Expr *getInit() const { + if (Init.isNull()) + return 0; + + const Stmt *S = Init.dyn_cast(); + if (!S) + S = Init.get()->Value; + + return (const Expr*) S; + } + Expr *getInit() { + if (Init.isNull()) + return 0; + + Stmt *S = Init.dyn_cast(); + if (!S) + S = Init.get()->Value; + + return (Expr*) S; + } + + /// \brief Retrieve the address of the initializer expression. + Stmt **getInitAddress() { + if (Init.is()) + return reinterpret_cast(&Init); // FIXME: ugly hack + return &Init.get()->Value; + } + + 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 { + EvaluatedStmt *Eval = Init.dyn_cast(); + if (!Eval) { + Stmt *S = Init.get(); + Eval = new (C) EvaluatedStmt; + Eval->Value = S; + Init = Eval; + } + + 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 { + if (EvaluatedStmt *Eval = Init.dyn_cast()) + if (Eval->WasEvaluated) + return &Eval->Evaluated; + + return 0; + } + + /// \brief Determines whether it is already known whether the + /// initializer is an integral constant expression or not. + bool isInitKnownICE() const { + if (EvaluatedStmt *Eval = Init.dyn_cast()) + return Eval->CheckedICE; + + return false; + } + + /// \brief Determines whether the initializer is an integral + /// constant expression. + /// + /// \pre isInitKnownICE() + bool isInitICE() const { + assert(isInitKnownICE() && + "Check whether we already know that the initializer is an ICE"); + return Init.get()->IsICE; + } + + /// \brief Note that we now know whether the initializer is an + /// integral constant expression. + void setInitKnownICE(ASTContext &C, bool IsICE) const { + EvaluatedStmt *Eval = Init.dyn_cast(); + if (!Eval) { + Stmt *S = Init.get(); + Eval = new (C) EvaluatedStmt; + Eval->Value = S; + Init = Eval; + } + + Eval->CheckedICE = true; + Eval->IsICE = IsICE; + } + + /// \brief Retrieve the definition of this variable, which may come + /// from a previous declaration. Def will be set to the VarDecl that + /// contains the initializer, and the result will be that + /// initializer. + const Expr *getDefinition(const VarDecl *&Def) const; + + void setThreadSpecified(bool T) { ThreadSpecified = T; } + bool isThreadSpecified() const { + return ThreadSpecified; + } + + void setCXXDirectInitializer(bool T) { HasCXXDirectInit = T; } + + /// hasCXXDirectInitializer - If true, the initializer was a direct + /// initializer, e.g: "int x(1);". The Init expression will be the expression + /// inside the parens or a "ClassType(a,b,c)" class constructor expression for + /// class types. Clients can distinguish between "int x(1);" and "int x=1;" + /// by checking hasCXXDirectInitializer. + /// + 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 + /// if (int x = foo()) { ... } + /// @endcode + bool isDeclaredInCondition() const { + return DeclaredInCondition; + } + 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; + } + + /// 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; + } + + /// hasExternStorage - Returns true if a variable has extern or + /// __private_extern__ storage. + bool hasExternalStorage() const { + return getStorageClass() == Extern || getStorageClass() == PrivateExtern; + } + + /// hasGlobalStorage - Returns true for all variables that do not + /// have local storage. This includs all global variables as well + /// as static variables declared within a function. + bool hasGlobalStorage() const { return !hasLocalStorage(); } + + /// isBlockVarDecl - Returns true for local variable declarations. Note that + /// this includes static variables inside of functions. + /// + /// void foo() { int x; static int y; extern int z; } + /// + bool isBlockVarDecl() const { + if (getKind() != Decl::Var) + return false; + if (const DeclContext *DC = getDeclContext()) + 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 + /// variable 'x' in: + /// \code + /// struct S { + /// static int x; + /// }; + /// \endcode + bool isStaticDataMember() const { + return getDeclContext()->isRecord(); + } + + /// isFileVarDecl - Returns true for file scoped variable declaration. + bool isFileVarDecl() const { + if (getKind() != Decl::Var) + return false; + if (const DeclContext *Ctx = getDeclContext()) { + Ctx = Ctx->getLookupContext(); + if (isa(Ctx) || isa(Ctx) ) + 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; + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { + return D->getKind() >= VarFirst && D->getKind() <= VarLast; + } + static bool classof(const VarDecl *D) { return true; } +}; + +class ImplicitParamDecl : public VarDecl { +protected: + ImplicitParamDecl(Kind DK, DeclContext *DC, SourceLocation L, + IdentifierInfo *Id, QualType Tw) + : VarDecl(DK, DC, L, Id, Tw, VarDecl::None) {} +public: + static ImplicitParamDecl *Create(ASTContext &C, DeclContext *DC, + 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; } +}; + +/// ParmVarDecl - Represent a parameter to a function. +class ParmVarDecl : public VarDecl { + // NOTE: VC++ treats enums as signed, avoid using the ObjCDeclQualifier enum + /// FIXME: Also can be paced into the bitfields in Decl. + /// in, inout, etc. + unsigned objcDeclQualifier : 6; + + /// Default argument, if any. [C++ Only] + Expr *DefaultArg; +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) {} + +public: + static ParmVarDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L,IdentifierInfo *Id, + QualType T, StorageClass S, Expr *DefArg); + + ObjCDeclQualifier getObjCDeclQualifier() const { + return ObjCDeclQualifier(objcDeclQualifier); + } + void setObjCDeclQualifier(ObjCDeclQualifier QTVal) { + objcDeclQualifier = QTVal; + } + + const Expr *getDefaultArg() const { return DefaultArg; } + Expr *getDefaultArg() { return DefaultArg; } + void setDefaultArg(Expr *defarg) { DefaultArg = defarg; } + + /// 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 + /// default arguments, e.g., + /// @code + /// class X { + /// public: + /// void f(int x = 17); // x has an unparsed default argument now + /// }; // x has a regular default argument now + /// @endcode + bool hasUnparsedDefaultArg() const { + return DefaultArg == reinterpret_cast(-1); + } + + /// setUnparsedDefaultArg - Specify that this parameter has an + /// unparsed default argument. The argument will be replaced with a + /// 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(-1); } + + 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 + /// the DeclContext appropriately. + void setOwningFunction(DeclContext *FD) { setDeclContext(FD); } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { + return (D->getKind() == ParmVar || + D->getKind() == OriginalParmVar); + } + static bool classof(const ParmVarDecl *D) { return true; } +}; + +/// OriginalParmVarDecl - Represent a parameter to a function, when +/// the type of the parameter has been promoted. This node represents the +/// parameter to the function with its original type. +/// +class OriginalParmVarDecl : public ParmVarDecl { + friend class ParmVarDecl; +protected: + QualType OriginalType; +private: + OriginalParmVarDecl(DeclContext *DC, SourceLocation L, + IdentifierInfo *Id, QualType T, + QualType OT, StorageClass S, + Expr *DefArg) + : ParmVarDecl(OriginalParmVar, DC, L, Id, T, S, DefArg), OriginalType(OT) {} +public: + static OriginalParmVarDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L,IdentifierInfo *Id, + QualType T, QualType OT, + StorageClass S, Expr *DefArg); + + void setOriginalType(QualType T) { OriginalType = T; } + + // Implement isa/cast/dyncast/etc. + 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. +/// +/// Since a given function can be declared several times in a program, +/// there may be several FunctionDecls that correspond to that +/// function. Only one of those FunctionDecls will be found when +/// traversing the list of declarations in the context of the +/// 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 { +public: + enum StorageClass { + None, Extern, Static, PrivateExtern + }; +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. TODO: we could allocate this space immediately after the + /// FunctionDecl object to save an allocation like FunctionType does. + 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; + + // Move to DeclGroup when it is implemented. + SourceLocation TypeSpecStartLoc; + + /// \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. + llvm::PointerUnion + TemplateOrInstantiation; + +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), + 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), + TemplateOrInstantiation() {} + + virtual ~FunctionDecl() {} + virtual void Destroy(ASTContext& C); + +public: + static FunctionDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L, + DeclarationName N, QualType T, + StorageClass S = None, bool isInline = false, + bool hasWrittenPrototype = true, + SourceLocation TSStartLoc = SourceLocation()); + + 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 + /// function. The variant that accepts a FunctionDecl pointer will + /// set that function declaration to the actual declaration + /// containing the body (if there is one). + Stmt *getBody(ASTContext &Context, const FunctionDecl *&Definition) const; + + virtual Stmt *getBody(ASTContext &Context) const { + const FunctionDecl* Definition; + return getBody(Context, 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 + /// previous definition); for that information, use getBody. + /// FIXME: Should return true if function is deleted or defaulted. However, + /// CodeGenModule.cpp uses it, and I don't know if this would break it. + bool isThisDeclarationADefinition() const { return Body; } + + void setBody(Stmt *B) { Body = B; } + void setLazyBody(uint64_t Offset) { Body = Offset; } + + /// Whether this function is marked as virtual explicitly. + bool isVirtualAsWritten() const { return IsVirtualAsWritten; } + void setVirtualAsWritten(bool V) { IsVirtualAsWritten = V; } + + /// Whether this virtual function is pure, i.e. makes the containing class + /// abstract. + bool isPure() const { return IsPure; } + void setPure(bool P = true) { IsPure = P; } + + /// \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 hasWrittenPrototype() const { return HasWrittenPrototype; } + void setHasWrittenPrototype(bool P) { HasWrittenPrototype = P; } + + /// \brief Whether this function inherited its prototype from a + /// previous declaration. + bool hasInheritedPrototype() const { return HasInheritedPrototype; } + void setHasInheritedPrototype(bool P = true) { HasInheritedPrototype = P; } + + /// \brief Whether this function has been deleted. + /// + /// A function that is "deleted" (via the C++0x "= delete" syntax) + /// acts like a normal function, except that it cannot actually be + /// called or have its address taken. Deleted functions are + /// typically used in C++ overload resolution to attract arguments + /// whose type or lvalue/rvalue-ness would permit the use of a + /// different overload that would behave incorrectly. For example, + /// one might use deleted functions to ban implicit conversion from + /// a floating-point number to an Integer type: + /// + /// @code + /// struct Integer { + /// Integer(long); // construct from a long + /// Integer(double) = delete; // no construction from float or double + /// Integer(long double) = delete; // no construction from long double + /// }; + /// @endcode + bool isDeleted() const { return IsDeleted; } + void setDeleted(bool D = true) { IsDeleted = D; } + + /// \brief Determines whether this is a function "main", which is + /// the entry point into an executable program. + bool isMain() const; + + /// \brief Determines whether this function is a function with + /// external, C linkage. + bool isExternC(ASTContext &Context) 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) { + PreviousDeclaration = PrevDecl; + } + + unsigned getBuiltinID(ASTContext &Context) 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]; + } + ParmVarDecl *getParamDecl(unsigned i) { + assert(i < getNumParams() && "Illegal param #"); + return ParamInfo[i]; + } + void setParams(ASTContext& C, ParmVarDecl **NewParamInfo, unsigned NumParams); + + /// getMinRequiredArguments - Returns the minimum number of arguments + /// needed to call this function. This may be fewer than the number of + /// function parameters, if some of the parameters have default + /// arguments (in C++). + unsigned getMinRequiredArguments() const; + + QualType getResultType() const { + return getType()->getAsFunctionType()->getResultType(); + } + StorageClass getStorageClass() const { return StorageClass(SClass); } + void setStorageClass(StorageClass SC) { SClass = SC; } + + 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() const; + + /// \brief Determines whether this function is a GNU "extern + /// inline", which is roughly the opposite of a C99 "extern inline" + /// function. + bool isExternGNUInline() const; + + /// isOverloadedOperator - Whether this function declaration + /// represents an C++ overloaded operator, e.g., "operator+". + bool isOverloadedOperator() const { + return getOverloadedOperator() != OO_None; + }; + + OverloadedOperatorKind getOverloadedOperator() const; + + /// \brief If this function is an instantiation of a member function + /// of a class template specialization, retrieves the function from + /// which it was instantiated. + /// + /// This routine will return non-NULL for (non-templated) member + /// functions of class templates and for instantiations of function + /// templates. For example, given: + /// + /// \code + /// template + /// struct X { + /// void f(T); + /// }; + /// \endcode + /// + /// The declaration for X::f is a (non-templated) FunctionDecl + /// whose parent is the class template specialization X. For + /// this declaration, getInstantiatedFromFunction() will return + /// the FunctionDecl X::A. When a complete definition of + /// X::A is required, it will be instantiated from the + /// declaration returned by getInstantiatedFromMemberFunction(). + FunctionDecl *getInstantiatedFromMemberFunction() const { + return TemplateOrInstantiation.dyn_cast(); + } + + /// \brief Specify that this record is an instantiation of the + /// member function RD. + void setInstantiationOfMemberFunction(FunctionDecl *RD) { + TemplateOrInstantiation = RD; + } + + /// \brief Retrieves the function template that is described by this + /// function declaration. + /// + /// Every function template is represented as a FunctionTemplateDecl + /// and a FunctionDecl (or something derived from FunctionDecl). The + /// former contains template properties (such as the template + /// parameter lists) while the latter contains the actual + /// description of the template's + /// contents. FunctionTemplateDecl::getTemplatedDecl() retrieves the + /// FunctionDecl that describes the function template, + /// getDescribedFunctionTemplate() retrieves the + /// FunctionTemplateDecl from a FunctionDecl. + FunctionTemplateDecl *getDescribedFunctionTemplate() const { + return TemplateOrInstantiation.dyn_cast(); + } + + void setDescribedFunctionTemplate(FunctionTemplateDecl *Template) { + TemplateOrInstantiation = Template; + } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { + return D->getKind() >= FunctionFirst && D->getKind() <= FunctionLast; + } + static bool classof(const FunctionDecl *D) { return true; } + static DeclContext *castToDeclContext(const FunctionDecl *D) { + return static_cast(const_cast(D)); + } + static FunctionDecl *castFromDeclContext(const DeclContext *DC) { + return static_cast(const_cast(DC)); + } +}; + + +/// FieldDecl - An instance of this class is created by Sema::ActOnField to +/// represent a member of a struct/union/class. +class FieldDecl : public ValueDecl { + // 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) + { } + +public: + static FieldDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L, + IdentifierInfo *Id, QualType T, Expr *BW, + bool Mutable); + + /// isMutable - Determines whether this field is mutable (C++ only). + bool isMutable() const { return Mutable; } + + /// \brief Set whether this field is mutable (C++ only). + void setMutable(bool M) { Mutable = M; } + + /// isBitfield - Determines whether this field is a bitfield. + bool isBitField() const { return BitWidth != NULL; } + + /// @brief Determines whether this is an unnamed bitfield. + bool isUnnamedBitfield() const { return BitWidth != NULL && !getDeclName(); } + + /// isAnonymousStructOrUnion - Determines whether this field is a + /// representative for an anonymous struct or union. Such fields are + /// unnamed and are implicitly generated by the implementation to + /// store the data for the anonymous union or struct. + bool isAnonymousStructOrUnion() const; + + Expr *getBitWidth() const { return BitWidth; } + void setBitWidth(Expr *BW) { BitWidth = BW; } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { + return D->getKind() >= FieldFirst && D->getKind() <= FieldLast; + } + static bool classof(const FieldDecl *D) { return true; } +}; + +/// EnumConstantDecl - An instance of this object exists for each enum constant +/// that is defined. For example, in "enum X {a,b}", each of a/b are +/// EnumConstantDecl's, X is an instance of EnumDecl, and the type of a/b is a +/// TagType for the X EnumDecl. +class EnumConstantDecl : public ValueDecl { + Stmt *Init; // an integer constant expression + llvm::APSInt Val; // The value. +protected: + EnumConstantDecl(DeclContext *DC, SourceLocation L, + IdentifierInfo *Id, QualType T, Expr *E, + const llvm::APSInt &V) + : ValueDecl(EnumConstant, DC, L, Id, T), Init((Stmt*)E), Val(V) {} + + virtual ~EnumConstantDecl() {} +public: + + static EnumConstantDecl *Create(ASTContext &C, EnumDecl *DC, + 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; } + Expr *getInitExpr() { return (Expr*) Init; } + const llvm::APSInt &getInitVal() const { return Val; } + + 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; +}; + + +/// TypeDecl - Represents a declaration of a type. +/// +class TypeDecl : public NamedDecl { + /// TypeForDecl - This indicates the Type object that represents + /// this TypeDecl. It is a cache maintained by + /// ASTContext::getTypedefType, ASTContext::getTagDeclType, and + /// ASTContext::getTemplateTypeParmType, and TemplateTypeParmDecl. + mutable Type *TypeForDecl; + friend class ASTContext; + friend class DeclContext; + friend class TagDecl; + friend class TemplateTypeParmDecl; + friend class ClassTemplateSpecializationDecl; + friend class TagType; + +protected: + TypeDecl(Kind DK, DeclContext *DC, SourceLocation L, + IdentifierInfo *Id) + : NamedDecl(DK, DC, L, Id), TypeForDecl(0) {} + +public: + // Low-level accessor + Type *getTypeForDecl() const { return TypeForDecl; } + void setTypeForDecl(Type *TD) { TypeForDecl = TD; } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { + return D->getKind() >= TypeFirst && D->getKind() <= TypeLast; + } + static bool classof(const TypeDecl *D) { return true; } +}; + + +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) + : 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; } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { return D->getKind() == Typedef; } + static bool classof(const TypedefDecl *D) { return true; } +}; + +class TypedefDecl; + +/// TagDecl - Represents the declaration of a struct/union/class/enum. +class TagDecl : public TypeDecl, public DeclContext { +public: + enum TagKind { + TK_struct, + TK_union, + TK_class, + TK_enum + }; + +private: + // FIXME: This can be packed into the bitfields in Decl. + /// TagDeclKind - The TagKind enum. + unsigned TagDeclKind : 2; + + /// 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; + +protected: + TagDecl(Kind DK, TagKind TK, DeclContext *DC, SourceLocation L, + IdentifierInfo *Id) + : TypeDecl(DK, DC, L, Id), DeclContext(DK), TypedefForAnonDecl(0) { + assert((DK != Enum || TK == TK_enum) &&"EnumDecl not matched with TK_enum"); + TagDeclKind = TK; + IsDefinition = false; + } +public: + + /// isDefinition - Return true if this decl has its body specified. + bool isDefinition() const { + return IsDefinition; + } + + /// \brief Whether this declaration declares a type that is + /// dependent, i.e., a type that somehow depends on template + /// parameters. + 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. + void startDefinition(); + + /// @brief Completes the definition of this tag declaration. + void completeDefinition(); + + /// 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 + /// specific TagDecl is defining declaration, not whether or not the + /// 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"; + } + } + + TagKind getTagKind() const { + return TagKind(TagDeclKind); + } + + void setTagKind(TagKind TK) { TagDeclKind = TK; } + + bool isStruct() const { return getTagKind() == TK_struct; } + 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; + } + static bool classof(const TagDecl *D) { return true; } + + static DeclContext *castToDeclContext(const TagDecl *D) { + return static_cast(const_cast(D)); + } + static TagDecl *castFromDeclContext(const DeclContext *DC) { + return static_cast(const_cast(DC)); + } + + void setDefinition(bool V) { IsDefinition = V; } +}; + +/// EnumDecl - Represents an enum. As an extension, we allow forward-declared +/// enums. +class EnumDecl : public TagDecl { + /// IntegerType - This represent the integer type that the enum corresponds + /// to for code generation purposes. Note that the enumerator constants may + /// have a different type than this does. + QualType IntegerType; + + /// \brief If the enumeration was instantiated from an enumeration + /// within a class or function template, this pointer refers to the + /// enumeration declared within the template. + EnumDecl *InstantiatedFrom; + + EnumDecl(DeclContext *DC, SourceLocation L, + IdentifierInfo *Id) + : TagDecl(Enum, TK_enum, DC, L, Id), InstantiatedFrom(0) { + IntegerType = QualType(); + } +public: + static EnumDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, IdentifierInfo *Id, + EnumDecl *PrevDecl); + + virtual void Destroy(ASTContext& C); + + /// completeDefinition - When created, the EnumDecl corresponds to a + /// forward-declared enum. This method is used to mark the + /// declaration as being defined; it's enumerators have already been + /// 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 enumerator_iterator; + + enumerator_iterator enumerator_begin(ASTContext &Context) const { + return enumerator_iterator(this->decls_begin(Context)); + } + + enumerator_iterator enumerator_end(ASTContext &Context) const { + return enumerator_iterator(this->decls_end(Context)); + } + + /// getIntegerType - Return the integer type this enum decl corresponds to. + /// This returns a null qualtype for an enum forward definition. + QualType getIntegerType() const { return IntegerType; } + + /// \brief Set the underlying integer type. + void setIntegerType(QualType T) { IntegerType = T; } + + /// \brief Returns the enumeration (declared within the template) + /// from which this enumeration type was instantiated, or NULL if + /// this enumeration was not instantiated from any template. + EnumDecl *getInstantiatedFromMemberEnum() const { + return InstantiatedFrom; + } + + void setInstantiationOfMemberEnum(EnumDecl *IF) { InstantiatedFrom = IF; } + + static bool classof(const Decl *D) { return D->getKind() == Enum; } + static bool classof(const EnumDecl *D) { return true; } +}; + + +/// RecordDecl - Represents a struct/union/class. For example: +/// struct X; // Forward declaration, no "body". +/// union Y { int A, B; }; // Has body with members A and B (FieldDecls). +/// This decl will be marked invalid if *any* members are invalid. +/// +class RecordDecl : public TagDecl { + // FIXME: This can be packed into the bitfields in Decl. + /// HasFlexibleArrayMember - This is true if this struct ends with a flexible + /// array member (e.g. int X[]) or if this union contains a struct that does. + /// If so, this cannot be contained in arrays or other structs as a member. + bool HasFlexibleArrayMember : 1; + + /// AnonymousStructOrUnion - Whether this is the type of an + /// anonymous struct or union. + bool AnonymousStructOrUnion : 1; + +protected: + RecordDecl(Kind DK, TagKind TK, DeclContext *DC, + SourceLocation L, IdentifierInfo *Id); + virtual ~RecordDecl(); + +public: + static RecordDecl *Create(ASTContext &C, TagKind TK, DeclContext *DC, + SourceLocation L, IdentifierInfo *Id, + RecordDecl* PrevDecl = 0); + + virtual void Destroy(ASTContext& C); + + bool hasFlexibleArrayMember() const { return HasFlexibleArrayMember; } + void setHasFlexibleArrayMember(bool V) { HasFlexibleArrayMember = V; } + + /// isAnonymousStructOrUnion - Whether this is an anonymous struct + /// or union. To be an anonymous struct or union, it must have been + /// declared without a name and there must be no objects of this + /// type declared, e.g., + /// @code + /// union { int i; float f; }; + /// @endcode + /// is an anonymous union but neither of the following are: + /// @code + /// union X { int i; float f; }; + /// union { int i; float f; } obj; + /// @endcode + bool isAnonymousStructOrUnion() const { return AnonymousStructOrUnion; } + void setAnonymousStructOrUnion(bool Anon) { + AnonymousStructOrUnion = Anon; + } + + /// \brief Determines whether this declaration represents the + /// injected class name. + /// + /// The injected class name in C++ is the name of the class that + /// appears inside the class itself. For example: + /// + /// \code + /// struct C { + /// // C is implicitly declared here as a synonym for the class name. + /// }; + /// + /// C::C c; // same as "C c;" + /// \endcode + bool isInjectedClassName() const; + + /// 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 + /// RecordDecl is defining declaration, not whether or not the record + /// type is defined. This method returns NULL if there is no RecordDecl + /// that defines the struct/union/tag. + RecordDecl* getDefinition(ASTContext& C) const { + return cast_or_null(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. + typedef specific_decl_iterator field_iterator; + + field_iterator field_begin(ASTContext &Context) const { + return field_iterator(decls_begin(Context)); + } + field_iterator field_end(ASTContext &Context) const { + return field_iterator(decls_end(Context)); + } + + // field_empty - Whether there are any fields (non-static data + // members) in this record. + bool field_empty(ASTContext &Context) const { + return field_begin(Context) == field_end(Context); + } + + /// completeDefinition - Notes that the definition of this type is + /// now complete. + void completeDefinition(ASTContext& C); + + static bool classof(const Decl *D) { + return D->getKind() >= RecordFirst && D->getKind() <= RecordLast; + } + static bool classof(const RecordDecl *D) { return true; } +}; + +class FileScopeAsmDecl : public Decl { + StringLiteral *AsmString; + FileScopeAsmDecl(DeclContext *DC, SourceLocation L, StringLiteral *asmstring) + : Decl(FileScopeAsm, DC, L), AsmString(asmstring) {} +public: + static FileScopeAsmDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, StringLiteral *Str); + + const StringLiteral *getAsmString() const { return AsmString; } + StringLiteral *getAsmString() { return AsmString; } + void setAsmString(StringLiteral *Asm) { AsmString = Asm; } + + static bool classof(const Decl *D) { + return D->getKind() == FileScopeAsm; + } + static bool classof(const FileScopeAsmDecl *D) { return true; } +}; + +/// BlockDecl - This represents a block literal declaration, which is like an +/// unnamed FunctionDecl. For example: +/// ^{ statement-body } or ^(int arg1, float arg2){ statement-body } +/// +class BlockDecl : public Decl, public DeclContext { + // FIXME: This can be packed into the bitfields in Decl. + bool isVariadic : 1; + /// ParamInfo - new[]'d array of pointers to ParmVarDecls for the formal + /// parameters of this function. This is null if a prototype or if there are + /// no formals. + ParmVarDecl **ParamInfo; + unsigned NumParams; + + Stmt *Body; + +protected: + BlockDecl(DeclContext *DC, SourceLocation CaretLoc) + : Decl(Block, DC, CaretLoc), DeclContext(Block), + isVariadic(false), ParamInfo(0), NumParams(0), Body(0) {} + + virtual ~BlockDecl(); + virtual void Destroy(ASTContext& C); + +public: + static BlockDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L); + + SourceLocation getCaretLocation() const { return getLocation(); } + + bool IsVariadic() const { return isVariadic; } + void setIsVariadic(bool value) { isVariadic = value; } + + CompoundStmt *getBody() const { return (CompoundStmt*) Body; } + Stmt *getBody(ASTContext &C) const { return (Stmt*) Body; } + void setBody(CompoundStmt *B) { Body = (Stmt*) B; } + + // Iterator access to formal parameters. + 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 #"); + return ParamInfo[i]; + } + ParmVarDecl *getParamDecl(unsigned i) { + assert(i < getNumParams() && "Illegal param #"); + 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 DeclContext *castToDeclContext(const BlockDecl *D) { + return static_cast(const_cast(D)); + } + static BlockDecl *castFromDeclContext(const DeclContext *DC) { + return static_cast(const_cast(DC)); + } +}; + +/// Insertion operator for diagnostics. This allows sending NamedDecl's +/// into a diagnostic with <<. +inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, + NamedDecl* ND) { + DB.AddTaggedVal(reinterpret_cast(ND), Diagnostic::ak_nameddecl); + return DB; +} + +} // end namespace clang + +#endif diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h new file mode 100644 index 0000000..c061b85 --- /dev/null +++ b/include/clang/AST/DeclBase.h @@ -0,0 +1,900 @@ +//===-- DeclBase.h - Base Classes for representing declarations -*- 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 Decl and DeclContext interfaces. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_DECLBASE_H +#define LLVM_CLANG_AST_DECLBASE_H + +#include "clang/AST/Attr.h" +#include "clang/AST/Type.h" +// FIXME: Layering violation +#include "clang/Parse/AccessSpecifier.h" +#include "llvm/Support/PrettyStackTrace.h" +#include "llvm/ADT/PointerUnion.h" + +namespace clang { +class DeclContext; +class TranslationUnitDecl; +class NamespaceDecl; +class UsingDirectiveDecl; +class NamedDecl; +class FunctionDecl; +class CXXRecordDecl; +class EnumDecl; +class ObjCMethodDecl; +class ObjCContainerDecl; +class ObjCInterfaceDecl; +class ObjCCategoryDecl; +class ObjCProtocolDecl; +class ObjCImplementationDecl; +class ObjCCategoryImplDecl; +class LinkageSpecDecl; +class BlockDecl; +class DeclarationName; +class CompoundStmt; +} + +namespace llvm { +// DeclContext* is only 4-byte aligned on 32-bit systems. +template<> + class PointerLikeTypeTraits { + typedef clang::DeclContext* PT; +public: + static inline void *getAsVoidPointer(PT P) { return P; } + static inline PT getFromVoidPointer(void *P) { + return static_cast(P); + } + enum { NumLowBitsAvailable = 2 }; +}; +} + +namespace clang { + +/// Decl - This represents one declaration (or definition), e.g. a variable, +/// typedef, function, struct, etc. +/// +class Decl { +public: + /// \brief Lists the kind of concrete classes of Decl. + enum Kind { +#define DECL(Derived, Base) Derived, +#define DECL_RANGE(CommonBase, Start, 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" + }; + + /// IdentifierNamespace - According to C99 6.2.3, there are four + /// 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. + enum IdentifierNamespace { + IDNS_Label = 0x1, + IDNS_Tag = 0x2, + IDNS_Member = 0x4, + IDNS_Ordinary = 0x8, + IDNS_ObjCProtocol = 0x10, + IDNS_ObjCImplementation = 0x20, + IDNS_ObjCCategoryImpl = 0x40 + }; + + /// 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). + enum ObjCDeclQualifier { + OBJC_TQ_None = 0x0, + OBJC_TQ_In = 0x1, + OBJC_TQ_Inout = 0x2, + OBJC_TQ_Out = 0x4, + OBJC_TQ_Bycopy = 0x8, + 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 + /// traversed via DeclContext's decls_begin()/decls_end(). + Decl *NextDeclInContext; + + friend class DeclContext; + + struct MultipleDC { + 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. + /// For declarations with C++ scope specifiers, it contains a MultipleDC* + /// with the context where it semantically belongs (SemanticDC) and the + /// context where it was lexically declared (LexicalDC). + /// e.g.: + /// + /// namespace A { + /// void f(); // SemanticDC == LexicalDC == 'namespace A' + /// } + /// void A::f(); // SemanticDC == namespace 'A' + /// // LexicalDC == global namespace + llvm::PointerUnion DeclCtx; + + inline bool isInSemaDC() const { return DeclCtx.is(); } + inline bool isOutOfSemaDC() const { return DeclCtx.is(); } + inline MultipleDC *getMultipleDC() const { + return DeclCtx.get(); + } + inline DeclContext *getSemanticDC() const { + return DeclCtx.get(); + } + + /// 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; + + /// Implicit - Whether this declaration was implicitly generated by + /// the implementation rather than explicitly written by the user. + bool Implicit : 1; + + /// IdentifierNamespace - This specifies what IDNS_* namespace this lives in. + unsigned IdentifierNamespace : 8; + +#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), + Loc(L), DeclKind(DK), InvalidDecl(0), + HasAttrs(false), Implicit(false), + IdentifierNamespace(getIdentifierNamespaceForKind(DK)), Access(AS_none) { + if (Decl::CollectingStats()) addDeclKind(DK); + } + + virtual ~Decl(); + +public: + SourceLocation getLocation() const { return Loc; } + void setLocation(SourceLocation L) { Loc = L; } + + Kind getKind() const { return DeclKind; } + const char *getDeclKindName() const; + + Decl *getNextDeclInContext() { return NextDeclInContext; } + const Decl *getNextDeclInContext() const { return NextDeclInContext; } + + DeclContext *getDeclContext() { + if (isInSemaDC()) + return getSemanticDC(); + return getMultipleDC()->SemanticDC; + } + const DeclContext *getDeclContext() const { + return const_cast(this)->getDeclContext(); + } + + void setAccess(AccessSpecifier AS) { + Access = AS; + CheckAccessDeclContext(); + } + + AccessSpecifier getAccess() const { + CheckAccessDeclContext(); + return AccessSpecifier(Access); + } + + bool hasAttrs() const { return HasAttrs; } + void addAttr(Attr *attr); + const Attr *getAttrs() const { + if (!HasAttrs) return 0; // common case, no attributes. + return getAttrsImpl(); // Uncommon case, out of line hash lookup. + } + void swapAttrs(Decl *D); + void invalidateAttrs(); + + template const T *getAttr() const { + for (const Attr *attr = getAttrs(); attr; attr = attr->getNext()) + if (const T *V = dyn_cast(attr)) + return V; + return 0; + } + + template bool hasAttr() const { + return getAttr() != 0; + } + + /// setInvalidDecl - Indicates the Decl had a semantic error. This + /// allows for graceful error recovery. + void setInvalidDecl(bool Invalid = true) { InvalidDecl = Invalid; } + bool isInvalidDecl() const { return (bool) InvalidDecl; } + + /// isImplicit - Indicates whether the declaration was implicitly + /// generated by the implementation. If false, this declaration + /// was written explicitly in the source code. + bool isImplicit() const { return Implicit; } + void setImplicit(bool I = true) { Implicit = I; } + + unsigned getIdentifierNamespace() const { + return IdentifierNamespace; + } + bool isInIdentifierNamespace(unsigned NS) const { + return getIdentifierNamespace() & NS; + } + static unsigned getIdentifierNamespaceForKind(Kind DK); + + + /// getLexicalDeclContext - The declaration context where this Decl was + /// lexically declared (LexicalDC). May be different from + /// getDeclContext() (SemanticDC). + /// e.g.: + /// + /// namespace A { + /// void f(); // SemanticDC == LexicalDC == 'namespace A' + /// } + /// void A::f(); // SemanticDC == namespace 'A' + /// // LexicalDC == global namespace + DeclContext *getLexicalDeclContext() { + if (isInSemaDC()) + return getSemanticDC(); + return getMultipleDC()->LexicalDC; + } + const DeclContext *getLexicalDeclContext() const { + return const_cast(this)->getLexicalDeclContext(); + } + + /// setDeclContext - Set both the semantic and lexical DeclContext + /// to DC. + void setDeclContext(DeclContext *DC); + + void setLexicalDeclContext(DeclContext *DC); + + // isDefinedOutsideFunctionOrMethod - This predicate returns true if this + // scoped decl is defined outside the current function or method. This is + // roughly global variables and functions, but also handles enums (which could + // be defined inside or outside a function etc). + bool isDefinedOutsideFunctionOrMethod() const; + + /// 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. + virtual Stmt* getBody(ASTContext &Context) const { return 0; } + + /// getCompoundBody - Returns getBody(), dyn_casted to a CompoundStmt. + CompoundStmt* getCompoundBody(ASTContext &Context) const; + + /// getBodyRBrace - Gets the right brace of the body, if a body exists. + /// This works whether the body is a CompoundStmt or a CXXTryStmt. + SourceLocation getBodyRBrace(ASTContext &Context) const; + + // global temp stats (until we have a per-module visitor) + static void addDeclKind(Kind k); + static bool CollectingStats(bool Enable = false); + static void PrintStats(); + + /// isTemplateParameter - Determines whether this declartion is a + /// template parameter. + bool isTemplateParameter() const; + + // 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, ASTContext &Context, + unsigned Indentation = 0); + void print(llvm::raw_ostream &Out, ASTContext &Context, + const PrintingPolicy &Policy, unsigned Indentation = 0); + static void printGroup(Decl** Begin, unsigned NumDecls, + llvm::raw_ostream &Out, ASTContext &Context, + const PrintingPolicy &Policy, + unsigned Indentation = 0); + void dump(ASTContext &Context); + +private: + const Attr *getAttrsImpl() const; + +}; + +/// PrettyStackTraceDecl - If a crash occurs, indicate that it happened when +/// doing something to a specific decl. +class PrettyStackTraceDecl : public llvm::PrettyStackTraceEntry { + Decl *TheDecl; + SourceLocation Loc; + SourceManager &SM; + const char *Message; +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 +/// that directly derive from DeclContext are mentioned, not their subclasses): +/// +/// TranslationUnitDecl +/// NamespaceDecl +/// FunctionDecl +/// TagDecl +/// ObjCMethodDecl +/// ObjCContainerDecl +/// ObjCCategoryImplDecl +/// ObjCImplementationDecl +/// LinkageSpecDecl +/// BlockDecl +/// +class DeclContext { + /// DeclKind - This indicates which class this is. + Decl::Kind DeclKind : 8; + + /// \brief Whether this declaration context also has some external + /// storage that contains additional declarations that are lexically + /// part of this context. + mutable bool ExternalLexicalStorage : 1; + + /// \brief Whether this declaration context also has some external + /// storage that contains additional declarations that are visible + /// in this context. + mutable bool ExternalVisibleStorage : 1; + + /// \brief Pointer to the data structure used to lookup declarations + /// within this context, which is a DenseMap. + mutable void* LookupPtr; + + /// FirstDecl - The first declaration stored within this declaration + /// context. + mutable Decl *FirstDecl; + + /// LastDecl - The last declaration stored within this declaration + /// context. FIXME: We could probably cache this value somewhere + /// outside of the DeclContext, to reduce the size of DeclContext by + /// another pointer. + mutable Decl *LastDecl; + +protected: + DeclContext(Decl::Kind K) + : DeclKind(K), ExternalLexicalStorage(false), + ExternalVisibleStorage(false), LookupPtr(0), FirstDecl(0), + LastDecl(0) { } + + void DestroyDecls(ASTContext &C); + +public: + ~DeclContext(); + + Decl::Kind getDeclKind() const { + return DeclKind; + } + const char *getDeclKindName() const; + + /// getParent - Returns the containing DeclContext. + DeclContext *getParent() { + return cast(this)->getDeclContext(); + } + const DeclContext *getParent() const { + return const_cast(this)->getParent(); + } + + /// getLexicalParent - Returns the containing lexical DeclContext. May be + /// different from getParent, e.g.: + /// + /// namespace A { + /// struct S; + /// } + /// struct A::S {}; // getParent() == namespace 'A' + /// // getLexicalParent() == translation unit + /// + DeclContext *getLexicalParent() { + return cast(this)->getLexicalDeclContext(); + } + const DeclContext *getLexicalParent() const { + return const_cast(this)->getLexicalParent(); + } + + bool isFunctionOrMethod() const { + switch (DeclKind) { + case Decl::Block: + case Decl::ObjCMethod: + return true; + default: + return DeclKind >= Decl::FunctionFirst && DeclKind <= Decl::FunctionLast; + } + } + + bool isFileContext() const { + return DeclKind == Decl::TranslationUnit || DeclKind == Decl::Namespace; + } + + bool isTranslationUnit() const { + return DeclKind == Decl::TranslationUnit; + } + + bool isRecord() const { + return DeclKind >= Decl::RecordFirst && DeclKind <= Decl::RecordLast; + } + + bool isNamespace() const { + return DeclKind == Decl::Namespace; + } + + /// \brief Determines whether this context is dependent on a + /// template parameter. + bool isDependentContext() const; + + /// isTransparentContext - Determines whether this context is a + /// "transparent" context, meaning that the members declared in this + /// 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: + /// @code + /// enum E { + /// Val1 + /// }; + /// @endcode + /// Here, E is a transparent context, so its enumerator (Val1) will + /// appear (semantically) that it is in the same context of E. + /// Examples of transparent contexts include: enumerations (except for + /// C++0x scoped enums), C++ linkage specifications, and C++0x + /// inline namespaces. + bool isTransparentContext() const; + + bool Encloses(DeclContext *DC) const { + for (; DC; DC = DC->getParent()) + if (DC == this) + return true; + return false; + } + + /// getPrimaryContext - There may be many different + /// declarations of the same entity (including forward declarations + /// of classes, multiple definitions of namespaces, etc.), each with + /// a different set of declarations. This routine returns the + /// "primary" DeclContext structure, which will contain the + /// information needed to perform name lookup into this context. + DeclContext *getPrimaryContext(); + + /// getLookupContext - Retrieve the innermost non-transparent + /// context of this context, which corresponds to the innermost + /// location from which name lookup can find the entities in this + /// context. + DeclContext *getLookupContext(); + const DeclContext *getLookupContext() const { + return const_cast(this)->getLookupContext(); + } + + /// \brief Retrieve the nearest enclosing namespace context. + DeclContext *getEnclosingNamespaceContext(); + const DeclContext *getEnclosingNamespaceContext() const { + return const_cast(this)->getEnclosingNamespaceContext(); + } + + /// getNextContext - If this is a DeclContext that may have other + /// DeclContexts that are semantically connected but syntactically + /// different, such as C++ namespaces, this routine retrieves the + /// next DeclContext in the link. Iteration through the chain of + /// DeclContexts should begin at the primary DeclContext and + /// continue until this function returns NULL. For example, given: + /// @code + /// namespace N { + /// int x; + /// } + /// namespace N { + /// int y; + /// } + /// @endcode + /// The first occurrence of namespace N will be the primary + /// DeclContext. Its getNextContext will return the second + /// occurrence of namespace N. + DeclContext *getNextContext(); + + /// decl_iterator - Iterates through the declarations stored + /// within this context. + class decl_iterator { + /// Current - The current declaration. + Decl *Current; + + public: + typedef Decl* value_type; + typedef Decl* reference; + typedef Decl* pointer; + typedef std::forward_iterator_tag iterator_category; + typedef std::ptrdiff_t difference_type; + + decl_iterator() : Current(0) { } + explicit decl_iterator(Decl *C) : Current(C) { } + + reference operator*() const { return Current; } + pointer operator->() const { return Current; } + + decl_iterator& operator++() { + Current = Current->getNextDeclInContext(); + return *this; + } + + decl_iterator operator++(int) { + decl_iterator tmp(*this); + ++(*this); + return tmp; + } + + friend bool operator==(decl_iterator x, decl_iterator y) { + return x.Current == y.Current; + } + 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. + decl_iterator decls_begin(ASTContext &Context) const; + decl_iterator decls_end(ASTContext &Context) const; + bool decls_empty(ASTContext &Context) const; + + /// specific_decl_iterator - Iterates over a subrange of + /// declarations stored in a DeclContext, providing only those that + /// are of type SpecificDecl (or a class derived from it). This + /// iterator is used, for example, to provide iteration over just + /// the fields within a RecordDecl (with SpecificDecl = FieldDecl). + template + class specific_decl_iterator { + /// Current - The current, underlying declaration iterator, which + /// 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. + void SkipToNextDecl() { + while (*Current && !isa(*Current)) + ++Current; + } + + public: + typedef SpecificDecl* value_type; + typedef SpecificDecl* reference; + typedef SpecificDecl* pointer; + typedef std::iterator_traits::difference_type + difference_type; + typedef std::forward_iterator_tag iterator_category; + + specific_decl_iterator() : Current() { } + + /// specific_decl_iterator - Construct a new iterator over a + /// subset of the declarations the range [C, + /// end-of-declarations). If A is non-NULL, it is a pointer to a + /// member function of SpecificDecl that should return true for + /// all of the SpecificDecl instances that will be in the subset + /// of iterators. For example, if you want Objective-C instance + /// methods, SpecificDecl will be ObjCMethodDecl and A will be + /// &ObjCMethodDecl::isInstanceMethod. + explicit specific_decl_iterator(DeclContext::decl_iterator C) : Current(C) { + SkipToNextDecl(); + } + + reference operator*() const { return cast(*Current); } + pointer operator->() const { return cast(*Current); } + + specific_decl_iterator& operator++() { + ++Current; + SkipToNextDecl(); + return *this; + } + + specific_decl_iterator operator++(int) { + specific_decl_iterator tmp(*this); + ++(*this); + return tmp; + } + + friend bool + operator==(const specific_decl_iterator& x, const specific_decl_iterator& y) { + return x.Current == y.Current; + } + + friend bool + operator!=(const specific_decl_iterator& x, const specific_decl_iterator& y) { + return x.Current != y.Current; + } + }; + + /// \brief Iterates over a filtered subrange of declarations stored + /// in a DeclContext. + /// + /// This iterator visits only those declarations that are of type + /// SpecificDecl (or a class derived from it) and that meet some + /// additional run-time criteria. This iterator is used, for + /// example, to provide access to the instance methods within an + /// Objective-C interface (with SpecificDecl = ObjCMethodDecl and + /// Acceptable = ObjCMethodDecl::isInstanceMethod). + template + class filtered_decl_iterator { + /// Current - The current, underlying declaration iterator, which + /// 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. + void SkipToNextDecl() { + while (*Current && + (!isa(*Current) || + (Acceptable && !(cast(*Current)->*Acceptable)()))) + ++Current; + } + + public: + typedef SpecificDecl* value_type; + typedef SpecificDecl* reference; + typedef SpecificDecl* pointer; + typedef std::iterator_traits::difference_type + difference_type; + typedef std::forward_iterator_tag iterator_category; + + filtered_decl_iterator() : Current() { } + + /// specific_decl_iterator - Construct a new iterator over a + /// subset of the declarations the range [C, + /// end-of-declarations). If A is non-NULL, it is a pointer to a + /// member function of SpecificDecl that should return true for + /// all of the SpecificDecl instances that will be in the subset + /// of iterators. For example, if you want Objective-C instance + /// methods, SpecificDecl will be ObjCMethodDecl and A will be + /// &ObjCMethodDecl::isInstanceMethod. + explicit filtered_decl_iterator(DeclContext::decl_iterator C) : Current(C) { + SkipToNextDecl(); + } + + reference operator*() const { return cast(*Current); } + pointer operator->() const { return cast(*Current); } + + filtered_decl_iterator& operator++() { + ++Current; + SkipToNextDecl(); + return *this; + } + + filtered_decl_iterator operator++(int) { + filtered_decl_iterator tmp(*this); + ++(*this); + return tmp; + } + + friend bool + operator==(const filtered_decl_iterator& x, const filtered_decl_iterator& y) { + return x.Current == y.Current; + } + + friend bool + operator!=(const filtered_decl_iterator& x, const filtered_decl_iterator& y) { + return x.Current != y.Current; + } + }; + + /// @brief Add the declaration D into this context. + /// + /// This routine should be invoked when the declaration D has first + /// been declared, to place D into the context where it was + /// (lexically) defined. Every declaration must be added to one + /// (and only one!) context, where it can be visited via + /// [decls_begin(), decls_end()). Once a declaration has been added + /// to its lexical context, the corresponding DeclContext owns the + /// declaration. + /// + /// If D is also a NamedDecl, it will be made visible within its + /// semantic context via makeDeclVisibleInContext. + void addDecl(ASTContext &Context, Decl *D); + + /// lookup_iterator - An iterator that provides access to the results + /// of looking up a name within this context. + typedef NamedDecl **lookup_iterator; + + /// lookup_const_iterator - An iterator that provides non-mutable + /// access to the results of lookup up a name within this context. + typedef NamedDecl * const * lookup_const_iterator; + + typedef std::pair lookup_result; + typedef std::pair + lookup_const_result; + + /// lookup - Find the declarations (if any) with the given Name in + /// this context. Returns a range of iterators that contains all of + /// the declarations with this name, with object, function, member, + /// and enumerator names preceding any tag name. Note that this + /// routine will not look into parent contexts. + lookup_result lookup(ASTContext &Context, DeclarationName Name); + lookup_const_result lookup(ASTContext &Context, DeclarationName Name) const; + + /// @brief Makes a declaration visible within this context. + /// + /// This routine makes the declaration D visible to name lookup + /// within this context and, if this is a transparent context, + /// within its parent contexts up to the first enclosing + /// non-transparent context. Making a declaration visible within a + /// context does not transfer ownership of a declaration, and a + /// declaration can be visible in many contexts that aren't its + /// lexical context. + /// + /// If D is a redeclaration of an existing declaration that is + /// visible from this context, as determined by + /// NamedDecl::declarationReplaces, the previous declaration will be + /// replaced with D. + void makeDeclVisibleInContext(ASTContext &Context, NamedDecl *D); + + /// udir_iterator - Iterates through the using-directives stored + /// within this context. + typedef UsingDirectiveDecl * const * udir_iterator; + + typedef std::pair udir_iterator_range; + + udir_iterator_range getUsingDirectives(ASTContext &Context) const; + + udir_iterator using_directives_begin(ASTContext &Context) const { + return getUsingDirectives(Context).first; + } + + udir_iterator using_directives_end(ASTContext &Context) const { + return getUsingDirectives(Context).second; + } + + // Low-level accessors + + /// \brief Retrieve the internal representation of the lookup structure. + void* getLookupPtr() const { return LookupPtr; } + + /// \brief Whether this DeclContext has external storage containing + /// additional declarations that are lexically in this context. + bool hasExternalLexicalStorage() const { return ExternalLexicalStorage; } + + /// \brief State whether this DeclContext has external storage for + /// declarations lexically in this context. + void setHasExternalLexicalStorage(bool ES = true) { + ExternalLexicalStorage = ES; + } + + /// \brief Whether this DeclContext has external storage containing + /// additional declarations that are visible in this context. + bool hasExternalVisibleStorage() const { return ExternalVisibleStorage; } + + /// \brief State whether this DeclContext has external storage for + /// declarations visible in this context. + void setHasExternalVisibleStorage(bool ES = true) { + ExternalVisibleStorage = ES; + } + + static bool classof(const Decl *D); + static bool classof(const DeclContext *D) { return true; } +#define DECL_CONTEXT(Name) \ + static bool classof(const Name##Decl *D) { return true; } +#include "clang/AST/DeclNodes.def" + +private: + void LoadLexicalDeclsFromExternalStorage(ASTContext &Context) const; + void LoadVisibleDeclsFromExternalStorage(ASTContext &Context) const; + + void buildLookup(ASTContext &Context, DeclContext *DCtx); + void makeDeclVisibleInContextImpl(ASTContext &Context, NamedDecl *D); +}; + +inline bool Decl::isTemplateParameter() const { + return getKind() == TemplateTypeParm || getKind() == NonTypeTemplateParm; +} + +inline bool Decl::isDefinedOutsideFunctionOrMethod() const { + if (getDeclContext()) + return !getDeclContext()->getLookupContext()->isFunctionOrMethod(); + return true; +} + +} // end clang. + +namespace llvm { + +/// Implement a isa_impl_wrap specialization to check whether a DeclContext is +/// a specific Decl. +template +struct isa_impl_wrap { + static bool doit(const ::clang::DeclContext &Val) { + return ToTy::classof(::clang::Decl::castFromDeclContext(&Val)); + } +}; +template +struct isa_impl_wrap + : public isa_impl_wrap {}; + +/// Implement cast_convert_val for Decl -> DeclContext conversions. +template +struct cast_convert_val< ::clang::DeclContext, FromTy, FromTy> { + static ::clang::DeclContext &doit(const FromTy &Val) { + return *FromTy::castToDeclContext(&Val); + } +}; + +template +struct cast_convert_val< ::clang::DeclContext, FromTy*, FromTy*> { + static ::clang::DeclContext *doit(const FromTy *Val) { + return FromTy::castToDeclContext(Val); + } +}; + +template +struct cast_convert_val< const ::clang::DeclContext, FromTy, FromTy> { + static const ::clang::DeclContext &doit(const FromTy &Val) { + return *FromTy::castToDeclContext(&Val); + } +}; + +template +struct cast_convert_val< const ::clang::DeclContext, FromTy*, FromTy*> { + static const ::clang::DeclContext *doit(const FromTy *Val) { + return FromTy::castToDeclContext(Val); + } +}; + +/// Implement cast_convert_val for DeclContext -> Decl conversions. +template +struct cast_convert_val { + static ToTy &doit(const ::clang::DeclContext &Val) { + return *reinterpret_cast(ToTy::castFromDeclContext(&Val)); + } +}; +template +struct cast_convert_val + : public cast_convert_val {}; + +template +struct cast_convert_val { + static ToTy *doit(const ::clang::DeclContext *Val) { + return reinterpret_cast(ToTy::castFromDeclContext(Val)); + } +}; +template +struct cast_convert_val + : public cast_convert_val {}; + +} // end namespace llvm + +#endif diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h new file mode 100644 index 0000000..4a74a2c --- /dev/null +++ b/include/clang/AST/DeclCXX.h @@ -0,0 +1,1073 @@ +//===-- DeclCXX.h - Classes for representing C++ declarations -*- 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 C++ Decl subclasses. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_DECLCXX_H +#define LLVM_CLANG_AST_DECLCXX_H + +#include "clang/AST/Decl.h" +#include "llvm/ADT/SmallVector.h" + +namespace clang { + +class ClassTemplateDecl; +class CXXRecordDecl; +class CXXConstructorDecl; +class CXXDestructorDecl; +class CXXConversionDecl; +class CXXMethodDecl; +class ClassTemplateSpecializationDecl; + +/// 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. +/// +/// An OverloadedFunctionDecl has no ownership over the FunctionDecl +/// nodes it contains. Rather, the FunctionDecls are owned by the +/// enclosing scope (which also owns the OverloadedFunctionDecl +/// node). OverloadedFunctionDecl is used primarily to store a set of +/// overloaded functions for name lookup. +class OverloadedFunctionDecl : public NamedDecl { +protected: + OverloadedFunctionDecl(DeclContext *DC, DeclarationName N) + : NamedDecl(OverloadedFunction, DC, SourceLocation(), N) { } + + /// Functions - the set of overloaded functions contained in this + /// overload set. + llvm::SmallVector Functions; + + // FIXME: This should go away when we stop using + // OverloadedFunctionDecl to store conversions in CXXRecordDecl. + friend class CXXRecordDecl; + +public: + typedef llvm::SmallVector::iterator function_iterator; + typedef llvm::SmallVector::const_iterator + function_const_iterator; + + static OverloadedFunctionDecl *Create(ASTContext &C, DeclContext *DC, + DeclarationName N); + + /// addOverload - Add an overloaded function FD to this set of + /// overloaded functions. + void addOverload(FunctionDecl *FD) { + assert((FD->getDeclName() == getDeclName() || + isa(FD) || isa(FD)) && + "Overloaded functions must have the same name"); + Functions.push_back(FD); + + // An overloaded function declaration always has the location of + // the most-recently-added function declaration. + if (FD->getLocation().isValid()) + this->setLocation(FD->getLocation()); + } + + function_iterator function_begin() { return Functions.begin(); } + function_iterator function_end() { return Functions.end(); } + function_const_iterator function_begin() const { return Functions.begin(); } + function_const_iterator function_end() const { return Functions.end(); } + + /// getNumFunctions - the number of overloaded functions stored in + /// this set. + unsigned getNumFunctions() const { return Functions.size(); } + + /// getFunction - retrieve the ith function in the overload set. + const FunctionDecl *getFunction(unsigned i) const { + assert(i < getNumFunctions() && "Illegal function #"); + return Functions[i]; + } + FunctionDecl *getFunction(unsigned i) { + assert(i < getNumFunctions() && "Illegal function #"); + return Functions[i]; + } + + // getDeclContext - Get the context of these overloaded functions. + DeclContext *getDeclContext() { + assert(getNumFunctions() > 0 && "Context of an empty overload set"); + return getFunction(0)->getDeclContext(); + } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { + return D->getKind() == OverloadedFunction; + } + static bool classof(const OverloadedFunctionDecl *D) { return true; } +}; + +/// CXXBaseSpecifier - A base class of a C++ class. +/// +/// Each CXXBaseSpecifier represents a single, direct base class (or +/// struct) of a C++ class (or struct). It specifies the type of that +/// base class, whether it is a virtual or non-virtual base, and what +/// level of access (public, protected, private) is used for the +/// derivation. For example: +/// +/// @code +/// class A { }; +/// class B { }; +/// class C : public virtual A, protected B { }; +/// @endcode +/// +/// In this code, C will have two CXXBaseSpecifiers, one for "public +/// virtual A" and the other for "protected B". +class CXXBaseSpecifier { + /// Range - The source code range that covers the full base + /// specifier, including the "virtual" (if present) and access + /// specifier (if present). + SourceRange Range; + + /// Virtual - Whether this is a virtual base class or not. + bool Virtual : 1; + + /// BaseOfClass - Whether this is the base of a class (true) or of a + /// struct (false). This determines the mapping from the access + /// specifier as written in the source code to the access specifier + /// used for semantic analysis. + bool BaseOfClass : 1; + + /// Access - Access specifier as written in the source code (which + /// may be AS_none). The actual type of data stored here is an + /// AccessSpecifier, but we use "unsigned" here to work around a + /// VC++ bug. + unsigned Access : 2; + + /// BaseType - The type of the base class. This will be a class or + /// struct (or a typedef of such). + QualType BaseType; + +public: + CXXBaseSpecifier() { } + + CXXBaseSpecifier(SourceRange R, bool V, bool BC, AccessSpecifier A, QualType T) + : Range(R), Virtual(V), BaseOfClass(BC), Access(A), BaseType(T) { } + + /// getSourceRange - Retrieves the source range that contains the + /// entire base specifier. + SourceRange getSourceRange() const { return Range; } + + /// isVirtual - Determines whether the base class is a virtual base + /// class (or not). + bool isVirtual() const { return Virtual; } + + /// getAccessSpecifier - Returns the access specifier for this base + /// specifier. This is the actual base specifier as used for + /// semantic analysis, so the result can never be AS_none. To + /// retrieve the access specifier as written in the source code, use + /// getAccessSpecifierAsWritten(). + AccessSpecifier getAccessSpecifier() const { + if ((AccessSpecifier)Access == AS_none) + return BaseOfClass? AS_private : AS_public; + else + return (AccessSpecifier)Access; + } + + /// getAccessSpecifierAsWritten - Retrieves the access specifier as + /// written in the source code (which may mean that no access + /// specifier was explicitly written). Use getAccessSpecifier() to + /// retrieve the access specifier for use in semantic analysis. + AccessSpecifier getAccessSpecifierAsWritten() const { + return (AccessSpecifier)Access; + } + + /// getType - Retrieves the type of the base class. This type will + /// always be an unqualified class type. + QualType getType() const { return BaseType; } +}; + +/// CXXRecordDecl - Represents a C++ struct/union/class. +/// FIXME: This class will disappear once we've properly taught RecordDecl +/// to deal with C++-specific things. +class CXXRecordDecl : public RecordDecl { + /// UserDeclaredConstructor - True when this class has a + /// user-declared constructor. + bool UserDeclaredConstructor : 1; + + /// UserDeclaredCopyConstructor - True when this class has a + /// user-declared copy constructor. + bool UserDeclaredCopyConstructor : 1; + + /// UserDeclaredCopyAssignment - True when this class has a + /// user-declared copy assignment operator. + bool UserDeclaredCopyAssignment : 1; + + /// UserDeclaredDestructor - True when this class has a + /// user-declared destructor. + bool UserDeclaredDestructor : 1; + + /// Aggregate - True when this class is an aggregate. + bool Aggregate : 1; + + /// PlainOldData - True when this class is a POD-type. + bool PlainOldData : 1; + + /// Polymorphic - True when this class is polymorphic, i.e. has at least one + /// virtual member or derives from a polymorphic class. + bool Polymorphic : 1; + + /// Abstract - True when this class is abstract, i.e. has at least one + /// pure virtual function, (that can come from a base class). + bool Abstract : 1; + + /// HasTrivialConstructor - True when this class has a trivial constructor + bool HasTrivialConstructor : 1; + + /// HasTrivialDestructor - True when this class has a trivial destructor + bool HasTrivialDestructor : 1; + + /// Bases - Base classes of this class. + /// FIXME: This is wasted space for a union. + CXXBaseSpecifier *Bases; + + /// NumBases - The number of base class specifiers in Bases. + unsigned NumBases; + + /// Conversions - Overload set containing the conversion functions + /// of this C++ class (but not its inherited conversion + /// functions). Each of the entries in this overload set is a + /// CXXConversionDecl. + OverloadedFunctionDecl Conversions; + + /// \brief The template or declaration that this declaration + /// describes or was instantiated from, respectively. + /// + /// For non-templates, this value will be NULL. For record + /// declarations that describe a class template, this will be a + /// pointer to a ClassTemplateDecl. For member + /// classes of class template specializations, this will be the + /// RecordDecl from which the member class was instantiated. + llvm::PointerUnion + TemplateOrInstantiation; + +protected: + CXXRecordDecl(Kind K, TagKind TK, DeclContext *DC, + SourceLocation L, IdentifierInfo *Id); + + ~CXXRecordDecl(); + +public: + /// base_class_iterator - Iterator that traverses the base classes + /// of a clas. + typedef CXXBaseSpecifier* base_class_iterator; + + /// base_class_const_iterator - Iterator that traverses the base + /// classes of a clas. + typedef const CXXBaseSpecifier* base_class_const_iterator; + + static CXXRecordDecl *Create(ASTContext &C, TagKind TK, DeclContext *DC, + SourceLocation L, IdentifierInfo *Id, + CXXRecordDecl* PrevDecl=0, + bool DelayTypeCreation = false); + + /// setBases - Sets the base classes of this struct or class. + void setBases(CXXBaseSpecifier const * const *Bases, unsigned NumBases); + + /// getNumBases - Retrieves the number of base classes of this + /// class. + unsigned getNumBases() const { return NumBases; } + + base_class_iterator bases_begin() { return Bases; } + base_class_const_iterator bases_begin() const { return Bases; } + base_class_iterator bases_end() { return Bases + NumBases; } + base_class_const_iterator bases_end() const { return Bases + NumBases; } + + /// hasConstCopyConstructor - Determines whether this class has a + /// copy constructor that accepts a const-qualified argument. + bool hasConstCopyConstructor(ASTContext &Context) const; + + /// hasConstCopyAssignment - Determines whether this class has a + /// copy assignment operator that accepts a const-qualified argument. + bool hasConstCopyAssignment(ASTContext &Context) const; + + /// addedConstructor - Notify the class that another constructor has + /// been added. This routine helps maintain information about the + /// class based on which constructors have been added. + void addedConstructor(ASTContext &Context, CXXConstructorDecl *ConDecl); + + /// hasUserDeclaredConstructor - Whether this class has any + /// user-declared constructors. When true, a default constructor + /// will not be implicitly declared. + bool hasUserDeclaredConstructor() const { return UserDeclaredConstructor; } + + /// hasUserDeclaredCopyConstructor - Whether this class has a + /// user-declared copy constructor. When false, a copy constructor + /// will be implicitly declared. + bool hasUserDeclaredCopyConstructor() const { + return UserDeclaredCopyConstructor; + } + + /// addedAssignmentOperator - Notify the class that another assignment + /// operator has been added. This routine helps maintain information about the + /// class based on which operators have been added. + void addedAssignmentOperator(ASTContext &Context, CXXMethodDecl *OpDecl); + + /// hasUserDeclaredCopyAssignment - Whether this class has a + /// user-declared copy assignment operator. When false, a copy + /// assigment operator will be implicitly declared. + bool hasUserDeclaredCopyAssignment() const { + return UserDeclaredCopyAssignment; + } + + /// hasUserDeclaredDestructor - Whether this class has a + /// user-declared destructor. When false, a destructor will be + /// implicitly declared. + bool hasUserDeclaredDestructor() const { return UserDeclaredDestructor; } + + /// setUserDeclaredDestructor - Set whether this class has a + /// user-declared destructor. If not set by the time the class is + /// fully defined, a destructor will be implicitly declared. + void setUserDeclaredDestructor(bool UCD) { + UserDeclaredDestructor = UCD; + } + + /// getConversions - Retrieve the overload set containing all of the + /// conversion functions in this class. + OverloadedFunctionDecl *getConversionFunctions() { + return &Conversions; + } + const OverloadedFunctionDecl *getConversionFunctions() const { + return &Conversions; + } + + /// addConversionFunction - Add a new conversion function to the + /// list of conversion functions. + void addConversionFunction(ASTContext &Context, CXXConversionDecl *ConvDecl); + + /// isAggregate - Whether this class is an aggregate (C++ + /// [dcl.init.aggr]), which is a class with no user-declared + /// constructors, no private or protected non-static data members, + /// no base classes, and no virtual functions (C++ [dcl.init.aggr]p1). + bool isAggregate() const { return Aggregate; } + + /// setAggregate - Set whether this class is an aggregate (C++ + /// [dcl.init.aggr]). + void setAggregate(bool Agg) { Aggregate = Agg; } + + /// isPOD - Whether this class is a POD-type (C++ [class]p4), which is a class + /// that is an aggregate that has no non-static non-POD data members, no + /// reference data members, no user-defined copy assignment operator and no + /// user-defined destructor. + bool isPOD() const { return PlainOldData; } + + /// setPOD - Set whether this class is a POD-type (C++ [class]p4). + void setPOD(bool POD) { PlainOldData = POD; } + + /// isPolymorphic - Whether this class is polymorphic (C++ [class.virtual]), + /// which means that the class contains or inherits a virtual function. + bool isPolymorphic() const { return Polymorphic; } + + /// setPolymorphic - Set whether this class is polymorphic (C++ + /// [class.virtual]). + void setPolymorphic(bool Poly) { Polymorphic = Poly; } + + /// isAbstract - Whether this class is abstract (C++ [class.abstract]), + /// which means that the class contains or inherits a pure virtual function. + bool isAbstract() const { return Abstract; } + + /// setAbstract - Set whether this class is abstract (C++ [class.abstract]) + void setAbstract(bool Abs) { Abstract = Abs; } + + // hasTrivialConstructor - Whether this class has a trivial constructor + // (C++ [class.ctor]p5) + bool hasTrivialConstructor() const { return HasTrivialConstructor; } + + // setHasTrivialConstructor - Set whether this class has a trivial constructor + // (C++ [class.ctor]p5) + void setHasTrivialConstructor(bool TC) { HasTrivialConstructor = TC; } + + // hasTrivialDestructor - Whether this class has a trivial destructor + // (C++ [class.dtor]p3) + bool hasTrivialDestructor() const { return HasTrivialDestructor; } + + // setHasTrivialDestructor - Set whether this class has a trivial destructor + // (C++ [class.dtor]p3) + void setHasTrivialDestructor(bool TC) { HasTrivialDestructor = TC; } + + /// \brief If this record is an instantiation of a member class, + /// retrieves the member class from which it was instantiated. + /// + /// This routine will return non-NULL for (non-templated) member + /// classes of class templates. For example, given: + /// + /// \code + /// template + /// struct X { + /// struct A { }; + /// }; + /// \endcode + /// + /// The declaration for X::A is a (non-templated) CXXRecordDecl + /// whose parent is the class template specialization X. For + /// this declaration, getInstantiatedFromMemberClass() will return + /// the CXXRecordDecl X::A. When a complete definition of + /// X::A is required, it will be instantiated from the + /// declaration returned by getInstantiatedFromMemberClass(). + CXXRecordDecl *getInstantiatedFromMemberClass() const { + return TemplateOrInstantiation.dyn_cast(); + } + + /// \brief Specify that this record is an instantiation of the + /// member class RD. + void setInstantiationOfMemberClass(CXXRecordDecl *RD) { + TemplateOrInstantiation = RD; + } + + /// \brief Retrieves the class template that is described by this + /// class declaration. + /// + /// Every class template is represented as a ClassTemplateDecl and a + /// CXXRecordDecl. The former contains template properties (such as + /// the template parameter lists) while the latter contains the + /// actual description of the template's + /// contents. ClassTemplateDecl::getTemplatedDecl() retrieves the + /// CXXRecordDecl that from a ClassTemplateDecl, while + /// getDescribedClassTemplate() retrieves the ClassTemplateDecl from + /// a CXXRecordDecl. + ClassTemplateDecl *getDescribedClassTemplate() const { + return TemplateOrInstantiation.dyn_cast(); + } + + void setDescribedClassTemplate(ClassTemplateDecl *Template) { + TemplateOrInstantiation = Template; + } + + /// getDestructor - Returns the destructor decl for this class. + const CXXDestructorDecl *getDestructor(ASTContext &Context); + + /// viewInheritance - Renders and displays an inheritance diagram + /// for this C++ class and all of its base classes (transitively) using + /// GraphViz. + void viewInheritance(ASTContext& Context) const; + + static bool classof(const Decl *D) { + return D->getKind() == CXXRecord || + D->getKind() == ClassTemplateSpecialization || + D->getKind() == ClassTemplatePartialSpecialization; + } + static bool classof(const CXXRecordDecl *D) { return true; } + static bool classof(const ClassTemplateSpecializationDecl *D) { + return true; + } +}; + +/// CXXMethodDecl - Represents a static or instance method of a +/// struct/union/class. +class CXXMethodDecl : public FunctionDecl { +protected: + CXXMethodDecl(Kind DK, CXXRecordDecl *RD, SourceLocation L, + DeclarationName N, QualType T, + bool isStatic, bool isInline) + : FunctionDecl(DK, RD, L, N, T, (isStatic ? Static : None), + isInline) {} + +public: + static CXXMethodDecl *Create(ASTContext &C, CXXRecordDecl *RD, + SourceLocation L, DeclarationName N, + QualType T, bool isStatic = false, + bool isInline = false); + + bool isStatic() const { return getStorageClass() == Static; } + bool isInstance() const { return !isStatic(); } + + bool isOutOfLineDefinition() const { + return getLexicalDeclContext() != getDeclContext(); + } + + bool isVirtual() const { + return isVirtualAsWritten() || + (begin_overridden_methods() != end_overridden_methods()); + } + + /// + void addOverriddenMethod(const CXXMethodDecl *MD); + + typedef const CXXMethodDecl ** method_iterator; + + method_iterator begin_overridden_methods() const; + method_iterator end_overridden_methods() const; + + /// getParent - Returns the parent of this method declaration, which + /// is the class in which this method is defined. + const CXXRecordDecl *getParent() const { + return cast(FunctionDecl::getParent()); + } + + /// getParent - Returns the parent of this method declaration, which + /// is the class in which this method is defined. + CXXRecordDecl *getParent() { + return const_cast( + cast(FunctionDecl::getParent())); + } + + /// getThisType - Returns the type of 'this' pointer. + /// Should only be called for instance methods. + QualType getThisType(ASTContext &C) const; + + unsigned getTypeQualifiers() const { + return getType()->getAsFunctionProtoType()->getTypeQuals(); + } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { + return D->getKind() >= CXXMethod && D->getKind() <= CXXConversion; + } + static bool classof(const CXXMethodDecl *D) { return true; } +}; + +/// CXXBaseOrMemberInitializer - Represents a C++ base or member +/// initializer, which is part of a constructor initializer that +/// initializes one non-static member variable or one base class. For +/// example, in the following, both 'A(a)' and 'f(3.14159)' are member +/// initializers: +/// +/// @code +/// class A { }; +/// class B : public A { +/// float f; +/// public: +/// B(A& a) : A(a), f(3.14159) { } +/// }; +class CXXBaseOrMemberInitializer { + /// BaseOrMember - This points to the entity being initialized, + /// which is either a base class (a Type) or a non-static data + /// member. When the low bit is 1, it's a base + /// class; when the low bit is 0, it's a member. + uintptr_t BaseOrMember; + + /// Args - The arguments used to initialize the base or member. + Expr **Args; + unsigned NumArgs; + +public: + /// CXXBaseOrMemberInitializer - Creates a new base-class initializer. + explicit + CXXBaseOrMemberInitializer(QualType BaseType, Expr **Args, unsigned NumArgs); + + /// CXXBaseOrMemberInitializer - Creates a new member initializer. + explicit + CXXBaseOrMemberInitializer(FieldDecl *Member, Expr **Args, unsigned NumArgs); + + /// ~CXXBaseOrMemberInitializer - Destroy the base or member initializer. + ~CXXBaseOrMemberInitializer(); + + /// arg_iterator - Iterates through the member initialization + /// arguments. + typedef Expr **arg_iterator; + + /// arg_const_iterator - Iterates through the member initialization + /// arguments. + typedef Expr * const * arg_const_iterator; + + /// isBaseInitializer - Returns true when this initializer is + /// initializing a base class. + bool isBaseInitializer() const { return (BaseOrMember & 0x1) != 0; } + + /// isMemberInitializer - Returns true when this initializer is + /// initializing a non-static data member. + bool isMemberInitializer() const { return (BaseOrMember & 0x1) == 0; } + + /// getBaseClass - If this is a base class initializer, returns the + /// type used to specify the initializer. The resulting type will be + /// a class type or a typedef of a class type. If this is not a base + /// class initializer, returns NULL. + Type *getBaseClass() { + if (isBaseInitializer()) + return reinterpret_cast(BaseOrMember & ~0x01); + else + return 0; + } + + /// getBaseClass - If this is a base class initializer, returns the + /// type used to specify the initializer. The resulting type will be + /// a class type or a typedef of a class type. If this is not a base + /// class initializer, returns NULL. + const Type *getBaseClass() const { + if (isBaseInitializer()) + return reinterpret_cast(BaseOrMember & ~0x01); + else + return 0; + } + + /// getMember - If this is a member initializer, returns the + /// declaration of the non-static data member being + /// initialized. Otherwise, returns NULL. + FieldDecl *getMember() { + if (isMemberInitializer()) + return reinterpret_cast(BaseOrMember); + else + return 0; + } + + /// begin() - Retrieve an iterator to the first initializer argument. + arg_iterator begin() { return Args; } + /// begin() - Retrieve an iterator to the first initializer argument. + arg_const_iterator begin() const { return Args; } + + /// end() - Retrieve an iterator past the last initializer argument. + arg_iterator end() { return Args + NumArgs; } + /// end() - Retrieve an iterator past the last initializer argument. + arg_const_iterator end() const { return Args + NumArgs; } + + /// getNumArgs - Determine the number of arguments used to + /// initialize the member or base. + unsigned getNumArgs() const { return NumArgs; } +}; + +/// CXXConstructorDecl - Represents a C++ constructor within a +/// class. For example: +/// +/// @code +/// class X { +/// public: +/// explicit X(int); // represented by a CXXConstructorDecl. +/// }; +/// @endcode +class CXXConstructorDecl : public CXXMethodDecl { + /// Explicit - Whether this constructor is explicit. + bool Explicit : 1; + + /// ImplicitlyDefined - Whether this constructor was implicitly + /// defined by the compiler. When false, the constructor was defined + /// by the user. In C++03, this flag will have the same value as + /// Implicit. In C++0x, however, a constructor that is + /// explicitly defaulted (i.e., defined with " = default") will have + /// @c !Implicit && ImplicitlyDefined. + bool ImplicitlyDefined : 1; + + /// FIXME: Add support for base and member initializers. + + CXXConstructorDecl(CXXRecordDecl *RD, SourceLocation L, + DeclarationName N, QualType T, + bool isExplicit, bool isInline, bool isImplicitlyDeclared) + : CXXMethodDecl(CXXConstructor, RD, L, N, T, false, isInline), + Explicit(isExplicit), ImplicitlyDefined(false) { + setImplicit(isImplicitlyDeclared); + } + +public: + static CXXConstructorDecl *Create(ASTContext &C, CXXRecordDecl *RD, + SourceLocation L, DeclarationName N, + QualType T, bool isExplicit, + bool isInline, bool isImplicitlyDeclared); + + /// isExplicit - Whether this constructor was marked "explicit" or not. + bool isExplicit() const { return Explicit; } + + /// isImplicitlyDefined - Whether this constructor was implicitly + /// defined. If false, then this constructor was defined by the + /// user. This operation can only be invoked if the constructor has + /// already been defined. + bool isImplicitlyDefined(ASTContext &C) const { + assert(isThisDeclarationADefinition() && + "Can only get the implicit-definition flag once the constructor has been defined"); + return ImplicitlyDefined; + } + + /// setImplicitlyDefined - Set whether this constructor was + /// implicitly defined or not. + void setImplicitlyDefined(bool ID) { + assert(isThisDeclarationADefinition() && + "Can only set the implicit-definition flag once the constructor has been defined"); + ImplicitlyDefined = ID; + } + + /// isDefaultConstructor - Whether this constructor is a default + /// constructor (C++ [class.ctor]p5), which can be used to + /// default-initialize a class of this type. + bool isDefaultConstructor() const; + + /// isCopyConstructor - Whether this constructor is a copy + /// constructor (C++ [class.copy]p2, which can be used to copy the + /// class. @p TypeQuals will be set to the qualifiers on the + /// argument type. For example, @p TypeQuals would be set to @c + /// QualType::Const for the following copy constructor: + /// + /// @code + /// class X { + /// public: + /// X(const X&); + /// }; + /// @endcode + bool isCopyConstructor(ASTContext &Context, unsigned &TypeQuals) const; + + /// isCopyConstructor - Whether this constructor is a copy + /// constructor (C++ [class.copy]p2, which can be used to copy the + /// class. + bool isCopyConstructor(ASTContext &Context) const { + unsigned TypeQuals = 0; + return isCopyConstructor(Context, TypeQuals); + } + + /// isConvertingConstructor - Whether this constructor is a + /// converting constructor (C++ [class.conv.ctor]), which can be + /// used for user-defined conversions. + bool isConvertingConstructor() const; + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { + return D->getKind() == CXXConstructor; + } + static bool classof(const CXXConstructorDecl *D) { return true; } +}; + +/// CXXDestructorDecl - Represents a C++ destructor within a +/// class. For example: +/// +/// @code +/// class X { +/// public: +/// ~X(); // represented by a CXXDestructorDecl. +/// }; +/// @endcode +class CXXDestructorDecl : public CXXMethodDecl { + /// ImplicitlyDefined - Whether this destructor was implicitly + /// defined by the compiler. When false, the destructor was defined + /// by the user. In C++03, this flag will have the same value as + /// Implicit. In C++0x, however, a destructor that is + /// explicitly defaulted (i.e., defined with " = default") will have + /// @c !Implicit && ImplicitlyDefined. + bool ImplicitlyDefined : 1; + + CXXDestructorDecl(CXXRecordDecl *RD, SourceLocation L, + DeclarationName N, QualType T, + bool isInline, bool isImplicitlyDeclared) + : CXXMethodDecl(CXXDestructor, RD, L, N, T, false, isInline), + ImplicitlyDefined(false) { + setImplicit(isImplicitlyDeclared); + } + +public: + static CXXDestructorDecl *Create(ASTContext &C, CXXRecordDecl *RD, + SourceLocation L, DeclarationName N, + QualType T, bool isInline, + bool isImplicitlyDeclared); + + /// isImplicitlyDefined - Whether this destructor was implicitly + /// defined. If false, then this destructor was defined by the + /// user. This operation can only be invoked if the destructor has + /// already been defined. + bool isImplicitlyDefined() const { + assert(isThisDeclarationADefinition() && + "Can only get the implicit-definition flag once the destructor has been defined"); + return ImplicitlyDefined; + } + + /// setImplicitlyDefined - Set whether this destructor was + /// implicitly defined or not. + void setImplicitlyDefined(bool ID) { + assert(isThisDeclarationADefinition() && + "Can only set the implicit-definition flag once the destructor has been defined"); + ImplicitlyDefined = ID; + } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { + return D->getKind() == CXXDestructor; + } + static bool classof(const CXXDestructorDecl *D) { return true; } +}; + +/// CXXConversionDecl - Represents a C++ conversion function within a +/// class. For example: +/// +/// @code +/// class X { +/// public: +/// operator bool(); +/// }; +/// @endcode +class CXXConversionDecl : public CXXMethodDecl { + /// Explicit - Whether this conversion function is marked + /// "explicit", meaning that it can only be applied when the user + /// explicitly wrote a cast. This is a C++0x feature. + bool Explicit : 1; + + CXXConversionDecl(CXXRecordDecl *RD, SourceLocation L, + DeclarationName N, QualType T, + bool isInline, bool isExplicit) + : CXXMethodDecl(CXXConversion, RD, L, N, T, false, isInline), + Explicit(isExplicit) { } + +public: + static CXXConversionDecl *Create(ASTContext &C, CXXRecordDecl *RD, + SourceLocation L, DeclarationName N, + QualType T, bool isInline, + bool isExplicit); + + /// isExplicit - Whether this is an explicit conversion operator + /// (C++0x only). Explicit conversion operators are only considered + /// when the user has explicitly written a cast. + bool isExplicit() const { return Explicit; } + + /// getConversionType - Returns the type that this conversion + /// function is converting to. + QualType getConversionType() const { + return getType()->getAsFunctionType()->getResultType(); + } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { + return D->getKind() == CXXConversion; + } + static bool classof(const CXXConversionDecl *D) { return true; } +}; + +/// LinkageSpecDecl - This represents a linkage specification. For example: +/// extern "C" void foo(); +/// +class LinkageSpecDecl : public Decl, public DeclContext { +public: + /// LanguageIDs - Used to represent the language in a linkage + /// specification. The values are part of the serialization abi for + /// ASTs and cannot be changed without altering that abi. To help + /// ensure a stable abi for this, we choose the DW_LANG_ encodings + /// from the dwarf standard. + enum LanguageIDs { lang_c = /* DW_LANG_C */ 0x0002, + lang_cxx = /* DW_LANG_C_plus_plus */ 0x0004 }; +private: + /// Language - The language for this linkage specification. + LanguageIDs Language; + + /// HadBraces - Whether this linkage specification had curly braces or not. + bool HadBraces : 1; + + LinkageSpecDecl(DeclContext *DC, SourceLocation L, LanguageIDs lang, + bool Braces) + : Decl(LinkageSpec, DC, L), + DeclContext(LinkageSpec), Language(lang), HadBraces(Braces) { } + +public: + static LinkageSpecDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, LanguageIDs Lang, + bool Braces); + + LanguageIDs getLanguage() const { return Language; } + + /// hasBraces - Determines whether this linkage specification had + /// braces in its syntactic form. + bool hasBraces() const { return HadBraces; } + + static bool classof(const Decl *D) { + return D->getKind() == LinkageSpec; + } + static bool classof(const LinkageSpecDecl *D) { return true; } + static DeclContext *castToDeclContext(const LinkageSpecDecl *D) { + return static_cast(const_cast(D)); + } + static LinkageSpecDecl *castFromDeclContext(const DeclContext *DC) { + return static_cast(const_cast(DC)); + } +}; + +/// UsingDirectiveDecl - Represents C++ using-directive. For example: +/// +/// using namespace std; +/// +// NB: UsingDirectiveDecl should be Decl not NamedDecl, but we provide +// artificial name, for all using-directives in order to store +// them in DeclContext effectively. +class UsingDirectiveDecl : public NamedDecl { + + /// SourceLocation - Location of 'namespace' token. + SourceLocation NamespaceLoc; + + /// \brief The source range that covers the nested-name-specifier + /// preceding the namespace name. + SourceRange QualifierRange; + + /// \brief The nested-name-specifier that precedes the namespace + /// name, if any. + NestedNameSpecifier *Qualifier; + + /// IdentLoc - Location of nominated namespace-name identifier. + // FIXME: We don't store location of scope specifier. + SourceLocation IdentLoc; + + /// NominatedNamespace - Namespace nominated by using-directive. + NamespaceDecl *NominatedNamespace; + + /// Enclosing context containing both using-directive and nomintated + /// namespace. + DeclContext *CommonAncestor; + + /// getUsingDirectiveName - Returns special DeclarationName used by + /// using-directives. This is only used by DeclContext for storing + /// UsingDirectiveDecls in its lookup structure. + static DeclarationName getName() { + return DeclarationName::getUsingDirectiveName(); + } + + UsingDirectiveDecl(DeclContext *DC, SourceLocation L, + SourceLocation NamespcLoc, + SourceRange QualifierRange, + NestedNameSpecifier *Qualifier, + SourceLocation IdentLoc, + NamespaceDecl *Nominated, + DeclContext *CommonAncestor) + : NamedDecl(Decl::UsingDirective, DC, L, getName()), + NamespaceLoc(NamespcLoc), QualifierRange(QualifierRange), + Qualifier(Qualifier), IdentLoc(IdentLoc), + NominatedNamespace(Nominated? Nominated->getOriginalNamespace() : 0), + CommonAncestor(CommonAncestor) { + } + +public: + /// \brief Retrieve the source range of the nested-name-specifier + /// that qualifiers the namespace name. + SourceRange getQualifierRange() const { return QualifierRange; } + + /// \brief Retrieve the nested-name-specifier that qualifies the + /// name of the namespace. + NestedNameSpecifier *getQualifier() const { return Qualifier; } + + /// getNominatedNamespace - Returns namespace nominated by using-directive. + NamespaceDecl *getNominatedNamespace() { return NominatedNamespace; } + + const NamespaceDecl *getNominatedNamespace() const { + return const_cast(this)->getNominatedNamespace(); + } + + /// getCommonAncestor - returns common ancestor context of using-directive, + /// and nominated by it namespace. + DeclContext *getCommonAncestor() { return CommonAncestor; } + const DeclContext *getCommonAncestor() const { return CommonAncestor; } + + /// getNamespaceKeyLocation - Returns location of namespace keyword. + SourceLocation getNamespaceKeyLocation() const { return NamespaceLoc; } + + /// getIdentLocation - Returns location of identifier. + SourceLocation getIdentLocation() const { return IdentLoc; } + + static UsingDirectiveDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, + SourceLocation NamespaceLoc, + SourceRange QualifierRange, + NestedNameSpecifier *Qualifier, + SourceLocation IdentLoc, + NamespaceDecl *Nominated, + DeclContext *CommonAncestor); + + static bool classof(const Decl *D) { + return D->getKind() == Decl::UsingDirective; + } + static bool classof(const UsingDirectiveDecl *D) { return true; } + + // Friend for getUsingDirectiveName. + friend class DeclContext; +}; + +/// NamespaceAliasDecl - Represents a C++ namespace alias. For example: +/// +/// @code +/// namespace Foo = Bar; +/// @endcode +class NamespaceAliasDecl : public NamedDecl { + SourceLocation AliasLoc; + + /// \brief The source range that covers the nested-name-specifier + /// preceding the namespace name. + SourceRange QualifierRange; + + /// \brief The nested-name-specifier that precedes the namespace + /// name, if any. + NestedNameSpecifier *Qualifier; + + /// IdentLoc - Location of namespace identifier. + SourceLocation IdentLoc; + + /// Namespace - The Decl that this alias points to. Can either be a + /// NamespaceDecl or a NamespaceAliasDecl. + NamedDecl *Namespace; + + NamespaceAliasDecl(DeclContext *DC, SourceLocation L, + SourceLocation AliasLoc, IdentifierInfo *Alias, + SourceRange QualifierRange, + NestedNameSpecifier *Qualifier, + SourceLocation IdentLoc, NamedDecl *Namespace) + : NamedDecl(Decl::NamespaceAlias, DC, L, Alias), AliasLoc(AliasLoc), + QualifierRange(QualifierRange), Qualifier(Qualifier), + IdentLoc(IdentLoc), Namespace(Namespace) { } + +public: + /// \brief Retrieve the source range of the nested-name-specifier + /// that qualifiers the namespace name. + SourceRange getQualifierRange() const { return QualifierRange; } + + /// \brief Retrieve the nested-name-specifier that qualifies the + /// name of the namespace. + NestedNameSpecifier *getQualifier() const { return Qualifier; } + + NamespaceDecl *getNamespace() { + if (NamespaceAliasDecl *AD = dyn_cast(Namespace)) + return AD->getNamespace(); + + return cast(Namespace); + } + + const NamespaceDecl *getNamespace() const { + return const_cast(this)->getNamespace(); + } + + /// \brief Retrieve the namespace that this alias refers to, which + /// may either be a NamespaceDecl or a NamespaceAliasDecl. + NamedDecl *getAliasedNamespace() const { return Namespace; } + + static NamespaceAliasDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, SourceLocation AliasLoc, + IdentifierInfo *Alias, + SourceRange QualifierRange, + NestedNameSpecifier *Qualifier, + SourceLocation IdentLoc, + NamedDecl *Namespace); + + static bool classof(const Decl *D) { + return D->getKind() == Decl::NamespaceAlias; + } + static bool classof(const NamespaceAliasDecl *D) { return true; } +}; + +/// StaticAssertDecl - Represents a C++0x static_assert declaration. +class StaticAssertDecl : public Decl { + Expr *AssertExpr; + StringLiteral *Message; + + StaticAssertDecl(DeclContext *DC, SourceLocation L, + Expr *assertexpr, StringLiteral *message) + : Decl(StaticAssert, DC, L), AssertExpr(assertexpr), Message(message) { } + +public: + static StaticAssertDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, Expr *AssertExpr, + StringLiteral *Message); + + Expr *getAssertExpr() { return AssertExpr; } + const Expr *getAssertExpr() const { return AssertExpr; } + + StringLiteral *getMessage() { return Message; } + const StringLiteral *getMessage() const { return Message; } + + virtual ~StaticAssertDecl(); + virtual void Destroy(ASTContext& C); + + static bool classof(const Decl *D) { + return D->getKind() == Decl::StaticAssert; + } + static bool classof(StaticAssertDecl *D) { return true; } +}; + +/// Insertion operator for diagnostics. This allows sending AccessSpecifier's +/// into a diagnostic with <<. +const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, + AccessSpecifier AS); + +} // end namespace clang + +#endif diff --git a/include/clang/AST/DeclContextInternals.h b/include/clang/AST/DeclContextInternals.h new file mode 100644 index 0000000..6c1231c --- /dev/null +++ b/include/clang/AST/DeclContextInternals.h @@ -0,0 +1,220 @@ +//===-- DeclContextInternals.h - DeclContext 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 data structures used in the implementation +// of DeclContext. +// +//===----------------------------------------------------------------------===// +#ifndef LLVM_CLANG_AST_DECLCONTEXTINTERNALS_H +#define LLVM_CLANG_AST_DECLCONTEXTINTERNALS_H + +#include "clang/AST/DeclBase.h" +#include "clang/AST/DeclarationName.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/PointerUnion.h" +#include "llvm/ADT/SmallVector.h" +#include + +namespace clang { + +/// StoredDeclsList - This is an array of decls optimized a common case of only +/// containing one entry. +struct StoredDeclsList { + /// The kind of data encoded in this list. + enum DataKind { + /// \brief The data is a NamedDecl*. + DK_Decl = 0, + /// \brief The data is a declaration ID (an unsigned value), + /// shifted left by 2 bits. + DK_DeclID = 1, + /// \brief The data is a pointer to a vector (of type VectorTy) + /// that contains declarations. + DK_Decl_Vector = 2, + /// \brief The data is a pointer to a vector (of type VectorTy) + /// that contains declaration ID. + DK_ID_Vector = 3 + }; + + /// VectorTy - When in vector form, this is what the Data pointer points to. + typedef llvm::SmallVector VectorTy; + + /// \brief The stored data, which will be either a declaration ID, a + /// pointer to a NamedDecl, or a pointer to a vector. + uintptr_t Data; + +public: + StoredDeclsList() : Data(0) {} + + StoredDeclsList(const StoredDeclsList &RHS) : Data(RHS.Data) { + if (VectorTy *RHSVec = RHS.getAsVector()) { + VectorTy *New = new VectorTy(*RHSVec); + Data = reinterpret_cast(New) | (Data & 0x03); + } + } + + ~StoredDeclsList() { + // If this is a vector-form, free the vector. + if (VectorTy *Vector = getAsVector()) + delete Vector; + } + + StoredDeclsList &operator=(const StoredDeclsList &RHS) { + if (VectorTy *Vector = getAsVector()) + delete Vector; + Data = RHS.Data; + if (VectorTy *RHSVec = RHS.getAsVector()) { + VectorTy *New = new VectorTy(*RHSVec); + Data = reinterpret_cast(New) | (Data & 0x03); + } + return *this; + } + + bool isNull() const { return (Data & ~0x03) == 0; } + + NamedDecl *getAsDecl() const { + if ((Data & 0x03) != DK_Decl) + return 0; + + return reinterpret_cast(Data & ~0x03); + } + + VectorTy *getAsVector() const { + if ((Data & 0x03) != DK_ID_Vector && (Data & 0x03) != DK_Decl_Vector) + return 0; + + return reinterpret_cast(Data & ~0x03); + } + + void setOnlyValue(NamedDecl *ND) { + assert(!getAsVector() && "Not inline"); + Data = reinterpret_cast(ND); + } + + void setFromDeclIDs(const llvm::SmallVectorImpl &Vec) { + if (Vec.size() > 1) { + VectorTy *Vector = getAsVector(); + if (!Vector) { + Vector = new VectorTy; + Data = reinterpret_cast(Vector) | DK_ID_Vector; + } + + Vector->resize(Vec.size()); + std::copy(Vec.begin(), Vec.end(), Vector->begin()); + return; + } + + if (VectorTy *Vector = getAsVector()) + delete Vector; + + if (Vec.empty()) + Data = 0; + else + Data = (Vec[0] << 2) | DK_DeclID; + } + + /// \brief Force the stored declarations list to contain actual + /// declarations. + /// + /// This routine will resolve any declaration IDs for declarations + /// that may not yet have been loaded from external storage. + void materializeDecls(ASTContext &Context); + + bool hasDeclarationIDs() const { + DataKind DK = (DataKind)(Data & 0x03); + return DK == DK_DeclID || DK == DK_ID_Vector; + } + + /// getLookupResult - Return an array of all the decls that this list + /// represents. + DeclContext::lookup_result getLookupResult(ASTContext &Context) { + if (isNull()) + return DeclContext::lookup_result(0, 0); + + if (hasDeclarationIDs()) + materializeDecls(Context); + + // If we have a single NamedDecl, return it. + if (getAsDecl()) { + assert(!isNull() && "Empty list isn't allowed"); + + // Data is a raw pointer to a NamedDecl*, return it. + void *Ptr = &Data; + return DeclContext::lookup_result((NamedDecl**)Ptr, (NamedDecl**)Ptr+1); + } + + assert(getAsVector() && "Must have a vector at this point"); + VectorTy &Vector = *getAsVector(); + + // Otherwise, we have a range result. + return DeclContext::lookup_result((NamedDecl **)&Vector[0], + (NamedDecl **)&Vector[0]+Vector.size()); + } + + /// HandleRedeclaration - If this is a redeclaration of an existing decl, + /// replace the old one with D and return true. Otherwise return false. + bool HandleRedeclaration(ASTContext &Context, NamedDecl *D) { + if (hasDeclarationIDs()) + materializeDecls(Context); + + // Most decls only have one entry in their list, special case it. + if (NamedDecl *OldD = getAsDecl()) { + if (!D->declarationReplaces(OldD)) + return false; + setOnlyValue(D); + return true; + } + + // Determine if this declaration is actually a redeclaration. + VectorTy &Vec = *getAsVector(); + for (VectorTy::iterator OD = Vec.begin(), ODEnd = Vec.end(); + OD != ODEnd; ++OD) { + NamedDecl *OldD = reinterpret_cast(*OD); + if (D->declarationReplaces(OldD)) { + *OD = reinterpret_cast(D); + return true; + } + } + + return false; + } + + /// AddSubsequentDecl - This is called on the second and later decl when it is + /// not a redeclaration to merge it into the appropriate place in our list. + /// + void AddSubsequentDecl(NamedDecl *D) { + assert(!hasDeclarationIDs() && "Must materialize before adding decls"); + + // If this is the second decl added to the list, convert this to vector + // form. + if (NamedDecl *OldD = getAsDecl()) { + VectorTy *VT = new VectorTy(); + VT->push_back(reinterpret_cast(OldD)); + Data = reinterpret_cast(VT) | DK_Decl_Vector; + } + + VectorTy &Vec = *getAsVector(); + if (isa(D) || + D->getIdentifierNamespace() == Decl::IDNS_Tag) + Vec.push_back(reinterpret_cast(D)); + else if (reinterpret_cast(Vec.back()) + ->getIdentifierNamespace() == Decl::IDNS_Tag) { + uintptr_t TagD = Vec.back(); + Vec.back() = reinterpret_cast(D); + Vec.push_back(TagD); + } else + Vec.push_back(reinterpret_cast(D)); + } +}; + +typedef llvm::DenseMap StoredDeclsMap; + + +} // end namespace clang + +#endif diff --git a/include/clang/AST/DeclGroup.h b/include/clang/AST/DeclGroup.h new file mode 100644 index 0000000..15a8ade --- /dev/null +++ b/include/clang/AST/DeclGroup.h @@ -0,0 +1,152 @@ +//===--- DeclGroup.h - Classes for representing groups of Decls -*- 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 DeclGroup, DeclGroupRef, and OwningDeclGroup classes. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_DECLGROUP_H +#define LLVM_CLANG_AST_DECLGROUP_H + +#include "llvm/Support/DataTypes.h" +#include + +namespace clang { + +class ASTContext; +class Decl; +class DeclGroup; +class DeclGroupIterator; + +class DeclGroup { + // FIXME: Include a TypeSpecifier object. + unsigned NumDecls; + +private: + DeclGroup() : NumDecls(0) {} + DeclGroup(unsigned numdecls, Decl** decls); + +public: + static DeclGroup *Create(ASTContext &C, Decl **Decls, unsigned NumDecls); + void Destroy(ASTContext& C); + + unsigned size() const { return NumDecls; } + + Decl*& operator[](unsigned i) { + assert (i < NumDecls && "Out-of-bounds access."); + return *((Decl**) (this+1)); + } + + Decl* const& operator[](unsigned i) const { + assert (i < NumDecls && "Out-of-bounds access."); + return *((Decl* const*) (this+1)); + } +}; + +class DeclGroupRef { + // Note this is not a PointerIntPair because we need the address of the + // non-group case to be valid as a Decl** for iteration. + enum Kind { SingleDeclKind=0x0, DeclGroupKind=0x1, Mask=0x1 }; + Decl* D; + + Kind getKind() const { + return (Kind) (reinterpret_cast(D) & Mask); + } + +public: + DeclGroupRef() : D(0) {} + + explicit DeclGroupRef(Decl* d) : D(d) {} + explicit DeclGroupRef(DeclGroup* dg) + : D((Decl*) (reinterpret_cast(dg) | DeclGroupKind)) {} + + static DeclGroupRef Create(ASTContext &C, Decl **Decls, unsigned NumDecls) { + if (NumDecls == 0) + return DeclGroupRef(); + if (NumDecls == 1) + return DeclGroupRef(Decls[0]); + return DeclGroupRef(DeclGroup::Create(C, Decls, NumDecls)); + } + + typedef Decl** iterator; + typedef Decl* const * const_iterator; + + bool isNull() const { return D == 0; } + bool isSingleDecl() const { return getKind() == SingleDeclKind; } + bool isDeclGroup() const { return getKind() == DeclGroupKind; } + + Decl *getSingleDecl() { + assert(isSingleDecl() && "Isn't a declgroup"); + return D; + } + const Decl *getSingleDecl() const { + return const_cast(this)->getSingleDecl(); + } + + DeclGroup &getDeclGroup() { + assert(isDeclGroup() && "Isn't a declgroup"); + return *((DeclGroup*)(reinterpret_cast(D) & ~Mask)); + } + const DeclGroup &getDeclGroup() const { + return const_cast(this)->getDeclGroup(); + } + + iterator begin() { + if (isSingleDecl()) + return D ? &D : 0; + return &getDeclGroup()[0]; + } + + iterator end() { + if (isSingleDecl()) + return D ? &D+1 : 0; + DeclGroup &G = getDeclGroup(); + return &G[0] + G.size(); + } + + const_iterator begin() const { + if (isSingleDecl()) + return D ? &D : 0; + return &getDeclGroup()[0]; + } + + const_iterator end() const { + if (isSingleDecl()) + return D ? &D+1 : 0; + const DeclGroup &G = getDeclGroup(); + return &G[0] + G.size(); + } + + void *getAsOpaquePtr() const { return D; } + static DeclGroupRef getFromOpaquePtr(void *Ptr) { + DeclGroupRef X; + X.D = static_cast(Ptr); + return X; + } +}; + +} // end clang namespace + +namespace llvm { + // DeclGroupRef is "like a pointer", implement PointerLikeTypeTraits. + template + class PointerLikeTypeTraits; + template <> + class PointerLikeTypeTraits { + public: + static inline void *getAsVoidPointer(clang::DeclGroupRef P) { + return P.getAsOpaquePtr(); + } + static inline clang::DeclGroupRef getFromVoidPointer(void *P) { + return clang::DeclGroupRef::getFromOpaquePtr(P); + } + enum { NumLowBitsAvailable = 0 }; + }; +} +#endif diff --git a/include/clang/AST/DeclNodes.def b/include/clang/AST/DeclNodes.def new file mode 100644 index 0000000..d1b921a --- /dev/null +++ b/include/clang/AST/DeclNodes.def @@ -0,0 +1,161 @@ +//===-- DeclNodes.def - Metadata about Decl AST nodes -----------*- 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 declaration nodes within the AST. The +// description of the declaration nodes uses six macros: +// +// DECL(Derived, Base) describes a normal declaration type Derived +// and specifies its base class. Note that Derived should not have +// the Decl suffix on it, while Base should. +// +// LAST_DECL(Derived, Base) is like DECL, but is used for the last +// declaration in the list. +// +// ABSTRACT_DECL(Derived, Base) describes an abstract class that is +// used to specify a classification of declarations. For example, +// TagDecl is an abstract class used to describe the various kinds of +// "tag" declarations (unions, structs, classes, enums). +// +// DECL_CONTEXT(Decl) specifies that Decl is a kind of declaration +// that is also a DeclContext. +// +// LAST_DECL_CONTEXT(Decl) is like DECL_CONTEXT, but is used for the +// last declaration context. +// +// DECL_RANGE(CommonBase, Start, End) specifies a range of +// declaration values that have a common (potentially indirect) base +// class. +// +// LAST_DECL_RANGE(CommonBase, Start, End) is like DECL_RANGE, but is +// used for the last declaration range. +// +// Note that, due to the use of ranges, the order of the these +// declarations is significant. A declaration should be listed under +// its base class. +// ===----------------------------------------------------------------------===// + +#ifndef DECL +# define DECL(Derived, Base) +#endif + +#ifndef LAST_DECL +# define LAST_DECL(Derived, Base) DECL(Derived, Base) +#endif + +#ifndef ABSTRACT_DECL +# define ABSTRACT_DECL(Derived, Base) +#endif + +#ifndef DECL_CONTEXT +# define DECL_CONTEXT(Decl) +#endif + +#ifndef DECL_CONTEXT_BASE +# define DECL_CONTEXT_BASE(Decl) DECL_CONTEXT(Decl) +#endif + +#ifndef LAST_DECL_CONTEXT +# define LAST_DECL_CONTEXT(Decl) DECL_CONTEXT(Decl) +#endif + +#ifndef DECL_RANGE +# define DECL_RANGE(CommonBase, Start, End) +#endif + +#ifndef LAST_DECL_RANGE +# define LAST_DECL_RANGE(CommonBase, Start, End) \ + DECL_RANGE(CommonBase, Start, End) +#endif + +DECL(TranslationUnit, Decl) +ABSTRACT_DECL(Named, Decl) + DECL(OverloadedFunction, NamedDecl) + DECL(Namespace, NamedDecl) + DECL(UsingDirective, NamedDecl) + DECL(NamespaceAlias, NamedDecl) + ABSTRACT_DECL(Type, NamedDecl) + DECL(Typedef, TypeDecl) + ABSTRACT_DECL(Tag, TypeDecl) + DECL(Enum, TagDecl) + DECL(Record, TagDecl) + DECL(CXXRecord, RecordDecl) + DECL(ClassTemplateSpecialization, CXXRecordDecl) + DECL(ClassTemplatePartialSpecialization, + ClassTemplateSpecializationDecl) + DECL(TemplateTypeParm, TypeDecl) + ABSTRACT_DECL(Value, NamedDecl) + DECL(EnumConstant, ValueDecl) + DECL(Function, ValueDecl) + DECL(CXXMethod, FunctionDecl) + DECL(CXXConstructor, CXXMethodDecl) + DECL(CXXDestructor, CXXMethodDecl) + DECL(CXXConversion, CXXMethodDecl) + DECL(Field, ValueDecl) + DECL(ObjCIvar, FieldDecl) + DECL(ObjCAtDefsField, FieldDecl) + DECL(Var, ValueDecl) + DECL(ImplicitParam, VarDecl) + DECL(ParmVar, VarDecl) + DECL(OriginalParmVar, ParmVarDecl) + DECL(NonTypeTemplateParm, VarDecl) + DECL(Template, NamedDecl) + DECL(FunctionTemplate, TemplateDecl) + DECL(ClassTemplate, TemplateDecl) + DECL(TemplateTemplateParm, TemplateDecl) + DECL(ObjCMethod, NamedDecl) + DECL(ObjCContainer, NamedDecl) + DECL(ObjCCategory, ObjCContainerDecl) + DECL(ObjCProtocol, ObjCContainerDecl) + DECL(ObjCInterface, ObjCContainerDecl) + DECL(ObjCProperty, NamedDecl) + DECL(ObjCCompatibleAlias, NamedDecl) + ABSTRACT_DECL(ObjCImpl, NamedDecl) + DECL(ObjCCategoryImpl, ObjCImplDecl) + DECL(ObjCImplementation, ObjCImplDecl) +DECL(LinkageSpec, Decl) +DECL(ObjCPropertyImpl, Decl) +DECL(ObjCForwardProtocol, Decl) +DECL(ObjCClass, Decl) +DECL(FileScopeAsm, Decl) +DECL(StaticAssert, Decl) +LAST_DECL(Block, Decl) + +// Declaration contexts. DECL_CONTEXT_BASE indicates that it has subclasses. +DECL_CONTEXT(TranslationUnit) +DECL_CONTEXT(Namespace) +DECL_CONTEXT(LinkageSpec) +DECL_CONTEXT(ObjCMethod) +DECL_CONTEXT(ObjCCategoryImpl) +DECL_CONTEXT(ObjCImplementation) +DECL_CONTEXT_BASE(Tag) +DECL_CONTEXT_BASE(Function) +DECL_CONTEXT_BASE(ObjCContainer) +LAST_DECL_CONTEXT(Block) + +// Declaration ranges +DECL_RANGE(Named, OverloadedFunction, ObjCImplementation) +DECL_RANGE(ObjCContainer, ObjCContainer, ObjCInterface) +DECL_RANGE(Field, Field, ObjCAtDefsField) +DECL_RANGE(Type, Typedef, TemplateTypeParm) +DECL_RANGE(Tag, Enum, ClassTemplatePartialSpecialization) +DECL_RANGE(Record, Record, ClassTemplatePartialSpecialization) +DECL_RANGE(Value, EnumConstant, NonTypeTemplateParm) +DECL_RANGE(Function, Function, CXXConversion) +DECL_RANGE(Template, Template, TemplateTemplateParm) +DECL_RANGE(ObjCImpl, ObjCCategoryImpl, ObjCImplementation) +LAST_DECL_RANGE(Var, Var, NonTypeTemplateParm) + +#undef LAST_DECL_RANGE +#undef DECL_RANGE +#undef LAST_DECL_CONTEXT +#undef DECL_CONTEXT_BASE +#undef DECL_CONTEXT +#undef ABSTRACT_DECL +#undef LAST_DECL +#undef DECL diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h new file mode 100644 index 0000000..6e89a7a --- /dev/null +++ b/include/clang/AST/DeclObjC.h @@ -0,0 +1,1224 @@ +//===--- DeclObjC.h - Classes for representing declarations -----*- 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 DeclObjC interface and subclasses. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_DECLOBJC_H +#define LLVM_CLANG_AST_DECLOBJC_H + +#include "clang/AST/Decl.h" +#include "llvm/ADT/STLExtras.h" + +namespace clang { +class Expr; +class Stmt; +class FunctionDecl; +class AttributeList; +class RecordDecl; +class ObjCIvarDecl; +class ObjCMethodDecl; +class ObjCProtocolDecl; +class ObjCCategoryDecl; +class ObjCPropertyDecl; +class ObjCPropertyImplDecl; + +class ObjCListBase { + void operator=(const ObjCListBase &); // DO NOT IMPLEMENT + ObjCListBase(const ObjCListBase&); // DO NOT IMPLEMENT +protected: + /// List is an array of pointers to objects that are not owned by this object. + void **List; + unsigned NumElts; + +public: + ObjCListBase() : List(0), NumElts(0) {} + ~ObjCListBase() { + assert(List == 0 && "Destroy should have been called before dtor"); + } + + void Destroy(ASTContext &Ctx); + + unsigned size() const { return NumElts; } + bool empty() const { return NumElts == 0; } + +protected: + void set(void *const* InList, unsigned Elts, ASTContext &Ctx); +}; + + +/// ObjCList - This is a simple template class used to hold various lists of +/// decls etc, which is heavily used by the ObjC front-end. This only use case +/// this supports is setting the list all at once and then reading elements out +/// of it. +template +class ObjCList : public ObjCListBase { +public: + void set(T* const* InList, unsigned Elts, ASTContext &Ctx) { + ObjCListBase::set(reinterpret_cast(InList), Elts, Ctx); + } + + typedef T* const * iterator; + iterator begin() const { return (iterator)List; } + iterator end() const { return (iterator)List+NumElts; } + + T* operator[](unsigned Idx) const { + assert(Idx < NumElts && "Invalid access"); + return (T*)List[Idx]; + } +}; + + + +/// ObjCMethodDecl - Represents an instance or class method declaration. +/// ObjC methods can be declared within 4 contexts: class interfaces, +/// categories, protocols, and class implementations. While C++ member +/// functions leverage C syntax, Objective-C method syntax is modeled after +/// Smalltalk (using colons to specify argument types/expressions). +/// Here are some brief examples: +/// +/// Setter/getter instance methods: +/// - (void)setMenu:(NSMenu *)menu; +/// - (NSMenu *)menu; +/// +/// Instance method that takes 2 NSView arguments: +/// - (void)replaceSubview:(NSView *)oldView with:(NSView *)newView; +/// +/// Getter class method: +/// + (NSMenu *)defaultMenu; +/// +/// A selector represents a unique name for a method. The selector names for +/// the above methods are setMenu:, menu, replaceSubview:with:, and defaultMenu. +/// +class ObjCMethodDecl : public NamedDecl, public DeclContext { +public: + enum ImplementationControl { None, Required, Optional }; +private: + /// Bitfields must be first fields in this class so they pack with those + /// declared in class Decl. + /// instance (true) or class (false) method. + bool IsInstance : 1; + bool IsVariadic : 1; + + // Synthesized declaration method for a property setter/getter + bool IsSynthesized : 1; + + // NOTE: VC++ treats enums as signed, avoid using ImplementationControl enum + /// @required/@optional + unsigned DeclImplementation : 2; + + // NOTE: VC++ treats enums as signed, avoid using the ObjCDeclQualifier enum + /// in, inout, etc. + unsigned objcDeclQualifier : 6; + + // Type of this method. + QualType MethodDeclType; + /// ParamInfo - List of pointers to VarDecls for the formal parameters of this + /// Method. + ObjCList ParamInfo; + + /// List of attributes for this method declaration. + SourceLocation EndLoc; // the location of the ';' or '{'. + + // The following are only used for method definitions, null otherwise. + // FIXME: space savings opportunity, consider a sub-class. + Stmt *Body; + + /// SelfDecl - Decl for the implicit self parameter. This is lazily + /// constructed by createImplicitParams. + ImplicitParamDecl *SelfDecl; + /// CmdDecl - Decl for the implicit _cmd parameter. This is lazily + /// constructed by createImplicitParams. + ImplicitParamDecl *CmdDecl; + + ObjCMethodDecl(SourceLocation beginLoc, SourceLocation endLoc, + Selector SelInfo, QualType T, + DeclContext *contextDecl, + bool isInstance = true, + bool isVariadic = false, + bool isSynthesized = false, + ImplementationControl impControl = None) + : NamedDecl(ObjCMethod, contextDecl, beginLoc, SelInfo), + DeclContext(ObjCMethod), + IsInstance(isInstance), IsVariadic(isVariadic), + IsSynthesized(isSynthesized), + DeclImplementation(impControl), objcDeclQualifier(OBJC_TQ_None), + MethodDeclType(T), + EndLoc(endLoc), Body(0), SelfDecl(0), CmdDecl(0) {} + + virtual ~ObjCMethodDecl() {} + +public: + + /// Destroy - Call destructors and release memory. + virtual void Destroy(ASTContext& C); + + static ObjCMethodDecl *Create(ASTContext &C, + SourceLocation beginLoc, + SourceLocation endLoc, Selector SelInfo, + QualType T, DeclContext *contextDecl, + bool isInstance = true, + bool isVariadic = false, + bool isSynthesized = false, + ImplementationControl impControl = None); + + ObjCDeclQualifier getObjCDeclQualifier() const { + return ObjCDeclQualifier(objcDeclQualifier); + } + void setObjCDeclQualifier(ObjCDeclQualifier QV) { objcDeclQualifier = QV; } + + // Location information, modeled after the Stmt API. + SourceLocation getLocStart() const { return getLocation(); } + SourceLocation getLocEnd() const { return EndLoc; } + void setEndLoc(SourceLocation Loc) { EndLoc = Loc; } + SourceRange getSourceRange() const { + return SourceRange(getLocation(), EndLoc); + } + + ObjCInterfaceDecl *getClassInterface(); + const ObjCInterfaceDecl *getClassInterface() const { + return const_cast(this)->getClassInterface(); + } + + Selector getSelector() const { return getDeclName().getObjCSelector(); } + unsigned getSynthesizedMethodSize() const; + QualType getResultType() const { return MethodDeclType; } + void setResultType(QualType T) { MethodDeclType = T; } + + // Iterator access to formal parameters. + unsigned param_size() const { return ParamInfo.size(); } + typedef ObjCList::iterator param_iterator; + param_iterator param_begin() const { return ParamInfo.begin(); } + param_iterator param_end() const { return ParamInfo.end(); } + + void setMethodParams(ASTContext &C, ParmVarDecl *const *List, unsigned Num) { + ParamInfo.set(List, Num, C); + } + + // Iterator access to parameter types. + typedef std::const_mem_fun_t deref_fun; + typedef llvm::mapped_iterator arg_type_iterator; + + arg_type_iterator arg_type_begin() const { + return llvm::map_iterator(param_begin(), deref_fun(&ParmVarDecl::getType)); + } + arg_type_iterator arg_type_end() const { + return llvm::map_iterator(param_end(), deref_fun(&ParmVarDecl::getType)); + } + + /// createImplicitParams - Used to lazily create the self and cmd + /// implict parameters. This must be called prior to using getSelfDecl() + /// or getCmdDecl(). The call is ignored if the implicit paramters + /// have already been created. + void createImplicitParams(ASTContext &Context, const ObjCInterfaceDecl *ID); + + ImplicitParamDecl * getSelfDecl() const { return SelfDecl; } + void setSelfDecl(ImplicitParamDecl *SD) { SelfDecl = SD; } + ImplicitParamDecl * getCmdDecl() const { return CmdDecl; } + void setCmdDecl(ImplicitParamDecl *CD) { CmdDecl = CD; } + + bool isInstanceMethod() const { return IsInstance; } + void setInstanceMethod(bool isInst) { IsInstance = isInst; } + bool isVariadic() const { return IsVariadic; } + void setVariadic(bool isVar) { IsVariadic = isVar; } + + bool isClassMethod() const { return !IsInstance; } + + bool isSynthesized() const { return IsSynthesized; } + void setSynthesized(bool isSynth) { IsSynthesized = isSynth; } + + // Related to protocols declared in @protocol + void setDeclImplementation(ImplementationControl ic) { + DeclImplementation = ic; + } + ImplementationControl getImplementationControl() const { + return ImplementationControl(DeclImplementation); + } + + virtual Stmt *getBody(ASTContext &C) const { + return (Stmt*) Body; + } + CompoundStmt *getBody() { return (CompoundStmt*)Body; } + void setBody(Stmt *B) { Body = B; } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { return D->getKind() == ObjCMethod; } + static bool classof(const ObjCMethodDecl *D) { return true; } + static DeclContext *castToDeclContext(const ObjCMethodDecl *D) { + return static_cast(const_cast(D)); + } + static ObjCMethodDecl *castFromDeclContext(const DeclContext *DC) { + return static_cast(const_cast(DC)); + } +}; + +/// ObjCMethodList - a linked list of methods with different signatures. +struct ObjCMethodList { + ObjCMethodDecl *Method; + ObjCMethodList *Next; + + ObjCMethodList() { + Method = 0; + Next = 0; + } + ObjCMethodList(ObjCMethodDecl *M, ObjCMethodList *C) { + Method = M; + Next = C; + } +}; + +/// ObjCContainerDecl - Represents a container for method declarations. +/// Current sub-classes are ObjCInterfaceDecl, ObjCCategoryDecl, and +/// ObjCProtocolDecl. +/// FIXME: Use for ObjC implementation decls. +/// +class ObjCContainerDecl : public NamedDecl, public DeclContext { + SourceLocation AtEndLoc; // marks the end of the method container. +public: + + ObjCContainerDecl(Kind DK, DeclContext *DC, SourceLocation L, + IdentifierInfo *Id) + : NamedDecl(DK, DC, L, Id), DeclContext(DK) {} + + virtual ~ObjCContainerDecl() {} + + // Iterator access to properties. + typedef specific_decl_iterator prop_iterator; + prop_iterator prop_begin(ASTContext &Context) const { + return prop_iterator(decls_begin(Context)); + } + prop_iterator prop_end(ASTContext &Context) const { + return prop_iterator(decls_end(Context)); + } + + // Iterator access to instance/class methods. + typedef specific_decl_iterator method_iterator; + method_iterator meth_begin(ASTContext &Context) const { + return method_iterator(decls_begin(Context)); + } + method_iterator meth_end(ASTContext &Context) const { + return method_iterator(decls_end(Context)); + } + + typedef filtered_decl_iterator + instmeth_iterator; + instmeth_iterator instmeth_begin(ASTContext &Context) const { + return instmeth_iterator(decls_begin(Context)); + } + instmeth_iterator instmeth_end(ASTContext &Context) const { + return instmeth_iterator(decls_end(Context)); + } + + typedef filtered_decl_iterator + classmeth_iterator; + classmeth_iterator classmeth_begin(ASTContext &Context) const { + return classmeth_iterator(decls_begin(Context)); + } + classmeth_iterator classmeth_end(ASTContext &Context) const { + return classmeth_iterator(decls_end(Context)); + } + + // Get the local instance/class method declared in this interface. + ObjCMethodDecl *getInstanceMethod(ASTContext &Context, Selector Sel) const; + ObjCMethodDecl *getClassMethod(ASTContext &Context, Selector Sel) const; + + ObjCMethodDecl * + getMethod(ASTContext &Context, Selector Sel, bool isInstance) const { + return isInstance ? getInstanceMethod(Context, Sel) + : getClassMethod(Context, Sel); + } + + ObjCPropertyDecl *FindPropertyDeclaration(ASTContext &Context, + IdentifierInfo *PropertyId) const; + + // Marks the end of the container. + SourceLocation getAtEndLoc() const { return AtEndLoc; } + void setAtEndLoc(SourceLocation L) { AtEndLoc = L; } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { + return D->getKind() >= ObjCContainerFirst && + D->getKind() <= ObjCContainerLast; + } + static bool classof(const ObjCContainerDecl *D) { return true; } + + static DeclContext *castToDeclContext(const ObjCContainerDecl *D) { + return static_cast(const_cast(D)); + } + static ObjCContainerDecl *castFromDeclContext(const DeclContext *DC) { + return static_cast(const_cast(DC)); + } +}; + +/// ObjCInterfaceDecl - Represents an ObjC class declaration. For example: +/// +/// // MostPrimitive declares no super class (not particularly useful). +/// @interface MostPrimitive +/// // no instance variables or methods. +/// @end +/// +/// // NSResponder inherits from NSObject & implements NSCoding (a protocol). +/// @interface NSResponder : NSObject +/// { // instance variables are represented by ObjCIvarDecl. +/// id nextResponder; // nextResponder instance variable. +/// } +/// - (NSResponder *)nextResponder; // return a pointer to NSResponder. +/// - (void)mouseMoved:(NSEvent *)theEvent; // return void, takes a pointer +/// @end // to an NSEvent. +/// +/// Unlike C/C++, forward class declarations are accomplished with @class. +/// Unlike C/C++, @class allows for a list of classes to be forward declared. +/// Unlike C++, ObjC is a single-rooted class model. In Cocoa, classes +/// typically inherit from NSObject (an exception is NSProxy). +/// +class ObjCInterfaceDecl : public ObjCContainerDecl { + /// TypeForDecl - This indicates the Type object that represents this + /// TypeDecl. It is a cache maintained by ASTContext::getObjCInterfaceType + mutable Type *TypeForDecl; + friend class ASTContext; + + /// Class's super class. + ObjCInterfaceDecl *SuperClass; + + /// Protocols referenced in interface header declaration + ObjCList ReferencedProtocols; + + /// Instance variables in the interface. + ObjCList IVars; + + /// List of categories defined for this class. + /// FIXME: Why is this a linked list?? + ObjCCategoryDecl *CategoryList; + + bool ForwardDecl:1; // declared with @class. + bool InternalInterface:1; // true - no @interface for @implementation + + SourceLocation ClassLoc; // location of the class identifier. + SourceLocation SuperClassLoc; // location of the super class identifier. + SourceLocation EndLoc; // marks the '>', '}', or identifier. + + ObjCInterfaceDecl(DeclContext *DC, SourceLocation atLoc, IdentifierInfo *Id, + SourceLocation CLoc, bool FD, bool isInternal); + + virtual ~ObjCInterfaceDecl() {} + +public: + + /// Destroy - Call destructors and release memory. + virtual void Destroy(ASTContext& C); + + static ObjCInterfaceDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation atLoc, + IdentifierInfo *Id, + SourceLocation ClassLoc = SourceLocation(), + bool ForwardDecl = false, + bool isInternal = false); + const ObjCList &getReferencedProtocols() const { + return ReferencedProtocols; + } + + ObjCCategoryDecl *FindCategoryDeclaration(IdentifierInfo *CategoryId) const; + + typedef ObjCList::iterator protocol_iterator; + protocol_iterator protocol_begin() const {return ReferencedProtocols.begin();} + protocol_iterator protocol_end() const { return ReferencedProtocols.end(); } + unsigned protocol_size() const { return ReferencedProtocols.size(); } + + typedef ObjCList::iterator ivar_iterator; + ivar_iterator ivar_begin() const { return IVars.begin(); } + ivar_iterator ivar_end() const { return IVars.end(); } + unsigned ivar_size() const { return IVars.size(); } + bool ivar_empty() const { return IVars.empty(); } + + /// setProtocolList - Set the list of protocols that this interface + /// implements. + void setProtocolList(ObjCProtocolDecl *const* List, unsigned Num, + ASTContext &C) { + ReferencedProtocols.set(List, Num, C); + } + + void setIVarList(ObjCIvarDecl * const *List, unsigned Num, ASTContext &C) { + IVars.set(List, Num, C); + } + + bool isForwardDecl() const { return ForwardDecl; } + void setForwardDecl(bool val) { ForwardDecl = val; } + + ObjCInterfaceDecl *getSuperClass() const { return SuperClass; } + void setSuperClass(ObjCInterfaceDecl * superCls) { SuperClass = superCls; } + + ObjCCategoryDecl* getCategoryList() const { return CategoryList; } + void setCategoryList(ObjCCategoryDecl *category) { + CategoryList = category; + } + + /// isSuperClassOf - Return true if this class is the specified class or is a + /// super class of the specified interface class. + bool isSuperClassOf(const ObjCInterfaceDecl *I) const { + // If RHS is derived from LHS it is OK; else it is not OK. + while (I != NULL) { + if (this == I) + return true; + I = I->getSuperClass(); + } + return false; + } + + ObjCIvarDecl *lookupInstanceVariable(ASTContext &Context, + IdentifierInfo *IVarName, + ObjCInterfaceDecl *&ClassDeclared); + ObjCIvarDecl *lookupInstanceVariable(ASTContext &Context, + IdentifierInfo *IVarName) { + ObjCInterfaceDecl *ClassDeclared; + return lookupInstanceVariable(Context, IVarName, ClassDeclared); + } + + // Lookup a method. First, we search locally. If a method isn't + // found, we search referenced protocols and class categories. + ObjCMethodDecl *lookupInstanceMethod(ASTContext &Context, Selector Sel); + ObjCMethodDecl *lookupClassMethod(ASTContext &Context, Selector Sel); + ObjCInterfaceDecl *lookupInheritedClass(const IdentifierInfo *ICName); + + // Location information, modeled after the Stmt API. + SourceLocation getLocStart() const { return getLocation(); } // '@'interface + SourceLocation getLocEnd() const { return EndLoc; } + void setLocEnd(SourceLocation LE) { EndLoc = LE; }; + + void setClassLoc(SourceLocation Loc) { ClassLoc = Loc; } + SourceLocation getClassLoc() const { return ClassLoc; } + void setSuperClassLoc(SourceLocation Loc) { SuperClassLoc = Loc; } + SourceLocation getSuperClassLoc() const { return SuperClassLoc; } + + /// isImplicitInterfaceDecl - check that this is an implicitly declared + /// ObjCInterfaceDecl node. This is for legacy objective-c @implementation + /// declaration without an @interface declaration. + bool isImplicitInterfaceDecl() const { return InternalInterface; } + void setImplicitInterfaceDecl(bool val) { InternalInterface = val; } + + // Low-level accessor + Type *getTypeForDecl() const { return TypeForDecl; } + void setTypeForDecl(Type *TD) const { TypeForDecl = TD; } + + static bool classof(const Decl *D) { return D->getKind() == ObjCInterface; } + static bool classof(const ObjCInterfaceDecl *D) { return true; } +}; + +/// ObjCIvarDecl - Represents an ObjC instance variable. In general, ObjC +/// instance variables are identical to C. The only exception is Objective-C +/// supports C++ style access control. For example: +/// +/// @interface IvarExample : NSObject +/// { +/// id defaultToProtected; +/// @public: +/// id canBePublic; // same as C++. +/// @protected: +/// id canBeProtected; // same as C++. +/// @package: +/// id canBePackage; // framework visibility (not available in C++). +/// } +/// +class ObjCIvarDecl : public FieldDecl { +public: + enum AccessControl { + None, Private, Protected, Public, Package + }; + +private: + ObjCIvarDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id, + QualType T, AccessControl ac, Expr *BW) + : FieldDecl(ObjCIvar, DC, L, Id, T, BW, /*Mutable=*/false), + DeclAccess(ac) {} + +public: + static ObjCIvarDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L, + IdentifierInfo *Id, QualType T, + AccessControl ac, Expr *BW = NULL); + + void setAccessControl(AccessControl ac) { DeclAccess = ac; } + + AccessControl getAccessControl() const { return AccessControl(DeclAccess); } + + AccessControl getCanonicalAccessControl() const { + return DeclAccess == None ? Protected : AccessControl(DeclAccess); + } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { return D->getKind() == ObjCIvar; } + static bool classof(const ObjCIvarDecl *D) { return true; } +private: + // NOTE: VC++ treats enums as signed, avoid using the AccessControl enum + unsigned DeclAccess : 3; +}; + + +/// ObjCAtDefsFieldDecl - Represents a field declaration created by an +/// @defs(...). +class ObjCAtDefsFieldDecl : public FieldDecl { +private: + ObjCAtDefsFieldDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id, + QualType T, Expr *BW) + : FieldDecl(ObjCAtDefsField, DC, L, Id, T, BW, /*Mutable=*/false) {} + +public: + static ObjCAtDefsFieldDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, + IdentifierInfo *Id, QualType T, + Expr *BW); + + virtual void Destroy(ASTContext& C); + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { return D->getKind() == ObjCAtDefsField; } + static bool classof(const ObjCAtDefsFieldDecl *D) { return true; } +}; + +/// ObjCProtocolDecl - Represents a protocol declaration. ObjC protocols +/// declare a pure abstract type (i.e no instance variables are permitted). +/// Protocols orginally drew inspiration from C++ pure virtual functions (a C++ +/// feature with nice semantics and lousy syntax:-). Here is an example: +/// +/// @protocol NSDraggingInfo +/// - (NSWindow *)draggingDestinationWindow; +/// - (NSImage *)draggedImage; +/// @end +/// +/// This says that NSDraggingInfo requires two methods and requires everything +/// that the two "referenced protocols" 'refproto1' and 'refproto2' require as +/// well. +/// +/// @interface ImplementsNSDraggingInfo : NSObject +/// @end +/// +/// ObjC protocols inspired Java interfaces. Unlike Java, ObjC classes and +/// protocols are in distinct namespaces. For example, Cocoa defines both +/// an NSObject protocol and class (which isn't allowed in Java). As a result, +/// protocols are referenced using angle brackets as follows: +/// +/// id anyObjectThatImplementsNSDraggingInfo; +/// +class ObjCProtocolDecl : public ObjCContainerDecl { + /// Referenced protocols + ObjCList ReferencedProtocols; + + bool isForwardProtoDecl; // declared with @protocol. + + SourceLocation EndLoc; // marks the '>' or identifier. + + ObjCProtocolDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id) + : ObjCContainerDecl(ObjCProtocol, DC, L, Id), + isForwardProtoDecl(true) { + } + + virtual ~ObjCProtocolDecl() {} + +public: + static ObjCProtocolDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, IdentifierInfo *Id); + + /// Destroy - Call destructors and release memory. + virtual void Destroy(ASTContext& C); + + const ObjCList &getReferencedProtocols() const { + return ReferencedProtocols; + } + typedef ObjCList::iterator protocol_iterator; + protocol_iterator protocol_begin() const {return ReferencedProtocols.begin();} + protocol_iterator protocol_end() const { return ReferencedProtocols.end(); } + unsigned protocol_size() const { return ReferencedProtocols.size(); } + + /// setProtocolList - Set the list of protocols that this interface + /// implements. + void setProtocolList(ObjCProtocolDecl *const*List, unsigned Num, + ASTContext &C) { + ReferencedProtocols.set(List, Num, C); + } + + ObjCProtocolDecl *lookupProtocolNamed(IdentifierInfo *PName); + + // Lookup a method. First, we search locally. If a method isn't + // found, we search referenced protocols and class categories. + ObjCMethodDecl *lookupInstanceMethod(ASTContext &Context, Selector Sel); + ObjCMethodDecl *lookupClassMethod(ASTContext &Context, Selector Sel); + + bool isForwardDecl() const { return isForwardProtoDecl; } + void setForwardDecl(bool val) { isForwardProtoDecl = val; } + + // Location information, modeled after the Stmt API. + SourceLocation getLocStart() const { return getLocation(); } // '@'protocol + SourceLocation getLocEnd() const { return EndLoc; } + void setLocEnd(SourceLocation LE) { EndLoc = LE; }; + + static bool classof(const Decl *D) { return D->getKind() == ObjCProtocol; } + static bool classof(const ObjCProtocolDecl *D) { return true; } +}; + +/// ObjCClassDecl - Specifies a list of forward class declarations. For example: +/// +/// @class NSCursor, NSImage, NSPasteboard, NSWindow; +/// +class ObjCClassDecl : public Decl { + ObjCList ForwardDecls; + + ObjCClassDecl(DeclContext *DC, SourceLocation L, + ObjCInterfaceDecl *const *Elts, unsigned nElts, ASTContext &C); + virtual ~ObjCClassDecl() {} +public: + + /// Destroy - Call destructors and release memory. + virtual void Destroy(ASTContext& C); + + static ObjCClassDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L, + ObjCInterfaceDecl *const *Elts = 0, + unsigned nElts = 0); + + typedef ObjCList::iterator iterator; + iterator begin() const { return ForwardDecls.begin(); } + iterator end() const { return ForwardDecls.end(); } + unsigned size() const { return ForwardDecls.size(); } + + /// setClassList - Set the list of forward classes. + void setClassList(ASTContext &C, ObjCInterfaceDecl*const*List, unsigned Num) { + ForwardDecls.set(List, Num, C); + } + + static bool classof(const Decl *D) { return D->getKind() == ObjCClass; } + static bool classof(const ObjCClassDecl *D) { return true; } +}; + +/// ObjCForwardProtocolDecl - Specifies a list of forward protocol declarations. +/// For example: +/// +/// @protocol NSTextInput, NSChangeSpelling, NSDraggingInfo; +/// +class ObjCForwardProtocolDecl : public Decl { + ObjCList ReferencedProtocols; + + ObjCForwardProtocolDecl(DeclContext *DC, SourceLocation L, + ObjCProtocolDecl *const *Elts, unsigned nElts, + ASTContext &C); + virtual ~ObjCForwardProtocolDecl() {} + +public: + static ObjCForwardProtocolDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, + ObjCProtocolDecl *const *Elts = 0, + unsigned Num = 0); + + /// Destroy - Call destructors and release memory. + virtual void Destroy(ASTContext& C); + + typedef ObjCList::iterator protocol_iterator; + protocol_iterator protocol_begin() const {return ReferencedProtocols.begin();} + protocol_iterator protocol_end() const { return ReferencedProtocols.end(); } + unsigned protocol_size() const { return ReferencedProtocols.size(); } + + /// setProtocolList - Set the list of forward protocols. + void setProtocolList(ObjCProtocolDecl *const*List, unsigned Num, + ASTContext &C) { + ReferencedProtocols.set(List, Num, C); + } + static bool classof(const Decl *D) { + return D->getKind() == ObjCForwardProtocol; + } + static bool classof(const ObjCForwardProtocolDecl *D) { return true; } +}; + +/// ObjCCategoryDecl - Represents a category declaration. A category allows +/// you to add methods to an existing class (without subclassing or modifying +/// the original class interface or implementation:-). Categories don't allow +/// you to add instance data. The following example adds "myMethod" to all +/// NSView's within a process: +/// +/// @interface NSView (MyViewMethods) +/// - myMethod; +/// @end +/// +/// Cateogries also allow you to split the implementation of a class across +/// several files (a feature more naturally supported in C++). +/// +/// Categories were originally inspired by dynamic languages such as Common +/// Lisp and Smalltalk. More traditional class-based languages (C++, Java) +/// don't support this level of dynamism, which is both powerful and dangerous. +/// +class ObjCCategoryDecl : public ObjCContainerDecl { + /// Interface belonging to this category + ObjCInterfaceDecl *ClassInterface; + + /// referenced protocols in this category. + ObjCList ReferencedProtocols; + + /// Next category belonging to this class. + /// FIXME: this should not be a singly-linked list. Move storage elsewhere. + ObjCCategoryDecl *NextClassCategory; + + SourceLocation EndLoc; // marks the '>' or identifier. + + ObjCCategoryDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id) + : ObjCContainerDecl(ObjCCategory, DC, L, Id), + ClassInterface(0), NextClassCategory(0){ + } +public: + + static ObjCCategoryDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, IdentifierInfo *Id); + + ObjCInterfaceDecl *getClassInterface() { return ClassInterface; } + const ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; } + void setClassInterface(ObjCInterfaceDecl *IDecl) { ClassInterface = IDecl; } + + /// setProtocolList - Set the list of protocols that this interface + /// implements. + void setProtocolList(ObjCProtocolDecl *const*List, unsigned Num, + ASTContext &C) { + ReferencedProtocols.set(List, Num, C); + } + + const ObjCList &getReferencedProtocols() const { + return ReferencedProtocols; + } + + typedef ObjCList::iterator protocol_iterator; + protocol_iterator protocol_begin() const {return ReferencedProtocols.begin();} + protocol_iterator protocol_end() const { return ReferencedProtocols.end(); } + unsigned protocol_size() const { return ReferencedProtocols.size(); } + + ObjCCategoryDecl *getNextClassCategory() const { return NextClassCategory; } + void setNextClassCategory(ObjCCategoryDecl *Cat) { + NextClassCategory = Cat; + } + void insertNextClassCategory() { + NextClassCategory = ClassInterface->getCategoryList(); + ClassInterface->setCategoryList(this); + } + // Location information, modeled after the Stmt API. + SourceLocation getLocStart() const { return getLocation(); } // '@'interface + SourceLocation getLocEnd() const { return EndLoc; } + void setLocEnd(SourceLocation LE) { EndLoc = LE; }; + + static bool classof(const Decl *D) { return D->getKind() == ObjCCategory; } + static bool classof(const ObjCCategoryDecl *D) { return true; } +}; + +class ObjCImplDecl : public NamedDecl, public DeclContext { + /// Class interface for this category implementation + ObjCInterfaceDecl *ClassInterface; + + SourceLocation EndLoc; + +protected: + ObjCImplDecl(Kind DK, DeclContext *DC, SourceLocation L, + ObjCInterfaceDecl *classInterface) + : NamedDecl(DK, DC, L, + classInterface? classInterface->getDeclName() + : DeclarationName()), + DeclContext(DK), ClassInterface(classInterface) {} + +public: + virtual ~ObjCImplDecl() {} + + const ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; } + ObjCInterfaceDecl *getClassInterface() { return ClassInterface; } + void setClassInterface(ObjCInterfaceDecl *IFace) { ClassInterface = IFace; } + + void addInstanceMethod(ASTContext &Context, ObjCMethodDecl *method) { + // FIXME: Context should be set correctly before we get here. + method->setLexicalDeclContext(this); + addDecl(Context, method); + } + void addClassMethod(ASTContext &Context, ObjCMethodDecl *method) { + // FIXME: Context should be set correctly before we get here. + method->setLexicalDeclContext(this); + addDecl(Context, method); + } + + // Get the local instance/class method declared in this interface. + ObjCMethodDecl *getInstanceMethod(ASTContext &Context, Selector Sel) const; + ObjCMethodDecl *getClassMethod(ASTContext &Context, Selector Sel) const; + ObjCMethodDecl *getMethod(ASTContext &Context, Selector Sel, + bool isInstance) const { + return isInstance ? getInstanceMethod(Context, Sel) + : getClassMethod(Context, Sel); + } + + void addPropertyImplementation(ASTContext &Context, + ObjCPropertyImplDecl *property); + + ObjCPropertyImplDecl *FindPropertyImplDecl(ASTContext &Context, + IdentifierInfo *propertyId) const; + ObjCPropertyImplDecl *FindPropertyImplIvarDecl(ASTContext &Context, + IdentifierInfo *ivarId) const; + + // Iterator access to properties. + typedef specific_decl_iterator propimpl_iterator; + propimpl_iterator propimpl_begin(ASTContext &Context) const { + return propimpl_iterator(decls_begin(Context)); + } + propimpl_iterator propimpl_end(ASTContext &Context) const { + return propimpl_iterator(decls_end(Context)); + } + + typedef filtered_decl_iterator + instmeth_iterator; + instmeth_iterator instmeth_begin(ASTContext &Context) const { + return instmeth_iterator(decls_begin(Context)); + } + instmeth_iterator instmeth_end(ASTContext &Context) const { + return instmeth_iterator(decls_end(Context)); + } + + typedef filtered_decl_iterator + classmeth_iterator; + classmeth_iterator classmeth_begin(ASTContext &Context) const { + return classmeth_iterator(decls_begin(Context)); + } + classmeth_iterator classmeth_end(ASTContext &Context) const { + return classmeth_iterator(decls_end(Context)); + } + + // Location information, modeled after the Stmt API. + SourceLocation getLocStart() const { return getLocation(); } + SourceLocation getLocEnd() const { return EndLoc; } + void setLocEnd(SourceLocation LE) { EndLoc = LE; }; +}; + +/// ObjCCategoryImplDecl - An object of this class encapsulates a category +/// @implementation declaration. If a category class has declaration of a +/// property, its implementation must be specified in the category's +/// @implementation declaration. Example: +/// @interface I @end +/// @interface I(CATEGORY) +/// @property int p1, d1; +/// @end +/// @implementation I(CATEGORY) +/// @dynamic p1,d1; +/// @end +/// +/// ObjCCategoryImplDecl +class ObjCCategoryImplDecl : public ObjCImplDecl { + // Category name + IdentifierInfo *Id; + + ObjCCategoryImplDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id, + ObjCInterfaceDecl *classInterface) + : ObjCImplDecl(ObjCCategoryImpl, DC, L, classInterface), Id(Id) {} +public: + static ObjCCategoryImplDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, IdentifierInfo *Id, + ObjCInterfaceDecl *classInterface); + + /// getIdentifier - Get the identifier that names the class + /// interface associated with this implementation. + IdentifierInfo *getIdentifier() const { + return Id; + } + void setIdentifier(IdentifierInfo *II) { Id = II; } + + /// getNameAsCString - Get the name of identifier for the class + /// interface associated with this implementation as a C string + /// (const char*). + const char *getNameAsCString() const { + return Id ? Id->getName() : ""; + } + + /// @brief Get the name of the class associated with this interface. + std::string getNameAsString() const { + return Id ? Id->getName() : ""; + } + + static bool classof(const Decl *D) { return D->getKind() == ObjCCategoryImpl;} + static bool classof(const ObjCCategoryImplDecl *D) { return true; } + static DeclContext *castToDeclContext(const ObjCCategoryImplDecl *D) { + return static_cast(const_cast(D)); + } + static ObjCCategoryImplDecl *castFromDeclContext(const DeclContext *DC) { + return static_cast(const_cast(DC)); + } +}; + +/// ObjCImplementationDecl - Represents a class definition - this is where +/// method definitions are specified. For example: +/// +/// @code +/// @implementation MyClass +/// - (void)myMethod { /* do something */ } +/// @end +/// @endcode +/// +/// Typically, instance variables are specified in the class interface, +/// *not* in the implementation. Nevertheless (for legacy reasons), we +/// allow instance variables to be specified in the implementation. When +/// specified, they need to be *identical* to the interface. +/// +class ObjCImplementationDecl : public ObjCImplDecl { + /// Implementation Class's super class. + ObjCInterfaceDecl *SuperClass; + + ObjCImplementationDecl(DeclContext *DC, SourceLocation L, + ObjCInterfaceDecl *classInterface, + ObjCInterfaceDecl *superDecl) + : ObjCImplDecl(ObjCImplementation, DC, L, classInterface), + SuperClass(superDecl){} +public: + static ObjCImplementationDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, + ObjCInterfaceDecl *classInterface, + ObjCInterfaceDecl *superDecl); + + /// getIdentifier - Get the identifier that names the class + /// interface associated with this implementation. + IdentifierInfo *getIdentifier() const { + return getClassInterface()->getIdentifier(); + } + + /// getNameAsCString - Get the name of identifier for the class + /// interface associated with this implementation as a C string + /// (const char*). + const char *getNameAsCString() const { + assert(getIdentifier() && "Name is not a simple identifier"); + return getIdentifier()->getName(); + } + + /// @brief Get the name of the class associated with this interface. + std::string getNameAsString() const { + return getClassInterface()->getNameAsString(); + } + + const ObjCInterfaceDecl *getSuperClass() const { return SuperClass; } + ObjCInterfaceDecl *getSuperClass() { return SuperClass; } + + void setSuperClass(ObjCInterfaceDecl * superCls) { SuperClass = superCls; } + + typedef specific_decl_iterator ivar_iterator; + ivar_iterator ivar_begin(ASTContext &Context) const { + return ivar_iterator(decls_begin(Context)); + } + ivar_iterator ivar_end(ASTContext &Context) const { + return ivar_iterator(decls_end(Context)); + } + unsigned ivar_size(ASTContext &Context) const { + return std::distance(ivar_begin(Context), ivar_end(Context)); + } + bool ivar_empty(ASTContext &Context) const { + return ivar_begin(Context) == ivar_end(Context); + } + + static bool classof(const Decl *D) { + return D->getKind() == ObjCImplementation; + } + static bool classof(const ObjCImplementationDecl *D) { return true; } + static DeclContext *castToDeclContext(const ObjCImplementationDecl *D) { + return static_cast(const_cast(D)); + } + static ObjCImplementationDecl *castFromDeclContext(const DeclContext *DC) { + return static_cast(const_cast(DC)); + } +}; + +/// ObjCCompatibleAliasDecl - Represents alias of a class. This alias is +/// declared as @compatibility_alias alias class. +class ObjCCompatibleAliasDecl : public NamedDecl { + /// Class that this is an alias of. + ObjCInterfaceDecl *AliasedClass; + + ObjCCompatibleAliasDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id, + ObjCInterfaceDecl* aliasedClass) + : NamedDecl(ObjCCompatibleAlias, DC, L, Id), AliasedClass(aliasedClass) {} +public: + static ObjCCompatibleAliasDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, IdentifierInfo *Id, + ObjCInterfaceDecl* aliasedClass); + + const ObjCInterfaceDecl *getClassInterface() const { return AliasedClass; } + ObjCInterfaceDecl *getClassInterface() { return AliasedClass; } + void setClassInterface(ObjCInterfaceDecl *D) { AliasedClass = D; } + + static bool classof(const Decl *D) { + return D->getKind() == ObjCCompatibleAlias; + } + static bool classof(const ObjCCompatibleAliasDecl *D) { return true; } + +}; + +/// ObjCPropertyDecl - Represents one property declaration in an interface. +/// For example: +/// @property (assign, readwrite) int MyProperty; +/// +class ObjCPropertyDecl : public NamedDecl { +public: + enum PropertyAttributeKind { + OBJC_PR_noattr = 0x00, + OBJC_PR_readonly = 0x01, + OBJC_PR_getter = 0x02, + OBJC_PR_assign = 0x04, + OBJC_PR_readwrite = 0x08, + OBJC_PR_retain = 0x10, + OBJC_PR_copy = 0x20, + OBJC_PR_nonatomic = 0x40, + OBJC_PR_setter = 0x80 + }; + + enum SetterKind { Assign, Retain, Copy }; + enum PropertyControl { None, Required, Optional }; +private: + QualType DeclType; + unsigned PropertyAttributes : 8; + + // @required/@optional + unsigned PropertyImplementation : 2; + + Selector GetterName; // getter name of NULL if no getter + Selector SetterName; // setter name of NULL if no setter + + ObjCMethodDecl *GetterMethodDecl; // Declaration of getter instance method + ObjCMethodDecl *SetterMethodDecl; // Declaration of setter instance method + ObjCIvarDecl *PropertyIvarDecl; // Synthesize ivar for this property + + ObjCPropertyDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id, + QualType T) + : NamedDecl(ObjCProperty, DC, L, Id), DeclType(T), + PropertyAttributes(OBJC_PR_noattr), PropertyImplementation(None), + GetterName(Selector()), + SetterName(Selector()), + GetterMethodDecl(0), SetterMethodDecl(0) , PropertyIvarDecl(0) {} +public: + static ObjCPropertyDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, + IdentifierInfo *Id, QualType T, + PropertyControl propControl = None); + QualType getType() const { return DeclType; } + void setType(QualType T) { DeclType = T; } + + PropertyAttributeKind getPropertyAttributes() const { + return PropertyAttributeKind(PropertyAttributes); + } + void setPropertyAttributes(PropertyAttributeKind PRVal) { + PropertyAttributes |= PRVal; + } + + void makeitReadWriteAttribute(void) { + PropertyAttributes &= ~OBJC_PR_readonly; + PropertyAttributes |= OBJC_PR_readwrite; + } + + // Helper methods for accessing attributes. + + /// isReadOnly - Return true iff the property has a setter. + bool isReadOnly() const { + return (PropertyAttributes & OBJC_PR_readonly); + } + + /// getSetterKind - Return the method used for doing assignment in + /// the property setter. This is only valid if the property has been + /// defined to have a setter. + SetterKind getSetterKind() const { + if (PropertyAttributes & OBJC_PR_retain) + return Retain; + if (PropertyAttributes & OBJC_PR_copy) + return Copy; + return Assign; + } + + Selector getGetterName() const { return GetterName; } + void setGetterName(Selector Sel) { GetterName = Sel; } + + Selector getSetterName() const { return SetterName; } + void setSetterName(Selector Sel) { SetterName = Sel; } + + ObjCMethodDecl *getGetterMethodDecl() const { return GetterMethodDecl; } + void setGetterMethodDecl(ObjCMethodDecl *gDecl) { GetterMethodDecl = gDecl; } + + ObjCMethodDecl *getSetterMethodDecl() const { return SetterMethodDecl; } + void setSetterMethodDecl(ObjCMethodDecl *gDecl) { SetterMethodDecl = gDecl; } + + // Related to @optional/@required declared in @protocol + void setPropertyImplementation(PropertyControl pc) { + PropertyImplementation = pc; + } + PropertyControl getPropertyImplementation() const { + return PropertyControl(PropertyImplementation); + } + + void setPropertyIvarDecl(ObjCIvarDecl *Ivar) { + PropertyIvarDecl = Ivar; + } + ObjCIvarDecl *getPropertyIvarDecl() const { + return PropertyIvarDecl; + } + + static bool classof(const Decl *D) { + return D->getKind() == ObjCProperty; + } + static bool classof(const ObjCPropertyDecl *D) { return true; } +}; + +/// ObjCPropertyImplDecl - Represents implementation declaration of a property +/// in a class or category implementation block. For example: +/// @synthesize prop1 = ivar1; +/// +class ObjCPropertyImplDecl : public Decl { +public: + enum Kind { + Synthesize, + Dynamic + }; +private: + SourceLocation AtLoc; // location of @synthesize or @dynamic + /// Property declaration being implemented + ObjCPropertyDecl *PropertyDecl; + + /// Null for @dynamic. Required for @synthesize. + ObjCIvarDecl *PropertyIvarDecl; + + ObjCPropertyImplDecl(DeclContext *DC, SourceLocation atLoc, SourceLocation L, + ObjCPropertyDecl *property, + Kind PK, + ObjCIvarDecl *ivarDecl) + : Decl(ObjCPropertyImpl, DC, L), AtLoc(atLoc), + PropertyDecl(property), PropertyIvarDecl(ivarDecl) { + assert (PK == Dynamic || PropertyIvarDecl); + } + +public: + static ObjCPropertyImplDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation atLoc, SourceLocation L, + ObjCPropertyDecl *property, + Kind PK, + ObjCIvarDecl *ivarDecl); + + SourceLocation getLocStart() const { return AtLoc; } + void setAtLoc(SourceLocation Loc) { AtLoc = Loc; } + + ObjCPropertyDecl *getPropertyDecl() const { + return PropertyDecl; + } + void setPropertyDecl(ObjCPropertyDecl *Prop) { PropertyDecl = Prop; } + + Kind getPropertyImplementation() const { + return PropertyIvarDecl ? Synthesize : Dynamic; + } + + ObjCIvarDecl *getPropertyIvarDecl() const { + return PropertyIvarDecl; + } + void setPropertyIvarDecl(ObjCIvarDecl *Ivar) { PropertyIvarDecl = Ivar; } + + static bool classof(const Decl *D) { + return D->getKind() == ObjCPropertyImpl; + } + static bool classof(const ObjCPropertyImplDecl *D) { return true; } +}; + +} // end namespace clang +#endif diff --git a/include/clang/AST/DeclTemplate.h b/include/clang/AST/DeclTemplate.h new file mode 100644 index 0000000..226af34 --- /dev/null +++ b/include/clang/AST/DeclTemplate.h @@ -0,0 +1,859 @@ +//===-- DeclTemplate.h - Classes for representing C++ templates -*- 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 C++ template declaration subclasses. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_DECLTEMPLATE_H +#define LLVM_CLANG_AST_DECLTEMPLATE_H + +#include "clang/AST/DeclCXX.h" +#include "llvm/ADT/APSInt.h" +#include "llvm/ADT/FoldingSet.h" + +namespace clang { + +class TemplateParameterList; +class TemplateDecl; +class FunctionTemplateDecl; +class ClassTemplateDecl; +class ClassTemplatePartialSpecializationDecl; +class TemplateTypeParmDecl; +class NonTypeTemplateParmDecl; +class TemplateTemplateParmDecl; + +/// TemplateParameterList - Stores a list of template parameters for a +/// TemplateDecl and its derived classes. +class TemplateParameterList { + /// The location of the 'template' keyword. + SourceLocation TemplateLoc; + + /// The locations of the '<' and '>' angle brackets. + SourceLocation LAngleLoc, RAngleLoc; + + /// The number of template parameters in this template + /// parameter list. + unsigned NumParams; + + TemplateParameterList(SourceLocation TemplateLoc, SourceLocation LAngleLoc, + Decl **Params, unsigned NumParams, + SourceLocation RAngleLoc); + +public: + static TemplateParameterList *Create(ASTContext &C, + SourceLocation TemplateLoc, + SourceLocation LAngleLoc, + Decl **Params, + unsigned NumParams, + SourceLocation RAngleLoc); + + /// iterator - Iterates through the template parameters in this list. + typedef Decl** iterator; + + /// const_iterator - Iterates through the template parameters in this list. + typedef Decl* const* const_iterator; + + iterator begin() { return reinterpret_cast(this + 1); } + const_iterator begin() const { + return reinterpret_cast(this + 1); + } + iterator end() { return begin() + NumParams; } + const_iterator end() const { return begin() + NumParams; } + + unsigned size() const { return NumParams; } + + const Decl* getParam(unsigned Idx) const { + assert(Idx < size() && "Template parameter index out-of-range"); + return begin()[Idx]; + } + + /// \btief Returns the minimum number of arguments needed to form a + /// template specialization. This may be fewer than the number of + /// template parameters, if some of the parameters have default + /// arguments. + unsigned getMinRequiredArguments() const; + + SourceLocation getTemplateLoc() const { return TemplateLoc; } + SourceLocation getLAngleLoc() const { return LAngleLoc; } + SourceLocation getRAngleLoc() const { return RAngleLoc; } + + SourceRange getSourceRange() const { + return SourceRange(TemplateLoc, RAngleLoc); + } +}; + +//===----------------------------------------------------------------------===// +// Kinds of Templates +//===----------------------------------------------------------------------===// + +/// TemplateDecl - The base class of all kinds of template declarations (e.g., +/// class, function, etc.). The TemplateDecl class stores the list of template +/// parameters and a reference to the templated scoped declaration: the +/// underlying AST node. +class TemplateDecl : public NamedDecl { +protected: + // This is probably never used. + TemplateDecl(Kind DK, DeclContext *DC, SourceLocation L, + DeclarationName Name) + : NamedDecl(DK, DC, L, Name), TemplatedDecl(0), TemplateParams(0) + { } + + // Construct a template decl with the given name and parameters. + // Used when there is not templated element (tt-params, alias?). + TemplateDecl(Kind DK, DeclContext *DC, SourceLocation L, + DeclarationName Name, TemplateParameterList *Params) + : NamedDecl(DK, DC, L, Name), TemplatedDecl(0), TemplateParams(Params) + { } + + // Construct a template decl with name, parameters, and templated element. + TemplateDecl(Kind DK, DeclContext *DC, SourceLocation L, + DeclarationName Name, TemplateParameterList *Params, + NamedDecl *Decl) + : NamedDecl(DK, DC, L, Name), TemplatedDecl(Decl), + TemplateParams(Params) { } +public: + ~TemplateDecl(); + + /// Get the list of template parameters + TemplateParameterList *getTemplateParameters() const { + return TemplateParams; + } + + /// Get the underlying, templated declaration. + NamedDecl *getTemplatedDecl() const { return TemplatedDecl; } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { + return D->getKind() >= TemplateFirst && D->getKind() <= TemplateLast; + } + static bool classof(const TemplateDecl *D) { return true; } + static bool classof(const FunctionTemplateDecl *D) { return true; } + static bool classof(const ClassTemplateDecl *D) { return true; } + static bool classof(const TemplateTemplateParmDecl *D) { return true; } + +protected: + NamedDecl *TemplatedDecl; + TemplateParameterList* TemplateParams; +}; + +/// Declaration of a template function. +class FunctionTemplateDecl : public TemplateDecl { +protected: + FunctionTemplateDecl(DeclContext *DC, SourceLocation L, DeclarationName Name, + TemplateParameterList *Params, NamedDecl *Decl) + : TemplateDecl(FunctionTemplate, DC, L, Name, Params, Decl) { } +public: + /// Get the underling function declaration of the template. + FunctionDecl *getTemplatedDecl() const { + return static_cast(TemplatedDecl); + } + + /// Create a template function node. + static FunctionTemplateDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, + DeclarationName Name, + TemplateParameterList *Params, + NamedDecl *Decl); + + // Implement isa/cast/dyncast support + static bool classof(const Decl *D) + { return D->getKind() == FunctionTemplate; } + static bool classof(const FunctionTemplateDecl *D) + { return true; } +}; + +//===----------------------------------------------------------------------===// +// Kinds of Template Parameters +//===----------------------------------------------------------------------===// + +/// The TemplateParmPosition class defines the position of a template parameter +/// within a template parameter list. Because template parameter can be listed +/// sequentially for out-of-line template members, each template parameter is +/// given a Depth - the nesting of template parameter scopes - and a Position - +/// the occurrence within the parameter list. +/// This class is inheritedly privately by different kinds of template +/// parameters and is not part of the Decl hierarchy. Just a facility. +class TemplateParmPosition +{ +protected: + // FIXME: This should probably never be called, but it's here as + TemplateParmPosition() + : Depth(0), Position(0) + { /* assert(0 && "Cannot create positionless template parameter"); */ } + + TemplateParmPosition(unsigned D, unsigned P) + : Depth(D), Position(P) + { } + + // FIXME: These probably don't need to be ints. int:5 for depth, int:8 for + // position? Maybe? + unsigned Depth; + unsigned Position; + +public: + /// Get the nesting depth of the template parameter. + unsigned getDepth() const { return Depth; } + + /// Get the position of the template parameter within its parameter list. + unsigned getPosition() const { return Position; } +}; + +/// TemplateTypeParmDecl - Declaration of a template type parameter, +/// e.g., "T" in +/// @code +/// template class vector; +/// @endcode +class TemplateTypeParmDecl : public TypeDecl { + /// \brief Whether this template type parameter was declaration with + /// the 'typename' keyword. If false, it was declared with the + /// 'class' keyword. + bool Typename : 1; + + /// \brief Whether this template type parameter inherited its + /// default argument. + bool InheritedDefault : 1; + + /// \brief The location of the default argument, if any. + SourceLocation DefaultArgumentLoc; + + /// \brief The default template argument, if any. + QualType DefaultArgument; + + TemplateTypeParmDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id, + bool Typename, QualType Type) + : TypeDecl(TemplateTypeParm, DC, L, Id), Typename(Typename), + InheritedDefault(false), DefaultArgument() { + TypeForDecl = Type.getTypePtr(); + } + +public: + static TemplateTypeParmDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, unsigned D, unsigned P, + IdentifierInfo *Id, bool Typename); + + /// \brief Whether this template type parameter was declared with + /// the 'typename' keyword. If not, it was declared with the 'class' + /// keyword. + bool wasDeclaredWithTypename() const { return Typename; } + + /// \brief Determine whether this template parameter has a default + /// argument. + bool hasDefaultArgument() const { return !DefaultArgument.isNull(); } + + /// \brief Retrieve the default argument, if any. + QualType getDefaultArgument() const { return DefaultArgument; } + + /// \brief Retrieve the location of the default argument, if any. + SourceLocation getDefaultArgumentLoc() const { return DefaultArgumentLoc; } + + /// \brief Determines whether the default argument was inherited + /// from a previous declaration of this template. + bool defaultArgumentWasInherited() const { return InheritedDefault; } + + /// \brief Set the default argument for this template parameter, and + /// whether that default argument was inherited from another + /// declaration. + void setDefaultArgument(QualType DefArg, SourceLocation DefArgLoc, + bool Inherited) { + DefaultArgument = DefArg; + DefaultArgumentLoc = DefArgLoc; + InheritedDefault = Inherited; + } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { + return D->getKind() == TemplateTypeParm; + } + static bool classof(const TemplateTypeParmDecl *D) { return true; } +}; + +/// NonTypeTemplateParmDecl - Declares a non-type template parameter, +/// e.g., "Size" in +/// @code +/// template class array { }; +/// @endcode +class NonTypeTemplateParmDecl + : public VarDecl, protected TemplateParmPosition { + /// \brief The default template argument, if any. + Expr *DefaultArgument; + + NonTypeTemplateParmDecl(DeclContext *DC, SourceLocation L, unsigned D, + unsigned P, IdentifierInfo *Id, QualType T, + SourceLocation TSSL = SourceLocation()) + : VarDecl(NonTypeTemplateParm, DC, L, Id, T, VarDecl::None, TSSL), + TemplateParmPosition(D, P), DefaultArgument(0) + { } + +public: + static NonTypeTemplateParmDecl * + Create(ASTContext &C, DeclContext *DC, SourceLocation L, unsigned D, + unsigned P, IdentifierInfo *Id, QualType T, + SourceLocation TypeSpecStartLoc = SourceLocation()); + + using TemplateParmPosition::getDepth; + using TemplateParmPosition::getPosition; + + /// \brief Determine whether this template parameter has a default + /// argument. + bool hasDefaultArgument() const { return DefaultArgument; } + + /// \brief Retrieve the default argument, if any. + Expr *getDefaultArgument() const { return DefaultArgument; } + + /// \brief Retrieve the location of the default argument, if any. + SourceLocation getDefaultArgumentLoc() const; + + /// \brief Set the default argument for this template parameter. + void setDefaultArgument(Expr *DefArg) { + DefaultArgument = DefArg; + } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { + return D->getKind() == NonTypeTemplateParm; + } + static bool classof(const NonTypeTemplateParmDecl *D) { return true; } +}; + +/// TemplateTemplateParmDecl - Declares a template template parameter, +/// e.g., "T" in +/// @code +/// template