[cfe-commits] r70991 - /cfe/branches/Apple/Dib/lib/CodeGen/CGDebugInfo.cpp

Mike Stump mrs at apple.com
Tue May 5 11:47:37 PDT 2009


Author: mrs
Date: Tue May  5 13:47:33 2009
New Revision: 70991

URL: http://llvm.org/viewvc/llvm-project?rev=70991&view=rev
Log:
Revert 70982.

Modified:
    cfe/branches/Apple/Dib/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/branches/Apple/Dib/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/lib/CodeGen/CGDebugInfo.cpp?rev=70991&r1=70990&r2=70991&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/branches/Apple/Dib/lib/CodeGen/CGDebugInfo.cpp Tue May  5 13:47:33 2009
@@ -742,23 +742,17 @@
   if (CO.OptimizationLevel)
     return;
 
-  llvm::DICompileUnit Unit = getOrCreateCompileUnit(Decl->getLocation());
-  llvm::DIType Ty = getOrCreateType(Decl->getType(), Unit);
-
   // Get location information.
   SourceManager &SM = M->getContext().getSourceManager();
   PresumedLoc PLoc = SM.getPresumedLoc(Decl->getLocation());
-  unsigned Line = 0;
-  if (!PLoc.isInvalid())
-    Line = PLoc.getLine();
-  else
-    Unit = llvm::DICompileUnit();
-
+  unsigned Line = PLoc.isInvalid() ? 0 : PLoc.getLine();
+  llvm::DICompileUnit Unit = getOrCreateCompileUnit(Decl->getLocation());
   
   // Create the descriptor for the variable.
   llvm::DIVariable D = 
     DebugFactory.CreateVariable(Tag, RegionStack.back(),Decl->getNameAsString(),
-                                Unit, Line, Ty);
+                                Unit, Line,
+                                getOrCreateType(Decl->getType(), Unit));
   // Insert an llvm.dbg.declare into the current block.
   DebugFactory.InsertDeclare(Storage, D, Builder.GetInsertBlock());
 }





More information about the cfe-commits mailing list