]> granicus.if.org Git - clang/commitdiff
Use presumed location to get line number info.
authorDevang Patel <dpatel@apple.com>
Wed, 8 Apr 2009 19:47:04 +0000 (19:47 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 8 Apr 2009 19:47:04 +0000 (19:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68630 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 45ceb2b8e6813f23055718fa46241348343d663b..0d13299574b3337cb4619fd543f9b32fc1645785 100644 (file)
@@ -609,7 +609,7 @@ void CGDebugInfo::EmitFunctionStart(const char *Name, QualType ReturnType,
   // FIXME: Why is this using CurLoc???
   llvm::DICompileUnit Unit = getOrCreateCompileUnit(CurLoc);
   SourceManager &SM = M->getContext().getSourceManager();
-  unsigned LineNo = SM.getInstantiationLineNumber(CurLoc);
+  unsigned LineNo = SM.getPresumedLoc(CurLoc).getLine();
   
   llvm::DISubprogram SP =
     DebugFactory.CreateSubprogram(Unit, Name, Name, "", Unit, LineNo,
@@ -639,8 +639,8 @@ void CGDebugInfo::EmitStopPoint(llvm::Function *Fn, CGBuilderTy &Builder) {
 
   // Get the appropriate compile unit.
   llvm::DICompileUnit Unit = getOrCreateCompileUnit(CurLoc);
-  DebugFactory.InsertStopPoint(Unit, SM.getInstantiationLineNumber(CurLoc),
-                               SM.getInstantiationColumnNumber(CurLoc),
+  PresumedLoc PLoc = SM.getPresumedLoc(CurLoc);
+  DebugFactory.InsertStopPoint(Unit, PLoc.getLine(), PLoc.getColumn(),
                                Builder.GetInsertBlock()); 
 }