[cfe-commits] r161650 - in /cfe/trunk: include/clang/Frontend/VerifyDiagnosticConsumer.h lib/ARCMigrate/ARCMT.cpp lib/Frontend/VerifyDiagnosticConsumer.cpp test/ARCMT/verify.m test/ASTMerge/function.c test/Frontend/verify.c test/Frontend/verify2.c test/Frontend/veri

Andy Gibbs andyg1001 at hotmail.co.uk
Wed Aug 15 22:28:05 PDT 2012


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






More information about the cfe-commits mailing list