mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-15 07:39:31 +00:00
Use single interface, using twine, to get named metadata.
getNamedMetadata(). llvm-svn: 106518
This commit is contained in:
parent
a1ebf91a39
commit
f50b6147ad
@ -325,8 +325,7 @@ public:
|
||||
/// getNamedMetadata - Return the first NamedMDNode in the module with the
|
||||
/// specified name. This method returns null if a NamedMDNode with the
|
||||
/// specified name is not found.
|
||||
NamedMDNode *getNamedMetadata(StringRef Name) const;
|
||||
NamedMDNode *getNamedMetadataUsingTwine(Twine Name) const;
|
||||
NamedMDNode *getNamedMetadata(const Twine &Name) const;
|
||||
|
||||
/// getOrInsertNamedMetadata - Return the first named MDNode in the module
|
||||
/// with the specified name. This method returns a new NamedMDNode if a
|
||||
|
@ -1062,8 +1062,7 @@ DIVariable DIFactory::CreateVariable(unsigned Tag, DIDescriptor Context,
|
||||
char One = '\1';
|
||||
if (FName.startswith(StringRef(&One, 1)))
|
||||
FName = FName.substr(1);
|
||||
NamedMDNode *FnLocals =
|
||||
M.getNamedMetadataUsingTwine(Twine("llvm.dbg.lv.", FName));
|
||||
NamedMDNode *FnLocals = M.getNamedMetadata(Twine("llvm.dbg.lv.", FName));
|
||||
if (!FnLocals)
|
||||
FnLocals = NamedMDNode::Create(VMContext, Twine("llvm.dbg.lv.", FName),
|
||||
NULL, 0, &M);
|
||||
|
@ -2260,8 +2260,8 @@ void DwarfDebug::collectVariableInfo(const MachineFunction *MF) {
|
||||
const Function *F = MF->getFunction();
|
||||
const Module *M = F->getParent();
|
||||
if (NamedMDNode *NMD =
|
||||
M->getNamedMetadataUsingTwine(Twine("llvm.dbg.lv.",
|
||||
getRealLinkageName(F->getName())))) {
|
||||
M->getNamedMetadata(Twine("llvm.dbg.lv.",
|
||||
getRealLinkageName(F->getName())))) {
|
||||
for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) {
|
||||
DIVariable DV(cast_or_null<MDNode>(NMD->getOperand(i)));
|
||||
if (!DV || !Processed.insert(DV))
|
||||
|
@ -313,11 +313,7 @@ GlobalAlias *Module::getNamedAlias(StringRef Name) const {
|
||||
/// getNamedMetadata - Return the first NamedMDNode in the module with the
|
||||
/// specified name. This method returns null if a NamedMDNode with the
|
||||
/// specified name is not found.
|
||||
NamedMDNode *Module::getNamedMetadata(StringRef Name) const {
|
||||
return NamedMDSymTab->lookup(Name);
|
||||
}
|
||||
|
||||
NamedMDNode *Module::getNamedMetadataUsingTwine(Twine Name) const {
|
||||
NamedMDNode *Module::getNamedMetadata(const Twine &Name) const {
|
||||
SmallString<256> NameData;
|
||||
StringRef NameRef = Name.toStringRef(NameData);
|
||||
return NamedMDSymTab->lookup(NameRef);
|
||||
|
Loading…
Reference in New Issue
Block a user