From 47302ea0de365661d5685da09e8d6b732d248b52 Mon Sep 17 00:00:00 2001 From: Stefano Sanfilippo Date: Tue, 10 Mar 2015 20:54:04 +0100 Subject: [PATCH] Slightly improved error reporting for << and >>. --- src/BitcodeEmitter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/BitcodeEmitter.cpp b/src/BitcodeEmitter.cpp index 0d1c5a1..56a3093 100644 --- a/src/BitcodeEmitter.cpp +++ b/src/BitcodeEmitter.cpp @@ -683,9 +683,9 @@ bool BitcodeEmitter::emit(Float const& node) { d->retval = d->builder.Create##intop(left, right); \ } -#define HANDLE_INT_ONLY(op) \ +#define HANDLE_INT_ONLY(op, symbol) \ if (fp) { \ - return reportError({"Operator cannot be applied to float values!"}); \ + return reportError({"Operator " #symbol " cannot be applied to float values!"}); \ } else { \ d->retval = d->builder.Create##op(left, right); \ } @@ -721,10 +721,10 @@ bool createOp(BitcodeEmitter::Private *d, llvm::Value *left, Operator op, llvm:: HANDLE(SDiv, FDiv) break; case Operator::SHL: - HANDLE_INT_ONLY(Shl); + HANDLE_INT_ONLY(Shl, <<); break; case Operator::SHR: - HANDLE_INT_ONLY(LShr); + HANDLE_INT_ONLY(LShr, >>); break; case Operator::LT: HANDLE(ICmpULT, FCmpULT)