summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-05-29 11:08:17 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-05-29 11:08:17 +0000
commitb65ff27f53cb81269bb4d38d406cd850b03789a7 (patch)
tree67372c7dffa6305c73547882368377920e0ab3e6 /clang/lib/CodeGen
parentd72a9624a1009d3a0ca0a50a318c26193cc444cc (diff)
downloadbcm5719-llvm-b65ff27f53cb81269bb4d38d406cd850b03789a7.tar.gz
bcm5719-llvm-b65ff27f53cb81269bb4d38d406cd850b03789a7.zip
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
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp7
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index e7033969798..1827fc980c3 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -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;
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index 9ac77a4b0d9..4e6626fc4d9 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -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.
OpenPOWER on IntegriCloud