[llvm-commits] [llvm] r120860 - /llvm/trunk/tools/lto/LTOCodeGenerator.cpp

Devang Patel dpatel at apple.com
Mon Dec 6 10:09:32 PST 2010


On Dec 3, 2010, at 7:36 PM, Rafael EspĂ­ndola wrote:

>> Do not try luck by using given name to create temporary file. In parallel builds it may not work.
> 
> Is this a bug in the Path API?  The documentation says
> 
>      bool createTemporaryFileOnDisk(
>        bool reuse_current = false, ///< When set to true, this parameter
>          ///< indicates that if the current file name does not exist then
>          ///< it will be used without modification.
> 
> So I would assume that if the name does exist a new one is created.

After it is determine that name does not exit, but before the file with the name is created, someone else can also determine that name does not exit in a massively parallel build. "reuse_current = true" is not useful in parallel builds.

-
Devang

> 
>> Modified:
>>    llvm/trunk/tools/lto/LTOCodeGenerator.cpp
>> 
>> Modified: llvm/trunk/tools/lto/LTOCodeGenerator.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOCodeGenerator.cpp?rev=120860&r1=120859&r2=120860&view=diff
>> ==============================================================================
>> --- llvm/trunk/tools/lto/LTOCodeGenerator.cpp (original)
>> +++ llvm/trunk/tools/lto/LTOCodeGenerator.cpp Fri Dec  3 17:58:31 2010
>> @@ -209,7 +209,7 @@
>> 
>>     // make unique temp .o file to put generated object file
>>     sys::PathWithStatus uniqueObjPath("lto-llvm.o");
>> -    if ( uniqueObjPath.createTemporaryFileOnDisk(true, &errMsg) ) {
>> +    if ( uniqueObjPath.createTemporaryFileOnDisk(false, &errMsg) ) {
>>         uniqueAsmPath.eraseFromDisk();
>>         return NULL;
>>     }
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> 





More information about the llvm-commits mailing list