summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-03-20 00:26:26 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-03-20 00:26:26 +0000
commit200b6ed80fc8266cec4b262a6723ef1a96910f18 (patch)
treec67cc1d16857a2d37cc3d525d5a7ca528104ed28 /llvm/lib/IR/DebugInfo.cpp
parent35b13ece231bbd70cd5cfe7a3a1b931d74cef797 (diff)
downloadbcm5719-llvm-200b6ed80fc8266cec4b262a6723ef1a96910f18.tar.gz
bcm5719-llvm-200b6ed80fc8266cec4b262a6723ef1a96910f18.zip
Refactor the DIFile (2nd) parameter to DITypes to be an MDNode reference to a raw directory/file pair
This makes DIType's first non-tag parameter the same as DIFile's, allowing them to both share the common implementation of getFilename/getDirectory in DIScope. llvm-svn: 177467
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 1a5454e16fc..d1db3ab53af 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -539,6 +539,11 @@ bool DINameSpace::Verify() const {
return DbgNode->getNumOperands() == 5;
}
+/// \brief Retrieve the MDNode for the directory/file pair.
+MDNode *DIFile::getFileNode() const {
+ return const_cast<MDNode*>(getNodeField(DbgNode, 1));
+}
+
/// \brief Verify that the file descriptor is well formed.
bool DIFile::Verify() const {
return isFile() && DbgNode->getNumOperands() == 2;
@@ -669,8 +674,6 @@ StringRef DIScope::getFilename() const {
return DICompileUnit(DbgNode).getFilename();
if (isNameSpace())
return DINameSpace(DbgNode).getFilename();
- if (isType())
- return DIType(DbgNode).getFilename();
return ::getStringField(getNodeField(DbgNode, 1), 0);
}
@@ -687,8 +690,6 @@ StringRef DIScope::getDirectory() const {
return DICompileUnit(DbgNode).getDirectory();
if (isNameSpace())
return DINameSpace(DbgNode).getDirectory();
- if (isType())
- return DIType(DbgNode).getDirectory();
return ::getStringField(getNodeField(DbgNode, 1), 1);
}
OpenPOWER on IntegriCloud