[cfe-dev] Why, in CompilerInstance.cpp, in ExecuteAction, is hasSoourceManger() in loop?
Larry Evans
cppljevans at suddenlink.net
Sat Oct 20 04:00:27 PDT 2012
On 10/20/12 04:58, Larry Evans wrote:
> The code here:
>
> http://clang.llvm.org/doxygen/CompilerInstance_8cpp_source.html
>
> in the member function:
>
> CompilerInstance::ExecuteAction(FrontendAction &Act)
>
> there's a loop whose body calls hasSourceManager() on line 669.
> It's not obvious to me that executing the loop would
> change the result of hasSourceManager; hence I'm wondering
> why this test couldn't be moved outside and before the loop?
>
> TIA.
>
> -regards,
> Larry
I see it now in FrontEndAction.cpp at:
CI.setSourceManager(&AST->getSourceManager());
which, I assume, assures hasSourceManager() return true.
Sorry for noise.
-Larry
More information about the cfe-dev
mailing list