summaryrefslogtreecommitdiffstats
path: root/include/clang/Frontend
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Frontend')
-rw-r--r--include/clang/Frontend/ASTUnit.h26
-rw-r--r--include/clang/Frontend/CodeGenOptions.h4
-rw-r--r--include/clang/Frontend/DiagnosticOptions.h5
-rw-r--r--include/clang/Frontend/LangStandard.h20
-rw-r--r--include/clang/Frontend/LangStandards.def11
-rw-r--r--include/clang/Frontend/PreprocessorOptions.h5
-rw-r--r--include/clang/Frontend/Utils.h3
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,
OpenPOWER on IntegriCloud