From d114ade7f12e388c685e293ae94356c6b0b221f7 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sat, 15 Nov 2008 18:52:06 +0000 Subject: [PATCH] Use IgnoreParenCasts. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59371 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprConstant.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 1e224571f9..e187d890e9 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -619,16 +619,7 @@ public: // Handle __builtin___CFStringMakeConstantString. if (E->isBuiltinCall() ==Builtin::BI__builtin___CFStringMakeConstantString){ - const Expr *Arg = E->getArg(0); - - while (1) { - if (const ParenExpr *PE = dyn_cast(Arg)) - Arg = PE->getSubExpr(); - else if (const ImplicitCastExpr *CE = dyn_cast(Arg)) - Arg = CE->getSubExpr(); - else - break; - } + const Expr *Arg = E->getArg(0)->IgnoreParenCasts(); const StringLiteral *Literal = cast(Arg); std::string S(Literal->getStrData(), Literal->getByteLength()); -- 2.40.0