aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-04-26 19:19:15 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-04-26 19:19:15 +0000
commit9a901bb63990574ff0bcc12ff851d7a71cff8ddb (patch)
treea90ae2d57be74b5e2ce39197f486e31172c46f3f /lib/CodeGen
parent9ec64d6e2fe575b297e1eaa5051efc2983373e25 (diff)
Remove getIntegerConstantExprValue in favor of using EvaluateAsInt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70145 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGBuiltin.cpp3
-rw-r--r--lib/CodeGen/CGCall.cpp3
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp8
-rw-r--r--lib/CodeGen/CGObjCMac.cpp4
-rw-r--r--lib/CodeGen/CodeGenTypes.cpp2
5 files changed, 8 insertions, 12 deletions
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp
index e7adf72190..2b9a17845d 100644
--- a/lib/CodeGen/CGBuiltin.cpp
+++ b/lib/CodeGen/CGBuiltin.cpp
@@ -196,8 +196,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
case Builtin::BI__builtin_object_size: {
// FIXME: Implement. For now we just always fail and pretend we
// don't know the object size.
- llvm::APSInt TypeArg =
- E->getArg(1)->getIntegerConstantExprValue(CGM.getContext());
+ llvm::APSInt TypeArg = E->getArg(1)->EvaluateAsInt(CGM.getContext());
const llvm::Type *ResType = ConvertType(E->getType());
// bool UseSubObject = TypeArg.getZExtValue() & 1;
bool UseMinimum = TypeArg.getZExtValue() & 2;
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index 5427466cdf..41d4d7c90b 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -785,8 +785,7 @@ void X86_64ABIInfo::classify(QualType Ty,
// therefore they can straddle an eightbyte.
if (BitField) {
uint64_t Offset = OffsetBase + Layout.getFieldOffset(idx);
- uint64_t Size =
- i->getBitWidth()->getIntegerConstantExprValue(Context).getZExtValue();
+ uint64_t Size = i->getBitWidth()->EvaluateAsInt(Context).getZExtValue();
uint64_t EB_Lo = Offset / 64;
uint64_t EB_Hi = (Offset + Size - 1) / 64;
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index a652ede1c1..eeaa197cf3 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -320,8 +320,7 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
FieldSize = M->getContext().getTypeSize(FType);
Expr *BitWidth = Field->getBitWidth();
if (BitWidth)
- FieldSize =
- BitWidth->getIntegerConstantExprValue(M->getContext()).getZExtValue();
+ FieldSize = BitWidth->EvaluateAsInt(M->getContext()).getZExtValue();
FieldAlign = M->getContext().getTypeAlign(FType);
}
@@ -432,9 +431,8 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
FieldSize = M->getContext().getTypeSize(FType);
Expr *BitWidth = Field->getBitWidth();
if (BitWidth)
- FieldSize =
- BitWidth->getIntegerConstantExprValue(M->getContext()).getZExtValue();
-
+ FieldSize = BitWidth->EvaluateAsInt(M->getContext()).getZExtValue();
+
FieldAlign = M->getContext().getTypeAlign(FType);
}
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index faab3cfe10..ae3c267190 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -3085,7 +3085,7 @@ void CGObjCCommonMac::BuildAggrIvarLayout(const ObjCInterfaceDecl *OI,
LastFieldBitfield);
Expr *BitWidth = LastFieldBitfield->getBitWidth();
uint64_t BitFieldSize =
- BitWidth->getIntegerConstantExprValue(CGM.getContext()).getZExtValue();
+ BitWidth->EvaluateAsInt(CGM.getContext()).getZExtValue();
skivar.ivar_size = (BitFieldSize / ByteSizeInBits)
+ ((BitFieldSize % ByteSizeInBits) != 0);
SkipIvars.push_back(skivar);
@@ -4293,7 +4293,7 @@ void CGObjCNonFragileABIMac::GetClassSizeInfo(const ObjCInterfaceDecl *OID,
if (Last->isBitField()) {
Expr *BitWidth = Last->getBitWidth();
uint64_t BitFieldSize =
- BitWidth->getIntegerConstantExprValue(CGM.getContext()).getZExtValue();
+ BitWidth->EvaluateAsInt(CGM.getContext()).getZExtValue();
Size = (BitFieldSize / 8) + ((BitFieldSize % 8) != 0);
}
#endif
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp
index 79aa705971..f0bc6f6961 100644
--- a/lib/CodeGen/CodeGenTypes.cpp
+++ b/lib/CodeGen/CodeGenTypes.cpp
@@ -577,7 +577,7 @@ void RecordOrganizer::layoutUnionFields(const ASTRecordLayout &RL) {
if (Field->isBitField()) {
Expr *BitWidth = Field->getBitWidth();
uint64_t BitFieldSize =
- BitWidth->getIntegerConstantExprValue(CGT.getContext()).getZExtValue();
+ BitWidth->EvaluateAsInt(CGT.getContext()).getZExtValue();
CGT.addFieldInfo(*Field, 0);
CGT.addBitFieldInfo(*Field, offset, BitFieldSize);