[cfe-commits] r98021 - in /cfe/trunk/lib/CodeGen: CGDebugInfo.cpp CGDebugInfo.h

Benjamin Kramer benny.kra at googlemail.com
Fri Mar 12 12:25:10 PST 2010


On 12.03.2010, at 20:23, Devang Patel wrote:

> 
> On Mar 12, 2010, at 11:18 AM, Benjamin Kramer wrote:
> 
>> 
>> On 09.03.2010, at 01:44, Devang Patel wrote:
>> 
>>> Author: dpatel
>>> Date: Mon Mar  8 18:44:50 2010
>>> New Revision: 98021
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=98021&view=rev
>>> Log:
>>> Start using DIFile. Corresponding llvm patch is r98020.
>>> 
>>> Modified:
>>>  cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>>>  cfe/trunk/lib/CodeGen/CGDebugInfo.h
>>> 
>>> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=98021&r1=98020&r2=98021&view=diff
>> […]
>>> +/// CreateCompileUnit - Create new compile unit.
>>> +void CGDebugInfo::CreateCompileUnit() {
>>> 
>>> // Get absolute path name.
>>> -  llvm::sys::Path AbsFileName(FileName);
>>> +  llvm::sys::Path AbsFileName(CGM.getCodeGenOpts().MainFileName);
>>> AbsFileName.makeAbsolute();
>> 
>> Hi Devang,
>> 
>> I investigated the MSVC test failures and the culprit seems to be an empty MainFileName.
>> Our win32 implementation of makeAbsolute crashes if the path is empty.
> 
> Aha... 
> makeAbsolute should not crash. Meanwhile, would it be possible for you to try a simple patch to use "<unknown>" is main file name if MainFileName is empty ?

Sorry, I don't have access to a windows box which is able to build llvm at the moment (found the problem by inspection & debug printfs). The output is weird on unix too: makeAbsolute with an empty path returns the current workdir so we end up with a wrong filename.

I'm quite confident that using "<unknown>" will pacify the buildbot. You could just commit it and let the bot chew on it. I have no idea if that solution is correct from a DWARF perspective, though.





More information about the cfe-commits mailing list