diff options
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 1 | ||||
-rw-r--r-- | clang/lib/AST/ByteCode/Compiler.cpp | 12 |
2 files changed, 11 insertions, 2 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 0fd0e7e..056bfe3 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -3501,6 +3501,7 @@ static void encodeTypeForFunctionPointerAuth(const ASTContext &Ctx, case BuiltinType::VectorQuad: case BuiltinType::VectorPair: case BuiltinType::DMR1024: + case BuiltinType::DMR2048: OS << "?"; return; diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index 0b7b6cd..c71fd22 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -540,7 +540,8 @@ bool Compiler<Emitter>::VisitCastExpr(const CastExpr *CE) { if (const auto *IL = dyn_cast<IntegerLiteral>(SubExpr)) { if (ToT != PT_IntAP && ToT != PT_IntAPS && FromT != PT_IntAP && FromT != PT_IntAPS && !CE->getType()->isEnumeralType()) - return this->emitConst(IL->getValue(), CE); + return this->emitConst(APSInt(IL->getValue(), !isSignedType(*FromT)), + CE); if (!this->emitConst(IL->getValue(), SubExpr)) return false; } else { @@ -4541,7 +4542,14 @@ bool Compiler<Emitter>::emitConst(T Value, const Expr *E) { template <class Emitter> bool Compiler<Emitter>::emitConst(const APSInt &Value, PrimType Ty, const Expr *E) { - return this->emitConst(static_cast<const APInt &>(Value), Ty, E); + if (Ty == PT_IntAPS) + return this->emitConstIntAPS(Value, E); + if (Ty == PT_IntAP) + return this->emitConstIntAP(Value, E); + + if (Value.isSigned()) + return this->emitConst(Value.getSExtValue(), Ty, E); + return this->emitConst(Value.getZExtValue(), Ty, E); } template <class Emitter> |