aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-07-04 18:45:14 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-07-04 18:45:14 +0000
commitd4f5198ae07d9a4958d8191bac694ded12173ad9 (patch)
tree5b10f375d5006dba4c4241a61bdc47426d4303ba /lib/CodeGen/CGExprScalar.cpp
parent478851c3ed6bd784e7377dffd8e57b200c1b9ba9 (diff)
Remove get(V)BaseClassOffsetInBits, the CharUnit functions should be used instead.
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159719 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r--lib/CodeGen/CGExprScalar.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index 1c1075cdca..1cccafe0d7 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -1555,9 +1555,8 @@ Value *ScalarExprEmitter::VisitOffsetOfExpr(OffsetOfExpr *E) {
// Compute the offset to the base.
const RecordType *BaseRT = CurrentType->getAs<RecordType>();
CXXRecordDecl *BaseRD = cast<CXXRecordDecl>(BaseRT->getDecl());
- int64_t OffsetInt = RL.getBaseClassOffsetInBits(BaseRD) /
- CGF.getContext().getCharWidth();
- Offset = llvm::ConstantInt::get(ResultType, OffsetInt);
+ CharUnits OffsetInt = RL.getBaseClassOffset(BaseRD);
+ Offset = llvm::ConstantInt::get(ResultType, OffsetInt.getQuantity());
break;
}
}