[llvm-commits] [llvm] r109302 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Devang Patel dpatel at apple.com
Mon Jul 26 10:57:29 PDT 2010


On Jul 26, 2010, at 10:05 AM, Chris Lattner wrote:

> Completely agreed.  With a compiler server (for example) the individual compiler instances and the backend may be running in completely different directories.

OK. I'll use another approach.
-
Devang
> 
> -Chris
> 
> On Jul 26, 2010, at 8:28 AM, Daniel Dunbar wrote:
> 
>> Hi Devang,
>> 
>> The backend should not be introducing dependencies on the current
>> working directory. This kind of stuff needs to be in the frontend.
>> 
>> - Daniel
>> 
>> On Fri, Jul 23, 2010 at 5:53 PM, Devang Patel <dpatel at apple.com> wrote:
>>> Author: dpatel
>>> Date: Fri Jul 23 19:53:22 2010
>>> New Revision: 109302
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=109302&view=rev
>>> Log:
>>> Use current working directory when Dirname is empty. This only happens when absolute source file path is used on compiler command line.
>>> 
>>> Modified:
>>>   llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
>>> 
>>> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=109302&r1=109301&r2=109302&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
>>> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Jul 23 19:53:22 2010
>>> @@ -1753,6 +1753,11 @@
>>> /// maps as well.
>>> unsigned DwarfDebug::GetOrCreateSourceID(StringRef DirName, StringRef FileName){
>>>  unsigned DId;
>>> +  if (DirName.empty()) {
>>> +    llvm::sys::Path CWD = llvm::sys::Path::GetCurrentDirectory();
>>> +    DirName = StringRef(CWD.c_str(), CWD.size());
>>> +  }
>>> +
>>>  StringMap<unsigned>::iterator DI = DirectoryIdMap.find(DirName);
>>>  if (DI != DirectoryIdMap.end()) {
>>>    DId = DI->getValue();
>>> 
>>> 
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>> 
>> 
>> _______________________________________________
>> 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