aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-09-01 00:53:21 +0000
committerDevang Patel <dpatel@apple.com>2009-09-01 00:53:21 +0000
commit58e7a2dfc2e0203abb5a4637bd0fcf9c1992fb95 (patch)
tree469aa3e7a10a0b5de942f8b63c973a4411c8c2ec /include
parent82dfc0cd8c3c2bf780a13cc35c1a8df7ad137477 (diff)
downloadexternal_llvm-58e7a2dfc2e0203abb5a4637bd0fcf9c1992fb95.zip
external_llvm-58e7a2dfc2e0203abb5a4637bd0fcf9c1992fb95.tar.gz
external_llvm-58e7a2dfc2e0203abb5a4637bd0fcf9c1992fb95.tar.bz2
Add getDirectory() and getFilename() interface to DIScope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80647 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/DebugInfo.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h
index 30cc099..f4783c0 100644
--- a/include/llvm/Analysis/DebugInfo.h
+++ b/include/llvm/Analysis/DebugInfo.h
@@ -128,6 +128,14 @@ namespace llvm {
if (DbgNode && !isScope())
DbgNode = 0;
}
+
+ virtual const std::string &getFilename(std::string &F) const {
+ return F;
+ }
+
+ virtual const std::string &getDirectory(std::string &D) const {
+ return D;
+ }
};
/// DICompileUnit - A wrapper for a compile unit.
@@ -382,6 +390,13 @@ namespace llvm {
unsigned isLocalToUnit() const { return getUnsignedField(9); }
unsigned isDefinition() const { return getUnsignedField(10); }
+ const std::string &getFilename(std::string &F) const {
+ return getCompileUnit().getFilename(F);
+ }
+ const std::string &getDirectory(std::string &F) const {
+ return getCompileUnit().getDirectory(F);
+ }
+
/// Verify - Verify that a subprogram descriptor is well formed.
bool Verify() const;
@@ -448,7 +463,16 @@ namespace llvm {
if (DbgNode && !isLexicalBlock())
DbgNode = 0;
}
- DIDescriptor getContext() const { return getDescriptorField(1); }
+ DIScope getContext() const { return getFieldAs<DIScope>(1); }
+
+ const std::string &getFilename(std::string &F) const {
+ return getContext().getFilename(F);
+ }
+ const std::string &getDirectory(std::string &D) const {
+ return getContext().getDirectory(D);
+ }
+
+
};
/// DIFactory - This object assists with the construction of the various