[cfe-dev] "auto *IL = dyn_cast<IntegerLiteral>(e); " IL becomes NULL fails for negative integers.
Devendran Mani via cfe-dev
cfe-dev at lists.llvm.org
Sat Nov 2 13:16:07 PDT 2019
I need a support to find the below *IL null pointer return for negative
const Expr *e = vDecl->getInit();
auto *IL = dyn_cast<IntegerLiteral>(e);
double val = IL->getValue().signedRoundToDouble();
cout << "val:" val;
int val = 100; (int val = -100;)
if the local variable is positive ex: int var 100; then cout prints the
right value "100".
But if the local variable is negative ex: int var -100; then IL becomes
NULL and cout is not executed.
Please help me root cause this issue.
Sent from Yahoo Mail for iPad
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev