-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix a bug of int128 #1624
fix a bug of int128 #1624
Conversation
svf-llvm/lib/SVFIRBuilder.cpp
Outdated
llvmModuleSet()->addToLLVMVal2SVFVarMap( | ||
fpValue, pag->getGNode(iter->second)); | ||
} | ||
else if (auto intValue = SVFUtil::dyn_cast<ConstantInt>(llvmValue)) | ||
{ | ||
pag->addConstantIntObjNode(iter->first, intValue->getSExtValue(), intValue->getZExtValue(), iter->second); | ||
std::pair<s64_t, u64_t> intVal = LLVMUtil::getIntegerValue(intValue); | ||
pag->addConstantIntObjNode(iter->first, intVal.first, intVal.second, iter->second); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you merge the 2nd and 3rd arguments as a pair?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1624 +/- ##
=======================================
Coverage 62.84% 62.85%
=======================================
Files 247 247
Lines 27700 27720 +20
Branches 4545 4547 +2
=======================================
+ Hits 17409 17424 +15
- Misses 10291 10296 +5
|
This reverts commit 75be147.
svf/include/SVFIR/SVFIR.h
Outdated
@@ -585,10 +585,10 @@ class SVFIR : public IRGraph | |||
return addNode(node, i); | |||
} | |||
|
|||
inline NodeID addConstantIntValNode(const SVFValue* curInst, s64_t sval, u64_t zval, const NodeID i, | |||
inline NodeID addConstantIntValNode(const SVFValue* curInst, std::pair<s64_t, u64_t> intValue, const NodeID i, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::pair<s64_t, u64_t>&
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::pair<s64_t, u64_t>& intValue
svf/include/SVFIR/SVFIR.h
Outdated
@@ -656,13 +656,12 @@ class SVFIR : public IRGraph | |||
} | |||
|
|||
|
|||
inline NodeID addConstantIntObjNode(const SVFValue* curInst, s64_t sval, u64_t zval, const NodeID i) | |||
{ | |||
inline NodeID addConstantIntObjNode(const SVFValue* curInst, std::pair<s64_t, u64_t> intValue, const NodeID i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::pair<s64_t, u64_t>&
svf-llvm/lib/SVFIRExtAPI.cpp
Outdated
@@ -64,7 +64,7 @@ const Type* SVFIRBuilder::getBaseTypeAndFlattenedFields(const Value* V, std::vec | |||
{ | |||
SymbolTableBuilder builder(pag->getSymbolInfo()); | |||
builder.collectSym(offset); | |||
pag->addConstantIntValNode(svfOffset, offset->getSExtValue(), offset->getZExtValue(), pag->getSymbolInfo()->getValSym(svfOffset), nullptr); | |||
pag->addConstantIntValNode(svfOffset, std::make_pair(offset->getSExtValue(), offset->getZExtValue()), pag->getSymbolInfo()->getValSym(svfOffset), nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LLVMUtil::getIntegerValue(offset)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::make_pair(offset->getSExtValue(), offset->getZExtValue()) => LLVMUtil::getIntegerValue(offset)
* fix a bug of int128 * wrap integer value function * revise the std::make_pair * Revert "revise the std::make_pair" This reverts commit 75be147. * fix addConstantIntObjNode and addConstantIntValNode * remove getSExt ZExt in SVF-LLVM --------- Co-authored-by: bjjwwang <bjjwwang@github.com>
No description provided.