[llvm-commits] [llvm] r80647 - /llvm/trunk/include/llvm/Analysis/DebugInfo.h
Devang Patel
dpatel at apple.com
Mon Aug 31 17:53:22 PDT 2009
Author: dpatel
Date: Mon Aug 31 19:53:21 2009
New Revision: 80647
URL: http://llvm.org/viewvc/llvm-project?rev=80647&view=rev
Log:
Add getDirectory() and getFilename() interface to DIScope.
Modified:
llvm/trunk/include/llvm/Analysis/DebugInfo.h
Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=80647&r1=80646&r2=80647&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Mon Aug 31 19:53:21 2009
@@ -128,6 +128,14 @@
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 @@
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 @@
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
More information about the llvm-commits
mailing list