2003-08-23 19:43:16 +00:00
|
|
|
//===-- ValueHolder.cpp - Wrapper for Value implementation ----------------===//
|
2003-10-20 19:43:21 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2003-08-23 19:43:16 +00:00
|
|
|
//
|
|
|
|
// This class defines a simple subclass of User, which keeps a pointer to a
|
|
|
|
// Value, which automatically updates when Value::replaceAllUsesWith is called.
|
|
|
|
// This is useful when you have pointers to Value's in your pass, but the
|
|
|
|
// pointers get invalidated when some other portion of the algorithm is
|
|
|
|
// replacing Values with other Values.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "llvm/Support/ValueHolder.h"
|
|
|
|
#include "llvm/Type.h"
|
|
|
|
|
2003-12-14 21:35:53 +00:00
|
|
|
using namespace llvm;
|
2003-11-11 22:41:34 +00:00
|
|
|
|
2003-08-23 19:43:16 +00:00
|
|
|
ValueHolder::ValueHolder(Value *V) : User(Type::TypeTy, Value::TypeVal) {
|
|
|
|
Operands.push_back(Use(V, this));
|
|
|
|
}
|