aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-01-08 02:49:34 +0000
committerDevang Patel <dpatel@apple.com>2009-01-08 02:49:34 +0000
commit100ca32730f4e25dbd8ea989a660f7dbda0c06ee (patch)
tree188057f3e72ecfc1549e222b68987cae580d93e8 /lib/CodeGen
parent4d1709e8c65aaaa96eb30db18a6cf27caedadd73 (diff)
downloadexternal_llvm-100ca32730f4e25dbd8ea989a660f7dbda0c06ee.zip
external_llvm-100ca32730f4e25dbd8ea989a660f7dbda0c06ee.tar.gz
external_llvm-100ca32730f4e25dbd8ea989a660f7dbda0c06ee.tar.bz2
Add APIs to record regions and variables.
Again, shamelessly copied from MMI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61912 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfWriter.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
index a53874d..c1360a9 100644
--- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
@@ -2540,6 +2540,33 @@ private:
}
+ /// 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) {