]> granicus.if.org Git - clang/commitdiff
A couple minor fixes to make debug info usable for arbitrary code: don't
authorEli Friedman <eli.friedman@gmail.com>
Thu, 29 May 2008 11:08:17 +0000 (11:08 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 29 May 2008 11:08:17 +0000 (11:08 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51675 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGDebugInfo.h

index e7033969798efa2e6277a8235804de6f86fca683..1827fc980c3dff651b7542bef4a7db4e2faeb7d5 100644 (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;
 
index 9ac77a4b0d9658efb94073d81b4e0c0bf9e8ff17..4e6626fc4d9269afecc40cc3d4be114113c576c1 100644 (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.