llvm-6502/lib/Support/ValueHolder.cpp
John Criswell b576c94c15 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:43:21 +00:00

24 lines
991 B
C++

//===-- ValueHolder.cpp - Wrapper for Value implementation ----------------===//
//
// 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.
//
//===----------------------------------------------------------------------===//
//
// 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"
ValueHolder::ValueHolder(Value *V) : User(Type::TypeTy, Value::TypeVal) {
Operands.push_back(Use(V, this));
}