A couple minor fixes to make debug info usable for arbitrary code: don't

emit incomplete types, because they crash llc, and always use the 
logical location as the current location so we don't crash doing invalid 
queries on CurLoc.

llvm-svn: 51675
This commit is contained in:
Eli Friedman 2008-05-29 11:08:17 +00:00
parent d72a9624a1
commit b65ff27f53
2 changed files with 8 additions and 1 deletions

View File

@ -77,6 +77,11 @@ CGDebugInfo::~CGDebugInfo()
delete SubprogramAnchor;
}
void CGDebugInfo::setLocation(SourceLocation loc)
{
SourceManager &SM = M->getContext().getSourceManager();
CurLoc = SM.getLogicalLoc(loc);
}
/// getCastValueFor - Return a llvm representation for a given debug information
/// descriptor cast to an empty struct pointer.
@ -339,6 +344,8 @@ CGDebugInfo::getOrCreateFunctionType(QualType type, llvm::CompileUnitDesc *Unit)
llvm::TypeDesc *
CGDebugInfo::getOrCreateType(QualType type, llvm::CompileUnitDesc *Unit)
{
// TODO: Re-enable once we can generate all types
return 0;
if (type.isNull())
return NULL;

View File

@ -80,7 +80,7 @@ public:
CGDebugInfo(CodeGenModule *m);
~CGDebugInfo();
void setLocation(SourceLocation loc) { CurLoc = loc; }
void setLocation(SourceLocation loc);
/// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of
/// source line.