-
Notifications
You must be signed in to change notification settings - Fork 430
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
remove some opaque pointer dependencies #1295
Conversation
svf-llvm/lib/LLVMModule.cpp
Outdated
@@ -1384,7 +1392,8 @@ SVFType* LLVMModuleSet::addSVFTypeInfo(const Type* T) | |||
//cast svftype to SVFPointerType | |||
SVFPointerType* svfPtrType = SVFUtil::dyn_cast<SVFPointerType>(svftype); | |||
assert(svfPtrType && "this is not SVFPointerType"); | |||
svfPtrType->setPtrElementType(getSVFType(LLVMUtil::getPtrElementType(pt))); | |||
if(!pt->isOpaque()) |
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.
remove this.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1295 +/- ##
==========================================
- Coverage 64.48% 64.45% -0.03%
==========================================
Files 223 223
Lines 23850 23870 +20
==========================================
+ Hits 15380 15386 +6
- Misses 8470 8484 +14
|
svf-llvm/lib/LLVMModule.cpp
Outdated
@@ -533,6 +533,14 @@ void LLVMModuleSet::loadModules(const std::vector<std::string> &moduleNameVec) | |||
|
|||
owned_ctx = std::make_unique<LLVMContext>(); | |||
|
|||
#if (LLVM_VERSION_MAJOR <= 14) |
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.
remove this
svf-llvm/lib/SVFIRBuilder.cpp
Outdated
@@ -318,8 +318,12 @@ bool SVFIRBuilder::computeGepOffset(const User *V, AccessPath& ap) | |||
// If it's a non-constant offset access | |||
// If its point-to target is struct or array, it's likely an array accessing (%result = gep %struct.A* %a, i32 %non-const-index) | |||
// If its point-to target is single value (pointer arithmetic), then it's a variant gep (%result = gep i8* %p, i32 %non-const-index) | |||
if(!op && gepTy->isPointerTy() && getPtrElementType(SVFUtil::dyn_cast<PointerType>(gepTy))->isSingleValueType()) | |||
isConst = false; | |||
if(!op && gepTy->isPointerTy()) { |
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.
wrap up this as a function.
svf-llvm/lib/SymbolTableBuilder.cpp
Outdated
const Type* objtype = LLVMUtil::getPtrElementType(ptrType); | ||
(void)getOrAddSVFTypeInfo(objtype); | ||
// don't collect pointee type for opaque pointer | ||
if(!ptrType->isOpaque()) { |
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.
remove this.
svf/include/Util/Options.h
Outdated
@@ -272,6 +272,8 @@ class Options | |||
// Loop Analysis | |||
static const Option<bool> LoopAnalysis; | |||
static const Option<u32_t> LoopBound; | |||
|
|||
static const Option<bool> DisableOpaquePointers; |
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.
remove
else if (const SVFPointerType* ptrOperandType = SVFUtil::dyn_cast<SVFPointerType>(idxOperandType)) | ||
elemByteSize = ptrOperandType->getPtrElementType()->getByteSize(); | ||
else if (SVFUtil::isa<SVFPointerType>(idxOperandType)) | ||
elemByteSize = gep->getAccessPath().getGepPointeeType()->getByteSize(); |
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.
getGepPointeeType => gepSrcPointeeType
svf/lib/SVFIR/SVFType.cpp
Outdated
if(isOpaque()) os << "ptr"; | ||
else os << *ptrElementType << '*'; |
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.
print "ptr"
svf/include/SVFIR/SVFType.h
Outdated
@@ -368,10 +368,14 @@ class SVFPointerType : public SVFType | |||
} | |||
inline const SVFType* getPtrElementType() const |
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.
remove this function
remove some opaque pointer dependencies