projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed unnecessary #includes.
[oota-llvm.git]
/
lib
/
Transforms
/
ExprTypeConvert.cpp
diff --git
a/lib/Transforms/ExprTypeConvert.cpp
b/lib/Transforms/ExprTypeConvert.cpp
index ab4edf33668d73d00da82ef56705655fbd47093d..08ebc03fb58036e172bb4d653ca6a0a2eb4bbbed 100644
(file)
--- a/
lib/Transforms/ExprTypeConvert.cpp
+++ b/
lib/Transforms/ExprTypeConvert.cpp
@@
-53,13
+53,13
@@
static bool MallocConvertableToType(MallocInst *MI, const Type *Ty,
if (!Expr.Offset && !Expr.Scale && OldTypeSize == 1) return false;
// Get the offset and scale of the allocation...
if (!Expr.Offset && !Expr.Scale && OldTypeSize == 1) return false;
// Get the offset and scale of the allocation...
- int OffsetVal = Expr.Offset ? getConstantValue(Expr.Offset) : 0;
- int
ScaleVal = Expr.Scale ? getConstantValue(Expr.Scale) : (Expr.Var ? 1 :
0);
+ int
64_t
OffsetVal = Expr.Offset ? getConstantValue(Expr.Offset) : 0;
+ int
64_t ScaleVal = Expr.Scale ? getConstantValue(Expr.Scale) :(Expr.Var !=
0);
// The old type might not be of unit size, take old size into consideration
// here...
// The old type might not be of unit size, take old size into consideration
// here...
- int Offset = OffsetVal * OldTypeSize;
- int Scale = ScaleVal * OldTypeSize;
+ int
64_t
Offset = OffsetVal * OldTypeSize;
+ int
64_t
Scale = ScaleVal * OldTypeSize;
// In order to be successful, both the scale and the offset must be a multiple
// of the requested data type's size.
// In order to be successful, both the scale and the offset must be a multiple
// of the requested data type's size.
@@
-87,13
+87,13
@@
static Instruction *ConvertMallocToType(MallocInst *MI, const Type *Ty,
unsigned OldTypeSize = TD.getTypeSize(MI->getType()->getElementType());
// Get the offset and scale coefficients that we are allocating...
unsigned OldTypeSize = TD.getTypeSize(MI->getType()->getElementType());
// Get the offset and scale coefficients that we are allocating...
- int OffsetVal = (Expr.Offset ? getConstantValue(Expr.Offset) : 0);
- int
ScaleVal = Expr.Scale ? getConstantValue(Expr.Scale) : (Expr.Var ? 1 :
0);
+ int
64_t
OffsetVal = (Expr.Offset ? getConstantValue(Expr.Offset) : 0);
+ int
64_t ScaleVal = Expr.Scale ? getConstantValue(Expr.Scale) : (Expr.Var !=
0);
// The old type might not be of unit size, take old size into consideration
// here...
// The old type might not be of unit size, take old size into consideration
// here...
- unsigned Offset = (u
nsigned
)OffsetVal * OldTypeSize / DataSize;
- unsigned Scale = (u
nsigned
)ScaleVal * OldTypeSize / DataSize;
+ unsigned Offset = (u
int64_t
)OffsetVal * OldTypeSize / DataSize;
+ unsigned Scale = (u
int64_t
)ScaleVal * OldTypeSize / DataSize;
// Locate the malloc instruction, because we may be inserting instructions
It = MI;
// Locate the malloc instruction, because we may be inserting instructions
It = MI;