[llvm-branch-commits] [llvm-branch] r96494 - in /llvm/branches/Apple/Hermes: include/llvm/Analysis/DebugInfo.h lib/Analysis/DebugInfo.cpp lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Devang Patel dpatel at apple.com
Wed Feb 17 10:56:40 PST 2010


Author: dpatel
Date: Wed Feb 17 12:56:39 2010
New Revision: 96494

URL: http://llvm.org/viewvc/llvm-project?rev=96494&view=rev
Log:
Merge from mainline.
$ svn merge -c 96395 https://llvm.org/svn/llvm-project/llvm/trunk
$ svn merge -c 96445 https://llvm.org/svn/llvm-project/llvm/trunk


Modified:
    llvm/branches/Apple/Hermes/include/llvm/Analysis/DebugInfo.h
    llvm/branches/Apple/Hermes/lib/Analysis/DebugInfo.cpp
    llvm/branches/Apple/Hermes/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/branches/Apple/Hermes/include/llvm/Analysis/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Hermes/include/llvm/Analysis/DebugInfo.h?rev=96494&r1=96493&r2=96494&view=diff

==============================================================================
--- llvm/branches/Apple/Hermes/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/branches/Apple/Hermes/include/llvm/Analysis/DebugInfo.h Wed Feb 17 12:56:39 2010
@@ -459,9 +459,11 @@
       if (DbgNode && !isLexicalBlock())
         DbgNode = 0;
     }
-    DIScope getContext() const       { return getFieldAs<DIScope>(1); }
-    StringRef getDirectory() const { return getContext().getDirectory(); }
-    StringRef getFilename() const  { return getContext().getFilename(); }
+    DIScope getContext() const       { return getFieldAs<DIScope>(1);      }
+    StringRef getDirectory() const   { return getContext().getDirectory(); }
+    StringRef getFilename() const    { return getContext().getFilename();  }
+    unsigned getLineNumber() const   { return getUnsignedField(2);         }
+    unsigned getColumnNumber() const { return getUnsignedField(3);         }
   };
 
   /// DINameSpace - A wrapper for a C++ style name space.
@@ -636,7 +638,8 @@
 
     /// CreateLexicalBlock - This creates a descriptor for a lexical block
     /// with the specified parent context.
-    DILexicalBlock CreateLexicalBlock(DIDescriptor Context);
+    DILexicalBlock CreateLexicalBlock(DIDescriptor Context, unsigned Line = 0,
+                                      unsigned Col = 0);
 
     /// CreateNameSpace - This creates new descriptor for a namespace
     /// with the specified parent context.

Modified: llvm/branches/Apple/Hermes/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Hermes/lib/Analysis/DebugInfo.cpp?rev=96494&r1=96493&r2=96494&view=diff

==============================================================================
--- llvm/branches/Apple/Hermes/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/branches/Apple/Hermes/lib/Analysis/DebugInfo.cpp Wed Feb 17 12:56:39 2010
@@ -1007,12 +1007,15 @@
 
 /// CreateBlock - This creates a descriptor for a lexical block with the
 /// specified parent VMContext.
-DILexicalBlock DIFactory::CreateLexicalBlock(DIDescriptor Context) {
+DILexicalBlock DIFactory::CreateLexicalBlock(DIDescriptor Context,
+                                             unsigned LineNo, unsigned Col) {
   Value *Elts[] = {
     GetTagConstant(dwarf::DW_TAG_lexical_block),
-    Context.getNode()
+    Context.getNode(),
+    ConstantInt::get(Type::getInt32Ty(VMContext), LineNo),
+    ConstantInt::get(Type::getInt32Ty(VMContext), Col)
   };
-  return DILexicalBlock(MDNode::get(VMContext, &Elts[0], 2));
+  return DILexicalBlock(MDNode::get(VMContext, &Elts[0], 4));
 }
 
 /// CreateNameSpace - This creates new descriptor for a namespace

Modified: llvm/branches/Apple/Hermes/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Hermes/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=96494&r1=96493&r2=96494&view=diff

==============================================================================
--- llvm/branches/Apple/Hermes/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/branches/Apple/Hermes/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Feb 17 12:56:39 2010
@@ -238,7 +238,17 @@
         LIndex = DSI;
       }
     }
-    setLastInsn(LastInsn);
+    unsigned CurrentLastInsnIndex = 0;
+    if (const MachineInstr *CL = getLastInsn()) 
+      CurrentLastInsnIndex = MIIndexMap[CL];
+    unsigned FIndex = MIIndexMap[getFirstInsn()];
+
+    // Set LastInsn as the last instruction for this scope only if
+    // it follows 
+    //  1) this scope's first instruction and
+    //  2) current last instruction for this scope, if any.
+    if (LIndex >= CurrentLastInsnIndex && LIndex >= FIndex)
+      setLastInsn(LastInsn);
   }
 
 #ifndef NDEBUG





More information about the llvm-branch-commits mailing list