[llvm-commits] [llvm] r61912 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
Devang Patel
dpatel at apple.com
Wed Jan 7 18:49:35 PST 2009
Author: dpatel
Date: Wed Jan 7 20:49:34 2009
New Revision: 61912
URL: http://llvm.org/viewvc/llvm-project?rev=61912&view=rev
Log:
Add APIs to record regions and variables.
Again, shamelessly copied from MMI.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=61912&r1=61911&r2=61912&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Wed Jan 7 20:49:34 2009
@@ -2540,6 +2540,33 @@
}
+ /// RecordRegionStart - Indicate the start of a region.
+ ///
+ unsigned RecordRegionStart(GlobalVariable *V) {
+ DbgScope *Scope = getOrCreateScope(V);
+ unsigned ID = NextLabelID();
+ if (!Scope->getStartLabelID()) Scope->setStartLabelID(ID);
+ return ID;
+ }
+
+ /// RecordRegionEnd - Indicate the end of a region.
+ ///
+ unsigned RecordRegionEnd(GlobalVariable *V) {
+ DbgScope *Scope = getOrCreateScope(V);
+ unsigned ID = NextLabelID();
+ Scope->setEndLabelID(ID);
+ return ID;
+ }
+
+ /// RecordVariable - Indicate the declaration of a local variable.
+ ///
+ void RecordVariable(GlobalVariable *GV, unsigned FrameIndex) {
+ DbgScope *Scope = getOrCreateScope(GV);
+ DIVariable *VD = new DIVariable(GV);
+ DbgVariable *DV = new DbgVariable(VD, FrameIndex);
+ Scope->AddVariable(DV);
+ }
+
/// getOrCreateScope - Returns the scope associated with the given descriptor.
///
DbgScope *getOrCreateScope(GlobalVariable *V) {
More information about the llvm-commits
mailing list