[llvm-commits] CVS: llvm/lib/Transforms/ExprTypeConvert.cpp LevelRaise.cpp TransformInternals.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Jan 8 23:54:01 PST 2004
Changes in directory llvm/lib/Transforms:
ExprTypeConvert.cpp updated: 1.86 -> 1.87
LevelRaise.cpp updated: 1.91 -> 1.92
TransformInternals.cpp updated: 1.42 -> 1.43
---
Log message:
Finegrainify namespacification
add flags for PR82
---
Diffs of the changes: (+23 -13)
Index: llvm/lib/Transforms/ExprTypeConvert.cpp
diff -u llvm/lib/Transforms/ExprTypeConvert.cpp:1.86 llvm/lib/Transforms/ExprTypeConvert.cpp:1.87
--- llvm/lib/Transforms/ExprTypeConvert.cpp:1.86 Tue Dec 23 02:04:08 2003
+++ llvm/lib/Transforms/ExprTypeConvert.cpp Thu Jan 8 23:53:38 2004
@@ -799,6 +799,7 @@
// stream, so we have to delete it when we're done.
//
if (DataSize != 1) {
+ // FIXME, PR82
TempScale = BinaryOperator::create(Instruction::Mul, Index,
ConstantSInt::get(Type::LongTy,
DataSize));
@@ -1011,6 +1012,7 @@
if (const CompositeType *CT = dyn_cast<CompositeType>(LoadedTy)) {
std::vector<Value*> Indices;
+ // FIXME, PR82
Indices.push_back(ConstantSInt::get(Type::LongTy, 0));
unsigned Offset = 0; // No offset, get first leaf.
@@ -1047,6 +1049,7 @@
const StructType *SElTy = cast<StructType>(ElTy);
std::vector<Value*> Indices;
+ // FIXME, PR82
Indices.push_back(Constant::getNullValue(Type::LongTy));
unsigned Offset = 0;
@@ -1076,6 +1079,7 @@
if (isa<StructType>(ValTy)) {
std::vector<Value*> Indices;
+ // FIXME: PR82
Indices.push_back(Constant::getNullValue(Type::LongTy));
unsigned Offset = 0;
@@ -1109,6 +1113,7 @@
if (DataSize != 1) {
// Insert a multiply of the old element type is not a unit size...
Index = BinaryOperator::create(Instruction::Mul, Index,
+ // FIXME: PR82
ConstantSInt::get(Type::LongTy, DataSize),
"scale", It);
}
Index: llvm/lib/Transforms/LevelRaise.cpp
diff -u llvm/lib/Transforms/LevelRaise.cpp:1.91 llvm/lib/Transforms/LevelRaise.cpp:1.92
--- llvm/lib/Transforms/LevelRaise.cpp:1.91 Thu Jan 8 23:44:50 2004
+++ llvm/lib/Transforms/LevelRaise.cpp Thu Jan 8 23:53:38 2004
@@ -370,7 +370,8 @@
// Build the index vector, full of all zeros
std::vector<Value*> Indices;
- Indices.push_back(ConstantSInt::get(Type::LongTy, 0));
+
+ Indices.push_back(ConstantSInt::get(Type::LongTy, 0)); // FIXME, PR82
while (CurCTy && !isa<PointerType>(CurCTy)) {
const Type *IdxType;
if (const StructType *CurSTy = dyn_cast<StructType>(CurCTy)) {
Index: llvm/lib/Transforms/TransformInternals.cpp
diff -u llvm/lib/Transforms/TransformInternals.cpp:1.42 llvm/lib/Transforms/TransformInternals.cpp:1.43
--- llvm/lib/Transforms/TransformInternals.cpp:1.42 Tue Dec 23 02:04:08 2003
+++ llvm/lib/Transforms/TransformInternals.cpp Thu Jan 8 23:53:38 2004
@@ -17,8 +17,7 @@
#include "llvm/Analysis/Expressions.h"
#include "llvm/Function.h"
#include "llvm/iOther.h"
-
-namespace llvm {
+using namespace llvm;
static const Type *getStructOffsetStep(const StructType *STy, uint64_t &Offset,
std::vector<Value*> &Indices,
@@ -36,6 +35,7 @@
(i == SL->MemberOffsets.size()-1 || Offset < SL->MemberOffsets[i+1]));
// Make sure to save the current index...
+ // FIXME for PR82
Indices.push_back(ConstantUInt::get(Type::UByteTy, i));
Offset = SL->MemberOffsets[i];
return STy->getContainedType(i);
@@ -53,9 +53,9 @@
// case, this routine will not drill down to the leaf type. Set StopEarly to
// false if you want a leaf
//
-const Type *getStructOffsetType(const Type *Ty, unsigned &Offset,
- std::vector<Value*> &Indices,
- const TargetData &TD, bool StopEarly) {
+const Type *llvm::getStructOffsetType(const Type *Ty, unsigned &Offset,
+ std::vector<Value*> &Indices,
+ const TargetData &TD, bool StopEarly) {
if (Offset == 0 && StopEarly && !Indices.empty())
return Ty; // Return the leaf type
@@ -75,6 +75,7 @@
NextType = ATy->getElementType();
unsigned ChildSize = TD.getTypeSize(NextType);
+ // FIXME for PR82
Indices.push_back(ConstantSInt::get(Type::LongTy, Offset/ChildSize));
ThisOffset = (Offset/ChildSize)*ChildSize;
} else {
@@ -94,10 +95,10 @@
// with the values that would be appropriate to make this a getelementptr
// instruction. The type returned is the root type that the GEP would point to
//
-const Type *ConvertibleToGEP(const Type *Ty, Value *OffsetVal,
- std::vector<Value*> &Indices,
- const TargetData &TD,
- BasicBlock::iterator *BI) {
+const Type *llvm::ConvertibleToGEP(const Type *Ty, Value *OffsetVal,
+ std::vector<Value*> &Indices,
+ const TargetData &TD,
+ BasicBlock::iterator *BI) {
const CompositeType *CompTy = dyn_cast<CompositeType>(Ty);
if (CompTy == 0) return 0;
@@ -152,12 +153,13 @@
if (BI) { // Generate code?
BasicBlock *BB = (*BI)->getParent();
- if (Expr.Var->getType() != Type::LongTy)
- Expr.Var = new CastInst(Expr.Var, Type::LongTy,
+ if (Expr.Var->getType() != Type::LongTy) // FIXME for PR82
+ Expr.Var = new CastInst(Expr.Var, Type::LongTy, // FIXME for PR82
Expr.Var->getName()+"-idxcast", *BI);
if (ScaleAmt && ScaleAmt != 1) {
// If we have to scale up our index, do so now
+ // FIXME for PR82
Value *ScaleAmtVal = ConstantSInt::get(Type::LongTy, ScaleAmt);
Expr.Var = BinaryOperator::create(Instruction::Mul, Expr.Var,
ScaleAmtVal,
@@ -165,6 +167,7 @@
}
if (Index) { // Add an offset to the index
+ // FIXME for PR82
Value *IndexAmt = ConstantSInt::get(Type::LongTy, Index);
Expr.Var = BinaryOperator::create(Instruction::Add, Expr.Var,
IndexAmt,
@@ -178,6 +181,7 @@
} else if (Offset >= (int64_t)ElSize || -Offset >= (int64_t)ElSize) {
// Calculate the index that we are entering into the array cell with
uint64_t Index = Offset/ElSize;
+ // FIXME for PR82
Indices.push_back(ConstantSInt::get(Type::LongTy, Index));
Offset -= (int64_t)(Index*ElSize); // Consume part of the offset
@@ -185,6 +189,7 @@
// Must be indexing a small amount into the first cell of the array
// Just index into element zero of the array here.
//
+ // FIXME for PR82
Indices.push_back(ConstantSInt::get(Type::LongTy, 0));
} else {
return 0; // Hrm. wierd, can't handle this case. Bail
@@ -196,4 +201,3 @@
return NextTy;
}
-} // End llvm namespace
More information about the llvm-commits
mailing list