Make NamedMDNode not be a subclass of Value, and simplify the interface

for creating and populating NamedMDNodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109061 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2010-07-21 23:38:33 +00:00
parent fcbd1a749f
commit 17aa92c92a
19 changed files with 97 additions and 273 deletions
+5 -5
View File
@@ -13,7 +13,6 @@
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/DebugInfo.h"
#include "llvm/Target/TargetMachine.h" // FIXME: LAYERING VIOLATION!
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Intrinsics.h"
@@ -22,6 +21,7 @@
#include "llvm/Module.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Dwarf.h"
#include "llvm/Support/raw_ostream.h"
@@ -1072,10 +1072,10 @@ DIVariable DIFactory::CreateVariable(unsigned Tag, DIDescriptor Context,
char One = '\1';
if (FName.startswith(StringRef(&One, 1)))
FName = FName.substr(1);
NamedMDNode *FnLocals = M.getNamedMetadata(Twine("llvm.dbg.lv.", FName));
if (!FnLocals)
FnLocals = NamedMDNode::Create(VMContext, Twine("llvm.dbg.lv.", FName),
NULL, 0, &M);
SmallString<32> Out;
NamedMDNode *FnLocals =
M.getOrInsertNamedMetadata(Twine("llvm.dbg.lv.", FName).toStringRef(Out));
FnLocals->addOperand(Node);
}
return DIVariable(Node);