IR: Prune arguments to ValueAsMetadata::ValueAsMetadata()

`LLVMContext` isn't actually used.

llvm-svn: 225200
This commit is contained in:
Duncan P. N. Exon Smith 2015-01-05 20:41:25 +00:00
parent 9a85ae53a7
commit 6bcaa2e7bc
2 changed files with 7 additions and 7 deletions

View File

@ -186,7 +186,7 @@ class ValueAsMetadata : public Metadata, ReplaceableMetadataImpl {
Value *V;
protected:
ValueAsMetadata(LLVMContext &Context, unsigned ID, Value *V)
ValueAsMetadata(unsigned ID, Value *V)
: Metadata(ID), V(V) {
assert(V && "Expected valid value");
}
@ -236,8 +236,8 @@ public:
class ConstantAsMetadata : public ValueAsMetadata {
friend class ValueAsMetadata;
ConstantAsMetadata(LLVMContext &Context, Constant *C)
: ValueAsMetadata(Context, ConstantAsMetadataKind, C) {}
ConstantAsMetadata(Constant *C)
: ValueAsMetadata(ConstantAsMetadataKind, C) {}
public:
static ConstantAsMetadata *get(Constant *C) {
@ -259,8 +259,8 @@ public:
class LocalAsMetadata : public ValueAsMetadata {
friend class ValueAsMetadata;
LocalAsMetadata(LLVMContext &Context, Value *Local)
: ValueAsMetadata(Context, LocalAsMetadataKind, Local) {
LocalAsMetadata(Value *Local)
: ValueAsMetadata(LocalAsMetadataKind, Local) {
assert(!isa<Constant>(Local) && "Expected local value");
}

View File

@ -255,9 +255,9 @@ ValueAsMetadata *ValueAsMetadata::get(Value *V) {
"Expected this to be the only metadata use");
V->NameAndIsUsedByMD.setInt(true);
if (auto *C = dyn_cast<Constant>(V))
Entry = new ConstantAsMetadata(Context, C);
Entry = new ConstantAsMetadata(C);
else
Entry = new LocalAsMetadata(Context, V);
Entry = new LocalAsMetadata(V);
}
return Entry;