diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-07-19 21:46:24 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-07-19 21:46:24 +0000 |
commit | aa21cc401b001b67b234c8dc2edaad1fd3210040 (patch) | |
tree | 4bb0ba8b695f453d78ed548411d5207fcbe39ad3 /clang/lib/Basic/Diagnostic.cpp | |
parent | 0edf6a11313c4df7fded529a389299b311f06943 (diff) | |
download | bcm5719-llvm-aa21cc401b001b67b234c8dc2edaad1fd3210040.tar.gz bcm5719-llvm-aa21cc401b001b67b234c8dc2edaad1fd3210040.zip |
Introduce a new libclang API, clang_reparseTranslationUnit(), which
reparses an already-parsed translation unit. At the moment it's just a
convenience function, but we hope to use it for performance
optimizations.
llvm-svn: 108756
Diffstat (limited to 'clang/lib/Basic/Diagnostic.cpp')
-rw-r--r-- | clang/lib/Basic/Diagnostic.cpp | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp index 641d87bb9af..68548da0cb1 100644 --- a/clang/lib/Basic/Diagnostic.cpp +++ b/clang/lib/Basic/Diagnostic.cpp @@ -244,35 +244,10 @@ static void DummyArgToStringFn(Diagnostic::ArgumentKind AK, intptr_t QT, Diagnostic::Diagnostic(DiagnosticClient *client) : Client(client) { - AllExtensionsSilenced = 0; - IgnoreAllWarnings = false; - WarningsAsErrors = false; - ErrorsAsFatal = false; - SuppressSystemWarnings = false; - SuppressAllDiagnostics = false; - ShowOverloads = Ovl_All; - ExtBehavior = Ext_Ignore; - - ErrorOccurred = false; - FatalErrorOccurred = false; - ErrorLimit = 0; - TemplateBacktraceLimit = 0; - - NumWarnings = 0; - NumErrors = 0; - NumErrorsSuppressed = 0; - CustomDiagInfo = 0; - CurDiagID = ~0U; - LastDiagLevel = Ignored; - ArgToStringFn = DummyArgToStringFn; ArgToStringCookie = 0; - DelayedDiagID = 0; - - // Set all mappings to 'unset'. - DiagMappings BlankDiags(diag::DIAG_UPPER_LIMIT/2, 0); - DiagMappingsStack.push_back(BlankDiags); + Reset(); } Diagnostic::~Diagnostic() { @@ -335,6 +310,36 @@ bool Diagnostic::isBuiltinExtensionDiag(unsigned DiagID, return true; } +void Diagnostic::Reset() { + AllExtensionsSilenced = 0; + IgnoreAllWarnings = false; + WarningsAsErrors = false; + ErrorsAsFatal = false; + SuppressSystemWarnings = false; + SuppressAllDiagnostics = false; + ShowOverloads = Ovl_All; + ExtBehavior = Ext_Ignore; + + ErrorOccurred = false; + FatalErrorOccurred = false; + ErrorLimit = 0; + TemplateBacktraceLimit = 0; + + NumWarnings = 0; + NumErrors = 0; + NumErrorsSuppressed = 0; + CustomDiagInfo = 0; + CurDiagID = ~0U; + LastDiagLevel = Ignored; + DelayedDiagID = 0; + + // Set all mappings to 'unset'. + while (!DiagMappingsStack.empty()) + DiagMappingsStack.pop_back(); + + DiagMappings BlankDiags(diag::DIAG_UPPER_LIMIT/2, 0); + DiagMappingsStack.push_back(BlankDiags); +} /// getDescription - Given a diagnostic ID, return a description of the /// issue. |