diff options
author | dim <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
commit | c49018d9cce52d8c9f34b44865ec3ba8e89a1488 (patch) | |
tree | c5e9e10bc189de0058aa763c47b9920a8351b7df /include/clang/Frontend | |
parent | 110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab (diff) | |
download | FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.zip FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.tar.gz |
Vendor import of clang trunk r132879:
http://llvm.org/svn/llvm-project/cfe/trunk@132879
Diffstat (limited to 'include/clang/Frontend')
-rw-r--r-- | include/clang/Frontend/ASTUnit.h | 26 | ||||
-rw-r--r-- | include/clang/Frontend/CodeGenOptions.h | 4 | ||||
-rw-r--r-- | include/clang/Frontend/DiagnosticOptions.h | 5 | ||||
-rw-r--r-- | include/clang/Frontend/LangStandard.h | 20 | ||||
-rw-r--r-- | include/clang/Frontend/LangStandards.def | 11 | ||||
-rw-r--r-- | include/clang/Frontend/PreprocessorOptions.h | 5 | ||||
-rw-r--r-- | include/clang/Frontend/Utils.h | 3 |
7 files changed, 55 insertions, 19 deletions
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index 57c59d9..339297e 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -51,6 +51,7 @@ class HeaderSearch; class Preprocessor; class SourceManager; class TargetInfo; +class ASTFrontendAction; using namespace idx; @@ -248,6 +249,10 @@ private: /// \brief Whether we should be caching code-completion results. bool ShouldCacheCodeCompletionResults; + /// \brief Whether we want to include nested macro instantiations in the + /// detailed preprocessing record. + bool NestedMacroInstantiations; + static void ConfigureDiags(llvm::IntrusiveRefCntPtr<Diagnostic> &Diags, const char **ArgBegin, const char **ArgEnd, ASTUnit &AST, bool CaptureDiagnostics); @@ -574,6 +579,21 @@ private: public: + /// \brief Create an ASTUnit from a source file, via a CompilerInvocation + /// object, by invoking the optionally provided ASTFrontendAction. + /// + /// \param CI - The compiler invocation to use; it must have exactly one input + /// source file. The ASTUnit takes ownership of the CompilerInvocation object. + /// + /// \param Diags - The diagnostics engine to use for reporting errors; its + /// lifetime is expected to extend past that of the returned ASTUnit. + /// + /// \param Action - The ASTFrontendAction to invoke. Its ownership is not + /// transfered. + static ASTUnit *LoadFromCompilerInvocationAction(CompilerInvocation *CI, + llvm::IntrusiveRefCntPtr<Diagnostic> Diags, + ASTFrontendAction *Action = 0); + /// LoadFromCompilerInvocation - Create an ASTUnit from a source file, via a /// CompilerInvocation object. /// @@ -591,7 +611,8 @@ public: bool CaptureDiagnostics = false, bool PrecompilePreamble = false, bool CompleteTranslationUnit = true, - bool CacheCodeCompletionResults = false); + bool CacheCodeCompletionResults = false, + bool NestedMacroInstantiations = true); /// LoadFromCommandLine - Create an ASTUnit from a vector of command line /// arguments, which must specify exactly one source file. @@ -620,7 +641,8 @@ public: bool CompleteTranslationUnit = true, bool CacheCodeCompletionResults = false, bool CXXPrecompilePreamble = false, - bool CXXChainedPCH = false); + bool CXXChainedPCH = false, + bool NestedMacroInstantiations = true); /// \brief Reparse the source files using the same command-line options that /// were originally used to produce this translation unit. diff --git a/include/clang/Frontend/CodeGenOptions.h b/include/clang/Frontend/CodeGenOptions.h index 8bef6a3..1c686c7 100644 --- a/include/clang/Frontend/CodeGenOptions.h +++ b/include/clang/Frontend/CodeGenOptions.h @@ -95,6 +95,10 @@ public: /// The code model to use (-mcmodel). std::string CodeModel; + /// The filename with path we use for coverage files. The extension will be + /// replaced. + std::string CoverageFile; + /// Enable additional debugging information. std::string DebugPass; diff --git a/include/clang/Frontend/DiagnosticOptions.h b/include/clang/Frontend/DiagnosticOptions.h index ff92058..56093c3 100644 --- a/include/clang/Frontend/DiagnosticOptions.h +++ b/include/clang/Frontend/DiagnosticOptions.h @@ -37,6 +37,10 @@ public: unsigned ShowNoteIncludeStack : 1; /// Show include stacks for notes. unsigned ShowCategories : 2; /// Show categories: 0 -> none, 1 -> Number, /// 2 -> Full Name. + + unsigned Format : 2; /// Format for diagnostics: + enum TextDiagnosticFormat { Clang, Msvc, Vi }; + unsigned ShowColors : 1; /// Show diagnostics with ANSI color sequences. unsigned ShowOverloads : 1; /// Overload candidates to show. Values from /// Diagnostic::OverloadsShown @@ -86,6 +90,7 @@ public: ShowNames = 0; ShowOptionNames = 0; ShowCategories = 0; + Format = Clang; ShowSourceRanges = 0; ShowParseableFixits = 0; VerifyDiagnostics = 0; diff --git a/include/clang/Frontend/LangStandard.h b/include/clang/Frontend/LangStandard.h index 74ca519..ea37bdd 100644 --- a/include/clang/Frontend/LangStandard.h +++ b/include/clang/Frontend/LangStandard.h @@ -18,14 +18,15 @@ namespace frontend { enum LangFeatures { BCPLComment = (1 << 0), - C99 = (1 << 1), - C1X = (1 << 2), - CPlusPlus = (1 << 3), - CPlusPlus0x = (1 << 4), - Digraphs = (1 << 5), - GNUMode = (1 << 6), - HexFloat = (1 << 7), - ImplicitInt = (1 << 8) + C89 = (1 << 1), + C99 = (1 << 2), + C1X = (1 << 3), + CPlusPlus = (1 << 4), + CPlusPlus0x = (1 << 5), + Digraphs = (1 << 6), + GNUMode = (1 << 7), + HexFloat = (1 << 8), + ImplicitInt = (1 << 9) }; } @@ -54,6 +55,9 @@ public: /// hasBCPLComments - Language supports '//' comments. bool hasBCPLComments() const { return Flags & frontend::BCPLComment; } + /// isC89 - Language is a superset of C89. + bool isC89() const { return Flags & frontend::C89; } + /// isC99 - Language is a superset of C99. bool isC99() const { return Flags & frontend::C99; } diff --git a/include/clang/Frontend/LangStandards.def b/include/clang/Frontend/LangStandards.def index 586e5c8..6055ad5 100644 --- a/include/clang/Frontend/LangStandards.def +++ b/include/clang/Frontend/LangStandards.def @@ -22,21 +22,21 @@ // C89-ish modes. LANGSTANDARD(c89, "c89", "ISO C 1990", - ImplicitInt) + C89 | ImplicitInt) LANGSTANDARD(c90, "c90", "ISO C 1990", - ImplicitInt) + C89 | ImplicitInt) LANGSTANDARD(iso9899_1990, "iso9899:1990", "ISO C 1990", - ImplicitInt) + C89 | ImplicitInt) LANGSTANDARD(c94, "iso9899:199409", "ISO C 1990 with amendment 1", - Digraphs | ImplicitInt) + C89 | Digraphs | ImplicitInt) LANGSTANDARD(gnu89, "gnu89", "ISO C 1990 with GNU extensions", - BCPLComment | Digraphs | GNUMode | ImplicitInt) + BCPLComment | C89 | Digraphs | GNUMode | ImplicitInt) // C99-ish modes LANGSTANDARD(c99, "c99", @@ -87,7 +87,6 @@ LANGSTANDARD(gnucxx0x, "gnu++0x", BCPLComment | CPlusPlus | CPlusPlus0x | Digraphs | GNUMode) // OpenCL - LANGSTANDARD(opencl, "cl", "OpenCL 1.0", BCPLComment | C99 | Digraphs | HexFloat) diff --git a/include/clang/Frontend/PreprocessorOptions.h b/include/clang/Frontend/PreprocessorOptions.h index e875ec1..e471c5c 100644 --- a/include/clang/Frontend/PreprocessorOptions.h +++ b/include/clang/Frontend/PreprocessorOptions.h @@ -41,6 +41,10 @@ public: /// record of all macro definitions and /// instantiations. + /// \brief Whether the detailed preprocessing record includes nested macro + /// instantiations. + unsigned DetailedRecordIncludesNestedMacroInstantiations : 1; + /// The implicit PCH included at the start of the translation unit, or empty. std::string ImplicitPCHInclude; @@ -136,6 +140,7 @@ public: public: PreprocessorOptions() : UsePredefines(true), DetailedRecord(false), + DetailedRecordIncludesNestedMacroInstantiations(true), DisablePCHValidation(false), DisableStatCache(false), DumpDeserializedPCHDecls(false), PrecompiledPreambleBytes(0, true), diff --git a/include/clang/Frontend/Utils.h b/include/clang/Frontend/Utils.h index e499716..3c34c2d 100644 --- a/include/clang/Frontend/Utils.h +++ b/include/clang/Frontend/Utils.h @@ -71,9 +71,6 @@ void ProcessWarningOptions(Diagnostic &Diags, const DiagnosticOptions &Opts); void DoPrintPreprocessedInput(Preprocessor &PP, llvm::raw_ostream* OS, const PreprocessorOutputOptions &Opts); -/// CheckDiagnostics - Gather the expected diagnostics and check them. -bool CheckDiagnostics(Preprocessor &PP); - /// AttachDependencyFileGen - Create a dependency file generator, and attach /// it to the given preprocessor. This takes ownership of the output stream. void AttachDependencyFileGen(Preprocessor &PP, |