[cfe-commits] r90436 - /cfe/trunk/lib/Frontend/CompilerInstance.cpp

Ted Kremenek kremenek at apple.com
Thu Dec 3 09:31:36 PST 2009


On second thought, I see why the check isn't needed at all.  If we fail to create the PTHManager, we can still just go ahead with creating a Preprocessor.  The PTH is just a speed enhancement.

On Dec 3, 2009, at 8:47 AM, Ted Kremenek wrote:

> Hi Daniel,
> 
> Instead of removing that check entirely, it should probably be changed to a null pointer check on the PTHManager* returned by PTHManager::Create().  That method can return NULL for a variety of error conditions.
> 
> Ted
> 
> On Dec 3, 2009, at 1:13 AM, Daniel Dunbar wrote:
> 
>> Author: ddunbar
>> Date: Thu Dec  3 03:13:19 2009
>> New Revision: 90436
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=90436&view=rev
>> Log:
>> Remove an unnecessary (I believe) exit() on error.
>> 
>> Modified:
>>   cfe/trunk/lib/Frontend/CompilerInstance.cpp
>> 
>> Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=90436&r1=90435&r2=90436&view=diff
>> 
>> ==============================================================================
>> --- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
>> +++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Thu Dec  3 03:13:19 2009
>> @@ -172,10 +172,6 @@
>>  if (!PPOpts.TokenCache.empty())
>>    PTHMgr = PTHManager::Create(PPOpts.TokenCache, Diags);
>> 
>> -  // FIXME: Don't fail like this.
>> -  if (Diags.hasErrorOccurred())
>> -    exit(1);
>> -
>>  // Create the Preprocessor.
>>  HeaderSearch *HeaderInfo = new HeaderSearch(FileMgr);
>>  Preprocessor *PP = new Preprocessor(Diags, LangInfo, Target,
>> 
>> 
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list