[llvm-dev] Why SI.isSigned() is not equals to E->getType()->isSignedIntegerOrEnumerationType()?

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 5 12:59:57 PDT 2018


On 7/4/2018 2:58 AM, Leslie Zhai via llvm-dev wrote:
> Hi LLVM developers,
>
> I am implementing Loong Language[1] using Clang FrontEnd and LLVM 
> MiddleEnd. I add `wire`[2] Builtin Type, and clang is able to parse 
> very small testcase fulladder[3] but failed to work for 10+K loc RISCV 
> E203 project[4]:
>
> clang-7: 
> /home/zhaixiang/project/Loong-Language/loong-llvm/tools/clang/lib/AST/ExprConstant.cpp:7098: 
> bool {anonymous}::IntExprEvaluator::Success(const llvm::APSInt&, const 
> clang::Expr*, clang::APValue&): Assertion `SI.isSigned() == 
> E->getType()->isSignedIntegerOrEnumerationType() && "Invalid 
> evaluation result."' failed.

This probably indicates some sort of type mismatch in the AST (like a 
binary add with signed operands and an unsigned result). Expressions 
have a dump() method which might be helpful for debugging.

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project



More information about the llvm-dev mailing list