summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/APValue.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-05-13 03:29:01 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-05-13 03:29:01 +0000
commite92006860d24000c7653852533e62d101902c7ee (patch)
tree807e4f1fc1f87877146de918636a1c0ebb3482a0 /clang/lib/AST/APValue.cpp
parent43bb6e23e52b513615052a4b0572256d21dece85 (diff)
downloadbcm5719-llvm-e92006860d24000c7653852533e62d101902c7ee.tar.gz
bcm5719-llvm-e92006860d24000c7653852533e62d101902c7ee.zip
Refactoring of constant expression evaluator
This introduces a generic base class for the expression evaluator classes, which handles a few common expression types which were previously handled separately in each class. Also, the expression evaluator now uses ConstStmtVisitor. llvm-svn: 131281
Diffstat (limited to 'clang/lib/AST/APValue.cpp')
-rw-r--r--clang/lib/AST/APValue.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/AST/APValue.cpp b/clang/lib/AST/APValue.cpp
index 731d5e04668..ebe99b12cda 100644
--- a/clang/lib/AST/APValue.cpp
+++ b/clang/lib/AST/APValue.cpp
@@ -18,12 +18,12 @@ using namespace clang;
namespace {
struct LV {
- Expr* Base;
+ const Expr* Base;
CharUnits Offset;
};
}
-APValue::APValue(Expr* B) : Kind(Uninitialized) {
+APValue::APValue(const Expr* B) : Kind(Uninitialized) {
MakeLValue(); setLValue(B, CharUnits::Zero());
}
@@ -118,7 +118,7 @@ void APValue::print(llvm::raw_ostream &OS) const {
}
}
-Expr* APValue::getLValueBase() const {
+const Expr* APValue::getLValueBase() const {
assert(isLValue() && "Invalid accessor");
return ((const LV*)(const void*)Data)->Base;
}
@@ -128,7 +128,7 @@ CharUnits APValue::getLValueOffset() const {
return ((const LV*)(const void*)Data)->Offset;
}
-void APValue::setLValue(Expr *B, const CharUnits &O) {
+void APValue::setLValue(const Expr *B, const CharUnits &O) {
assert(isLValue() && "Invalid accessor");
((LV*)(char*)Data)->Base = B;
((LV*)(char*)Data)->Offset = O;
OpenPOWER on IntegriCloud