[clang][Interp] Support ObjCEncodeExprs
This commit is contained in:
@@ -1688,6 +1688,17 @@ bool ByteCodeExprGen<Emitter>::VisitObjCStringLiteral(
|
||||
return this->delegate(E->getString());
|
||||
}
|
||||
|
||||
template <class Emitter>
|
||||
bool ByteCodeExprGen<Emitter>::VisitObjCEncodeExpr(const ObjCEncodeExpr *E) {
|
||||
auto &A = Ctx.getASTContext();
|
||||
std::string Str;
|
||||
A.getObjCEncodingForType(E->getEncodedType(), Str);
|
||||
StringLiteral *SL =
|
||||
StringLiteral::Create(A, Str, StringLiteralKind::Ordinary,
|
||||
/*Pascal=*/false, E->getType(), E->getAtLoc());
|
||||
return this->delegate(SL);
|
||||
}
|
||||
|
||||
template <class Emitter>
|
||||
bool ByteCodeExprGen<Emitter>::VisitSYCLUniqueStableNameExpr(
|
||||
const SYCLUniqueStableNameExpr *E) {
|
||||
|
||||
@@ -91,6 +91,7 @@ public:
|
||||
bool VisitAbstractConditionalOperator(const AbstractConditionalOperator *E);
|
||||
bool VisitStringLiteral(const StringLiteral *E);
|
||||
bool VisitObjCStringLiteral(const ObjCStringLiteral *E);
|
||||
bool VisitObjCEncodeExpr(const ObjCEncodeExpr *E);
|
||||
bool VisitSYCLUniqueStableNameExpr(const SYCLUniqueStableNameExpr *E);
|
||||
bool VisitCharacterLiteral(const CharacterLiteral *E);
|
||||
bool VisitCompoundAssignOperator(const CompoundAssignOperator *E);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm -o - %s | FileCheck %s
|
||||
// RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm -o - %s -fexperimental-new-constant-interpreter | FileCheck %s
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
Reference in New Issue
Block a user