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

Leslie Zhai via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 5 19:42:02 PDT 2018


Hi Friedman,

Thanks for your response! I will try dump() to debug. and I found that 
even if remove the assertion (monkey patch) it might failed to parse 
`wire` Type, so I need to find out the root cause where I dig the wrong 
hole, thanks for your teaching :)


在 2018年07月06日 03:59, Friedman, Eli 写道:
> 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
>

-- 
Regards,
Leslie Zhai



More information about the llvm-dev mailing list