diff options
author | Chris Lattner <sabre@nondot.org> | 2003-04-24 18:25:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-04-24 18:25:27 +0000 |
commit | 16125fb74966ebe416c669e28e453be68eda32a7 (patch) | |
tree | 38793555d17f73faab7ea8d3e147e3b2974b7c34 /lib/Transforms/TransformInternals.h | |
parent | ad80a46caacef8b4073df3fc10e0c58ebbee4ec7 (diff) |
Make the levelraise pass be well behaved w.r.t the TargetData that the current
PassMAnager provides.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5896 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/TransformInternals.h')
-rw-r--r-- | lib/Transforms/TransformInternals.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/lib/Transforms/TransformInternals.h b/lib/Transforms/TransformInternals.h index 867dd5d4ab..9f6eb7954b 100644 --- a/lib/Transforms/TransformInternals.h +++ b/lib/Transforms/TransformInternals.h @@ -15,14 +15,6 @@ #include <map> #include <set> -// TargetData Hack: Eventually we will have annotations given to us by the -// backend so that we know stuff about type size and alignments. For now -// though, just use this, because it happens to match the model that GCC uses. -// -// FIXME: This should use annotations -// -extern const TargetData TD; - static inline int64_t getConstantValue(const ConstantInt *CPI) { if (const ConstantSInt *CSI = dyn_cast<ConstantSInt>(CPI)) return CSI->getValue(); @@ -49,6 +41,7 @@ static inline const CompositeType *getPointedToComposite(const Type *Ty) { // const Type *ConvertableToGEP(const Type *Ty, Value *V, std::vector<Value*> &Indices, + const TargetData &TD, BasicBlock::iterator *BI = 0); @@ -112,14 +105,18 @@ struct ValueMapCache { }; -bool ExpressionConvertableToType(Value *V, const Type *Ty, ValueTypeCache &Map); -Value *ConvertExpressionToType(Value *V, const Type *Ty, ValueMapCache &VMC); +bool ExpressionConvertableToType(Value *V, const Type *Ty, ValueTypeCache &Map, + const TargetData &TD); +Value *ConvertExpressionToType(Value *V, const Type *Ty, ValueMapCache &VMC, + const TargetData &TD); // ValueConvertableToType - Return true if it is possible bool ValueConvertableToType(Value *V, const Type *Ty, - ValueTypeCache &ConvertedTypes); + ValueTypeCache &ConvertedTypes, + const TargetData &TD); -void ConvertValueToNewType(Value *V, Value *NewVal, ValueMapCache &VMC); +void ConvertValueToNewType(Value *V, Value *NewVal, ValueMapCache &VMC, + const TargetData &TD); // getStructOffsetType - Return a vector of offsets that are to be used to index @@ -135,6 +132,6 @@ void ConvertValueToNewType(Value *V, Value *NewVal, ValueMapCache &VMC); // const Type *getStructOffsetType(const Type *Ty, unsigned &Offset, std::vector<Value*> &Offsets, - bool StopEarly = true); + const TargetData &TD, bool StopEarly = true); #endif |