diff options
-rw-r--r-- | CodeGen/CGExpr.cpp | 8 | ||||
-rw-r--r-- | CodeGen/CodeGenFunction.h | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/CodeGen/CGExpr.cpp b/CodeGen/CGExpr.cpp index 3cae677cd0..9697686b1a 100644 --- a/CodeGen/CGExpr.cpp +++ b/CodeGen/CGExpr.cpp @@ -614,6 +614,8 @@ RValue CodeGenFunction::EmitExpr(const Expr *E) { return EmitFloatingLiteral(cast<FloatingLiteral>(E)); case Expr::CharacterLiteralClass: return EmitCharacterLiteral(cast<CharacterLiteral>(E)); + case Expr::TypesCompatibleExprClass: + return EmitTypesCompatibleExpr(cast<TypesCompatibleExpr>(E)); // Operators. case Expr::ParenExprClass: @@ -651,6 +653,12 @@ RValue CodeGenFunction::EmitCharacterLiteral(const CharacterLiteral *E) { E->getValue())); } +RValue CodeGenFunction::EmitTypesCompatibleExpr(const TypesCompatibleExpr *E) { + return RValue::get(llvm::ConstantInt::get(ConvertType(E->getType()), + E->typesAreCompatible())); +} + + RValue CodeGenFunction::EmitArraySubscriptExprRV(const ArraySubscriptExpr *E) { // Emit subscript expressions in rvalue context's. For most cases, this just // loads the lvalue formed by the subscript expr. However, we have to be diff --git a/CodeGen/CodeGenFunction.h b/CodeGen/CodeGenFunction.h index 3235034a0b..4c79498c46 100644 --- a/CodeGen/CodeGenFunction.h +++ b/CodeGen/CodeGenFunction.h @@ -48,6 +48,8 @@ namespace clang { class IntegerLiteral; class FloatingLiteral; class CharacterLiteral; + class TypesCompatibleExpr; + class CastExpr; class CallExpr; class UnaryOperator; @@ -351,6 +353,7 @@ public: RValue EmitIntegerLiteral(const IntegerLiteral *E); RValue EmitFloatingLiteral(const FloatingLiteral *E); RValue EmitCharacterLiteral(const CharacterLiteral *E); + RValue EmitTypesCompatibleExpr(const TypesCompatibleExpr *E); RValue EmitCastExpr(const Expr *Op, QualType DestTy); RValue EmitCallExpr(const CallExpr *E); |