aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-11-16 05:46:29 +0000
committerJohn McCall <rjmccall@apple.com>2010-11-16 05:46:29 +0000
commite2b768877b77fa4e00171ee6e6443722e0f3d111 (patch)
tree725aced6f8c3f08f6a566c42cc480672a0694ead /lib/AST/ExprConstant.cpp
parent641ca7d01441c34566756744838abb8faf1356aa (diff)
Kill CK_Unknown and flesh out the documentation for the existing CastKinds.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119331 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r--lib/AST/ExprConstant.cpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index d0b4c31937..f4685933dc 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -532,35 +532,6 @@ bool PointerExprEvaluator::VisitCastExpr(CastExpr* E) {
default:
break;
- case CK_Unknown: {
- // FIXME: The handling for CK_Unknown is ugly/shouldn't be necessary!
-
- // Check for pointer->pointer cast
- if (SubExpr->getType()->isPointerType() ||
- SubExpr->getType()->isObjCObjectPointerType() ||
- SubExpr->getType()->isNullPtrType() ||
- SubExpr->getType()->isBlockPointerType())
- return Visit(SubExpr);
-
- if (SubExpr->getType()->isIntegralOrEnumerationType()) {
- APValue Value;
- if (!EvaluateIntegerOrLValue(SubExpr, Value, Info))
- break;
-
- if (Value.isInt()) {
- Value.getInt().extOrTrunc((unsigned)Info.Ctx.getTypeSize(E->getType()));
- Result.Base = 0;
- Result.Offset = CharUnits::fromQuantity(Value.getInt().getZExtValue());
- return true;
- } else {
- Result.Base = Value.getLValueBase();
- Result.Offset = Value.getLValueOffset();
- return true;
- }
- }
- break;
- }
-
case CK_NoOp:
case CK_BitCast:
case CK_LValueBitCast: