On Thursday, August 16, 2012 4:05 AM, Jordan Rose wrote:
> This looks pretty good to me! I initially thought we could pull all the
> SourceManager stuff under NDEBUG, but it does make sense to have it used
> for the actual emitting of errors at the end, rather than pulling it
> from the preprocessor.
I did consider keeping the map between FileID and FileEntry* and also
marking module header files as parsed at the point they are seen so that
SrcManager also dropped out in the NDEBUG block in CheckDiagnostics, but
I wasn't convinced the additional complexity and "baggage" was warranted
so I kept with the simple approach for now.
> I'll look at this again tomorrow morning (time zone PDT) and commit it
> then if it all looks good.
Great, thanks! :o)
Plus, it means I can also get in this bit that slipped the net:
--- tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
+++ tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
@@ -37,10 +37,11 @@
}
VerifyDiagnosticConsumer::~VerifyDiagnosticConsumer() {
assert(!ActiveSourceFiles && "Incomplete parsing of source files!");
assert(!CurrentPreprocessor && "CurrentPreprocessor should be invalid!");
+ SrcManager = 0;
CheckDiagnostics();
Diags.takeClient();
if (OwnsPrimaryClient)
delete PrimaryClient;
}
SrcManager needs to be cleared before CheckDiagnostics because it will
certainly be pointing to some invalid location by this stage.
Thanks again,
Andy
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits