mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177467 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user