aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/Interp/ByteCodeExprGen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/Interp/ByteCodeExprGen.cpp')
-rw-r--r--clang/lib/AST/Interp/ByteCodeExprGen.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
index edc2ec8..72c569f 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -3562,6 +3562,17 @@ bool ByteCodeExprGen<Emitter>::VisitBuiltinCallExpr(const CallExpr *E) {
if (!Func)
return false;
+ // For these, we're expected to ultimately return an APValue pointing
+ // to the CallExpr. This is needed to get the correct codegen.
+ unsigned Builtin = E->getBuiltinCallee();
+ if (Builtin == Builtin::BI__builtin___CFStringMakeConstantString ||
+ Builtin == Builtin::BI__builtin___NSStringMakeConstantString ||
+ Builtin == Builtin::BI__builtin_function_start) {
+ if (std::optional<unsigned> GlobalOffset = P.createGlobal(E))
+ return this->emitGetPtrGlobal(*GlobalOffset, E);
+ return false;
+ }
+
QualType ReturnType = E->getType();
std::optional<PrimType> ReturnT = classify(E);