mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-18 13:34:04 +00:00
Split ConstantVals.h into Constant.h and Constants.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2378 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9ae93cdcc8
commit
31bcdb822f
47
include/llvm/Constant.h
Normal file
47
include/llvm/Constant.h
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
//===-- llvm/Constant.h - Constant class definition --------------*- C++ -*--=//
|
||||||
|
//
|
||||||
|
// This file contains the declaration of the Constant class.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#ifndef LLVM_CONSTANT_H
|
||||||
|
#define LLVM_CONSTANT_H
|
||||||
|
|
||||||
|
#include "llvm/User.h"
|
||||||
|
|
||||||
|
class Constant : public User {
|
||||||
|
protected:
|
||||||
|
inline Constant(const Type *Ty) : User(Ty, Value::ConstantVal) {}
|
||||||
|
~Constant() {}
|
||||||
|
|
||||||
|
// destroyConstant - Called if some element of this constant is no longer
|
||||||
|
// valid. At this point only other constants may be on the use_list for this
|
||||||
|
// constant. Any constants on our Use list must also be destroy'd. The
|
||||||
|
// implementation must be sure to remove the constant from the list of
|
||||||
|
// available cached constants. Implementations should call
|
||||||
|
// destroyConstantImpl as the last thing they do, to destroy all users and
|
||||||
|
// delete this.
|
||||||
|
//
|
||||||
|
virtual void destroyConstant() { assert(0 && "Not reached!"); }
|
||||||
|
void destroyConstantImpl();
|
||||||
|
public:
|
||||||
|
// Specialize setName to handle symbol table majik...
|
||||||
|
virtual void setName(const std::string &name, SymbolTable *ST = 0);
|
||||||
|
|
||||||
|
// Static constructor to get a '0' constant of arbitrary type...
|
||||||
|
static Constant *getNullValue(const Type *Ty);
|
||||||
|
|
||||||
|
// isNullValue - Return true if this is the value that would be returned by
|
||||||
|
// getNullValue.
|
||||||
|
virtual bool isNullValue() const = 0;
|
||||||
|
|
||||||
|
virtual void print(std::ostream &O) const;
|
||||||
|
|
||||||
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||||
|
static inline bool classof(const Constant *) { return true; }
|
||||||
|
static inline bool classof(const Value *V) {
|
||||||
|
return V->getValueType() == Value::ConstantVal;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -33,7 +33,7 @@
|
|||||||
#ifndef LLVM_CONSTANTHANDLING_H
|
#ifndef LLVM_CONSTANTHANDLING_H
|
||||||
#define LLVM_CONSTANTHANDLING_H
|
#define LLVM_CONSTANTHANDLING_H
|
||||||
|
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Instruction.h"
|
#include "llvm/Instruction.h"
|
||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
class PointerType;
|
class PointerType;
|
||||||
|
@ -1,65 +1,20 @@
|
|||||||
//===-- llvm/ConstantVals.h - Constant Value nodes ---------------*- C++ -*--=//
|
//===-- llvm/Constants.h - Constant class subclass definitions ---*- C++ -*--=//
|
||||||
//
|
//
|
||||||
// This file contains the declarations for the Constant class and all of
|
// This file contains the declarations for the subclasses of Constant, which
|
||||||
// its subclasses, which represent the different type of constant pool values
|
// represent the different type of constant pool values
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#ifndef LLVM_CONSTANT_VALS_H
|
#ifndef LLVM_CONSTANTS_H
|
||||||
#define LLVM_CONSTANT_VALS_H
|
#define LLVM_CONSTANTS_H
|
||||||
|
|
||||||
#include "llvm/User.h"
|
#include "llvm/Constant.h"
|
||||||
#include "Support/DataTypes.h"
|
#include "Support/DataTypes.h"
|
||||||
|
|
||||||
class ArrayType;
|
class ArrayType;
|
||||||
class StructType;
|
class StructType;
|
||||||
class PointerType;
|
class PointerType;
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
// Constant Class
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
|
|
||||||
class Constant : public User {
|
|
||||||
protected:
|
|
||||||
inline Constant(const Type *Ty) : User(Ty, Value::ConstantVal) {}
|
|
||||||
~Constant() {}
|
|
||||||
|
|
||||||
// destroyConstant - Called if some element of this constant is no longer
|
|
||||||
// valid. At this point only other constants may be on the use_list for this
|
|
||||||
// constant. Any constants on our Use list must also be destroy'd. The
|
|
||||||
// implementation must be sure to remove the constant from the list of
|
|
||||||
// available cached constants. Implementations should call
|
|
||||||
// destroyConstantImpl as the last thing they do, to destroy all users and
|
|
||||||
// delete this.
|
|
||||||
//
|
|
||||||
virtual void destroyConstant() { assert(0 && "Not reached!"); }
|
|
||||||
void destroyConstantImpl();
|
|
||||||
public:
|
|
||||||
// Specialize setName to handle symbol table majik...
|
|
||||||
virtual void setName(const std::string &name, SymbolTable *ST = 0);
|
|
||||||
|
|
||||||
// Static constructor to get a '0' constant of arbitrary type...
|
|
||||||
static Constant *getNullValue(const Type *Ty);
|
|
||||||
|
|
||||||
// isNullValue - Return true if this is the value that would be returned by
|
|
||||||
// getNullValue.
|
|
||||||
virtual bool isNullValue() const = 0;
|
|
||||||
|
|
||||||
virtual void print(std::ostream &O) const;
|
|
||||||
|
|
||||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
||||||
static inline bool classof(const Constant *) { return true; }
|
|
||||||
static inline bool classof(const Value *V) {
|
|
||||||
return V->getValueType() == Value::ConstantVal;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
// Classes to represent constant pool variable defs
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
|
|
||||||
//===---------------------------------------------------------------------------
|
//===---------------------------------------------------------------------------
|
||||||
// ConstantBool - Boolean Values
|
// ConstantBool - Boolean Values
|
||||||
//
|
//
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/InstrTypes.h"
|
#include "llvm/InstrTypes.h"
|
||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
|
|
||||||
using analysis::ExprType;
|
using analysis::ExprType;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "llvm/InstrTypes.h"
|
#include "llvm/InstrTypes.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "ReaderInternals.h"
|
#include "ReaderInternals.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/GlobalVariable.h"
|
#include "llvm/GlobalVariable.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "llvm/GlobalVariable.h"
|
#include "llvm/GlobalVariable.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/Argument.h"
|
#include "llvm/Argument.h"
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "WriterInternals.h"
|
#include "WriterInternals.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/SymbolTable.h"
|
#include "llvm/SymbolTable.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
#include "llvm/GlobalVariable.h"
|
#include "llvm/GlobalVariable.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/ConstantVals.h"
|
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
|
#include "llvm/Constant.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/SymbolTable.h"
|
#include "llvm/SymbolTable.h"
|
||||||
#include "llvm/Argument.h"
|
#include "llvm/Argument.h"
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include "llvm/GlobalVariable.h"
|
#include "llvm/GlobalVariable.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/ConstantVals.h"
|
|
||||||
#include "llvm/SymbolTable.h"
|
#include "llvm/SymbolTable.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
@ -78,8 +77,8 @@ void BytecodeWriter::outputConstants(bool isFunction) {
|
|||||||
|
|
||||||
unsigned NC = ValNo; // Number of constants
|
unsigned NC = ValNo; // Number of constants
|
||||||
for (; NC < Plane.size() &&
|
for (; NC < Plane.size() &&
|
||||||
(isa<Constant>(Plane[NC]) ||
|
(isa<Constant>(Plane[NC]) || isa<Type>(Plane[NC])); NC++)
|
||||||
isa<Type>(Plane[NC])); NC++) /*empty*/;
|
/*empty*/;
|
||||||
NC -= ValNo; // Convert from index into count
|
NC -= ValNo; // Convert from index into count
|
||||||
if (NC == 0) continue; // Skip empty type planes...
|
if (NC == 0) continue; // Skip empty type planes...
|
||||||
|
|
||||||
@ -125,7 +124,7 @@ void BytecodeWriter::outputModuleInfoBlock(const Module *M) {
|
|||||||
|
|
||||||
// If we have an initializer, output it now.
|
// If we have an initializer, output it now.
|
||||||
if (GV->hasInitializer()) {
|
if (GV->hasInitializer()) {
|
||||||
Slot = Table.getValSlot(GV->getInitializer());
|
Slot = Table.getValSlot((Value*)GV->getInitializer());
|
||||||
assert(Slot != -1 && "No slot for global var initializer!");
|
assert(Slot != -1 && "No slot for global var initializer!");
|
||||||
output_vbr((unsigned)Slot, Out);
|
output_vbr((unsigned)Slot, Out);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constant.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/CodeGen/MachineInstr.h"
|
#include "llvm/CodeGen/MachineInstr.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "llvm/CodeGen/InstrForest.h"
|
#include "llvm/CodeGen/InstrForest.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/Target/MachineRegInfo.h"
|
#include "llvm/Target/MachineRegInfo.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Assembly/Writer.h"
|
#include "llvm/Assembly/Writer.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/GlobalVariable.h"
|
#include "llvm/GlobalVariable.h"
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "llvm/SymbolTable.h"
|
#include "llvm/SymbolTable.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Argument.h"
|
#include "llvm/Argument.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constant.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/CodeGen/MachineInstr.h"
|
#include "llvm/CodeGen/MachineInstr.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "llvm/CodeGen/InstrForest.h"
|
#include "llvm/CodeGen/InstrForest.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/Target/MachineRegInfo.h"
|
#include "llvm/Target/MachineRegInfo.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include "llvm/CodeGen/MachineInstr.h"
|
#include "llvm/CodeGen/MachineInstr.h"
|
||||||
#include "llvm/CodeGen/MachineCodeForMethod.h"
|
#include "llvm/CodeGen/MachineCodeForMethod.h"
|
||||||
#include "llvm/GlobalVariable.h"
|
#include "llvm/GlobalVariable.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/Annotation.h"
|
#include "llvm/Annotation.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
@ -307,13 +307,13 @@ SparcFunctionAsmPrinter::printOneOperand(const MachineOperand &op)
|
|||||||
const Value *Val = op.getVRegValue();
|
const Value *Val = op.getVRegValue();
|
||||||
if (!Val)
|
if (!Val)
|
||||||
toAsm << "\t<*NULL Value*>";
|
toAsm << "\t<*NULL Value*>";
|
||||||
else if (const BasicBlock *BB = dyn_cast<const BasicBlock>(Val))
|
else if (const BasicBlock *BB = dyn_cast<BasicBlock>(Val))
|
||||||
toAsm << getID(BB);
|
toAsm << getID(BB);
|
||||||
else if (const Function *M = dyn_cast<const Function>(Val))
|
else if (const Function *M = dyn_cast<Function>(Val))
|
||||||
toAsm << getID(M);
|
toAsm << getID(M);
|
||||||
else if (const GlobalVariable *GV=dyn_cast<const GlobalVariable>(Val))
|
else if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(Val))
|
||||||
toAsm << getID(GV);
|
toAsm << getID(GV);
|
||||||
else if (const Constant *CV = dyn_cast<const Constant>(Val))
|
else if (const Constant *CV = dyn_cast<Constant>(Val))
|
||||||
toAsm << getID(CV);
|
toAsm << getID(CV);
|
||||||
else
|
else
|
||||||
toAsm << "<unknown value=" << Val << ">";
|
toAsm << "<unknown value=" << Val << ">";
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "llvm/CodeGen/MachineInstr.h"
|
#include "llvm/CodeGen/MachineInstr.h"
|
||||||
#include "llvm/CodeGen/MachineCodeForMethod.h"
|
#include "llvm/CodeGen/MachineCodeForMethod.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "Support/MathExtras.h"
|
#include "Support/MathExtras.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
|
|
||||||
static inline void getTypeInfo(const Type *Ty, const TargetData *TD,
|
static inline void getTypeInfo(const Type *Ty, const TargetData *TD,
|
||||||
unsigned &Size, unsigned char &Alignment);
|
unsigned &Size, unsigned char &Alignment);
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/ConstantHandling.h"
|
#include "llvm/ConstantHandling.h"
|
||||||
#include "llvm/Transforms/Scalar/DCE.h"
|
#include "llvm/Transforms/Scalar/DCE.h"
|
||||||
#include "llvm/Analysis/Expressions.h"
|
#include "llvm/Analysis/Expressions.h"
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/Argument.h"
|
#include "llvm/Argument.h"
|
||||||
|
#include "llvm/Constants.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
using std::map;
|
using std::map;
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/Support/InstVisitor.h"
|
#include "llvm/Support/InstVisitor.h"
|
||||||
#include "llvm/Argument.h"
|
#include "llvm/Argument.h"
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "Graph.h"
|
#include "Graph.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include "llvm/Transforms/Instrumentation/TraceValues.h"
|
#include "llvm/Transforms/Instrumentation/TraceValues.h"
|
||||||
#include "llvm/GlobalVariable.h"
|
#include "llvm/GlobalVariable.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/ConstantHandling.h"
|
#include "llvm/ConstantHandling.h"
|
||||||
#include "llvm/Transforms/Scalar/DCE.h"
|
#include "llvm/Transforms/Scalar/DCE.h"
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/ConstantVals.h"
|
|
||||||
|
|
||||||
inline static bool
|
inline static bool
|
||||||
ConstantFoldUnaryInst(BasicBlock *BB, BasicBlock::iterator &II,
|
ConstantFoldUnaryInst(BasicBlock *BB, BasicBlock::iterator &II,
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constant.h"
|
||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/Transforms/Scalar/DecomposeMultiDimRefs.h"
|
#include "llvm/Transforms/Scalar/DecomposeMultiDimRefs.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/Transforms/Scalar/InductionVars.h"
|
#include "llvm/Transforms/Scalar/InductionVars.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Analysis/IntervalPartition.h"
|
#include "llvm/Analysis/IntervalPartition.h"
|
||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "llvm/ConstantHandling.h"
|
#include "llvm/ConstantHandling.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#include "TransformInternals.h"
|
#include "TransformInternals.h"
|
||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
#include "llvm/ConstantVals.h"
|
|
||||||
#include "llvm/Analysis/Expressions.h"
|
#include "llvm/Analysis/Expressions.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include "llvm/Instruction.h"
|
#include "llvm/Instruction.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "llvm/SymbolTable.h"
|
#include "llvm/SymbolTable.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Argument.h"
|
#include "llvm/Argument.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "TransformInternals.h"
|
#include "TransformInternals.h"
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constant.h"
|
||||||
|
|
||||||
using std::vector;
|
using std::vector;
|
||||||
using std::map;
|
using std::map;
|
||||||
@ -79,7 +79,7 @@ static inline bool isSafeAlloca(const AllocaInst *AI) {
|
|||||||
if (MAI->hasIndices()) { // indexed?
|
if (MAI->hasIndices()) { // indexed?
|
||||||
// Allow the access if there is only one index and the index is
|
// Allow the access if there is only one index and the index is
|
||||||
// zero.
|
// zero.
|
||||||
if (*MAI->idx_begin() != ConstantUInt::get(Type::UIntTy, 0) ||
|
if (*MAI->idx_begin() != Constant::getNullValue(Type::UIntTy) ||
|
||||||
MAI->idx_begin()+1 != MAI->idx_end())
|
MAI->idx_begin()+1 != MAI->idx_end())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/GlobalVariable.h"
|
#include "llvm/GlobalVariable.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
|
@ -76,7 +76,7 @@ void BasicBlock::dropAllReferences() {
|
|||||||
//
|
//
|
||||||
bool BasicBlock::hasConstantReferences() const {
|
bool BasicBlock::hasConstantReferences() const {
|
||||||
for (use_const_iterator I = use_begin(), E = use_end(); I != E; ++I)
|
for (use_const_iterator I = use_begin(), E = use_end(); I != E; ++I)
|
||||||
if (::isa<Constant>(*I))
|
if (::isa<Constant>((Value*)*I))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#ifndef LLVM_CONSTANTHANDLING_H
|
#ifndef LLVM_CONSTANTHANDLING_H
|
||||||
#define LLVM_CONSTANTHANDLING_H
|
#define LLVM_CONSTANTHANDLING_H
|
||||||
|
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Instruction.h"
|
#include "llvm/Instruction.h"
|
||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
class PointerType;
|
class PointerType;
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#ifndef LLVM_CONSTANTHANDLING_H
|
#ifndef LLVM_CONSTANTHANDLING_H
|
||||||
#define LLVM_CONSTANTHANDLING_H
|
#define LLVM_CONSTANTHANDLING_H
|
||||||
|
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Instruction.h"
|
#include "llvm/Instruction.h"
|
||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
class PointerType;
|
class PointerType;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
//===-- ConstantVals.cpp - Implement Constant nodes --------------*- C++ -*--=//
|
//===-- Constants.cpp - Implement Constant nodes -----------------*- C++ -*--=//
|
||||||
//
|
//
|
||||||
// This file implements the Constant* classes...
|
// This file implements the Constant* classes...
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#define __STDC_LIMIT_MACROS // Get defs for INT64_MAX and friends...
|
#define __STDC_LIMIT_MACROS // Get defs for INT64_MAX and friends...
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/SymbolTable.h"
|
#include "llvm/SymbolTable.h"
|
||||||
#include "llvm/GlobalValue.h"
|
#include "llvm/GlobalValue.h"
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "llvm/SymbolTable.h"
|
#include "llvm/SymbolTable.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Argument.h"
|
#include "llvm/Argument.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "llvm/GlobalVariable.h"
|
#include "llvm/GlobalVariable.h"
|
||||||
#include "llvm/InstrTypes.h"
|
#include "llvm/InstrTypes.h"
|
||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include "ValueHolderImpl.h"
|
#include "ValueHolderImpl.h"
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
#include "llvm/GlobalVariable.h"
|
#include "llvm/GlobalVariable.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/ConstantVals.h"
|
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
|
#include "llvm/Constant.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/SymbolTable.h"
|
#include "llvm/SymbolTable.h"
|
||||||
#include "llvm/Argument.h"
|
#include "llvm/Argument.h"
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/SymbolTable.h"
|
#include "llvm/SymbolTable.h"
|
||||||
|
#include "llvm/Constants.h"
|
||||||
#include "Support/StringExtras.h"
|
#include "Support/StringExtras.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/Constants.h"
|
||||||
|
|
||||||
static inline const Type *checkType(const Type *Ty) {
|
static inline const Type *checkType(const Type *Ty) {
|
||||||
assert(Ty && "Invalid indices for type!");
|
assert(Ty && "Invalid indices for type!");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user