Refactoring of Diagnostic class.

-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class.
-DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units.
-The rest of the state in Diagnostic object is considered related and tied to one translation unit.
-Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a
   SourceLocation instead of a FullSourceLoc.
-Reflect the changes to various interfaces.

llvm-svn: 119730
This commit is contained in:
Argyrios Kyrtzidis
2010-11-18 20:06:41 +00:00
parent 4fadc5b20a
commit d004064864
30 changed files with 948 additions and 808 deletions

View File

@@ -258,7 +258,9 @@ struct AllocatedCXCodeCompleteResults : public CXCodeCompleteResults {
static unsigned CodeCompletionResultObjects;
AllocatedCXCodeCompleteResults::AllocatedCXCodeCompleteResults()
: CXCodeCompleteResults(), Diag(new Diagnostic),
: CXCodeCompleteResults(),
Diag(new Diagnostic(
llvm::IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs))),
SourceMgr(*Diag, FileMgr, FileSystemOpts) {
if (getenv("LIBCLANG_OBJTRACKING")) {
++CodeCompletionResultObjects;