Do not use getNamedValue() to lookup NamedMDNode. NamedMDNode is not a GlobalValue.

Thanks Benjamin Kramer!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77619 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2009-07-30 18:46:29 +00:00
parent eeae0641bf
commit 76dd4e8941

View File

@ -293,7 +293,7 @@ GlobalAlias *Module::getNamedAlias(const StringRef &Name) const {
/// specified name. This method returns null if a MDNode with the specified
/// name is not found.
NamedMDNode *Module::getNamedMetadata(const StringRef &Name) const {
return dyn_cast_or_null<NamedMDNode>(getNamedValue(Name));
return dyn_cast_or_null<NamedMDNode>(getValueSymbolTable().lookup(Name));
}
//===----------------------------------------------------------------------===//