Make the constant folder aware of
__builtin___CFStringMakeConstantString. (We get into trouble in
GenerateStaticBlockVarDecl if the constant folder isn't accurate.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62949 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 76bdaa2..43b4561 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -217,6 +217,7 @@
{ return APValue(E, 0); }
APValue VisitAddrLabelExpr(AddrLabelExpr *E)
{ return APValue(E, 0); }
+ APValue VisitCallExpr(CallExpr *E);
APValue VisitConditionalOperator(ConditionalOperator *E);
};
} // end anonymous namespace
@@ -306,6 +307,12 @@
return APValue();
}
+APValue PointerExprEvaluator::VisitCallExpr(CallExpr *E) {
+ if (E->isBuiltinCall() == Builtin::BI__builtin___CFStringMakeConstantString)
+ return APValue(E, 0);
+ return APValue();
+}
+
APValue PointerExprEvaluator::VisitConditionalOperator(ConditionalOperator *E) {
bool BoolResult;
if (!HandleConversionToBool(E->getCond(), BoolResult, Info))