-
Notifications
You must be signed in to change notification settings - Fork 438
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
opaque pointer support (type inference) for c #1323
Merged
Merged
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit
Hold shift + click to select a range
f3761ea
find type assert
jumormt 18970cb
add assertion checking num field
jumormt 40b8def
fix indirect call does not have called func
jumormt 19fc337
add type check option
jumormt f57fc37
add type check option && first version of collect types
jumormt f38e36a
add "store (value operand) <- gep" rule
jumormt 9c8d789
add inter-procedural rule
jumormt 8e13066
add some comments
jumormt 5144f86
fix call base bug
jumormt fae7e57
add callsite to callee inference
jumormt 8934f21
do not propagate to declare func
jumormt 4fcfafe
fix vararg
jumormt 14efeb5
refactor
jumormt 27fb0ea
use hash map to cache results
jumormt 2e6d12d
refine
jumormt 6f62afb
iterative memorizing dfs
jumormt 7279bee
iterative memorizing dfs
jumormt 5edb5f2
fix bug
jumormt 3138be2
add comments and fix bug for c++20
jumormt 7cad38a
fix deadloop
jumormt cc5f2aa
fix deadloop
jumormt 28b941e
refine coding
jumormt f1cab1a
refactor inferTypeOfHeapObjOrStaticObj
jumormt 8c838bf
refactor inferTypeOfHeapObjOrStaticObj
jumormt 87b671c
add a new typeinference class
jumormt d38f373
refactor
jumormt 076ca38
fix bug
jumormt 8d15f3f
add debug support
jumormt cf89135
add default type
jumormt 4712b6b
move getptrelementtype to test
jumormt 550ebb1
move getClassNameOfThisPtr to chg builder and add diff test
jumormt 3063af8
remove getelementptr in SVFExt and llvmmodule
jumormt 376d729
return max field for ptr type
jumormt fd0e4d4
default for heap is i8
jumormt 9a89761
for param of ext api, first find source and then derive type
jumormt 868e023
refactor getOrInferLLVMObjType
jumormt 9f45f32
skip global function value -> callsite when forward infer type
jumormt 578a379
update comment
jumormt ef078d7
fix passing a function as a param
jumormt 8889fd0
rename typesizedifftest, remove unnecessary getfirstcast
jumormt ef8ccd1
remove getptrelement and getpointerto in svf/*
jumormt 058f626
ptr in svf main
jumormt b13b37f
thisptr class name prepare
jumormt 8639716
infer type based on c++ constructor
jumormt ec19b79
add comments
jumormt 1d33ec4
getOrInferThisPtrClassName update
jumormt d17948b
refine type diff test
jumormt 5f35694
refine type diff test
jumormt 1d52b55
fix indirect call passing
jumormt f854a53
separate cpp source and allocation
jumormt 1857464
refactor iscpp constructor
jumormt a243d10
update
jumormt 8efc471
for c++ fw type inference, consider constructor for now
jumormt 04d89a8
update
jumormt f3a4f8e
delete c++
jumormt 6cf0f73
delete c++
jumormt 146fbd8
update based on comments
jumormt ab8963d
rename
jumormt ab04330
refactor
jumormt 0aeeacb
reformat
jumormt 76cdfc3
refactor
jumormt 22dd059
move typeinference to LLVMModuleSet
jumormt 12b3431
release llvm modouleset immediately after svfir is built
jumormt 7352b98
remove static method
jumormt c363ad3
fix ander diff test
jumormt 6ffb132
fix saber
jumormt 3cdc19e
bytesize default 1
jumormt 37f43f2
fix wpa release llvm module
jumormt 8118f53
fix mac CI
jumormt eb34d0a
delete cpp
jumormt a176ca5
move release llvmmoduleset to the end of main
jumormt 63aa46e
merge SVF master into opaque c
jumormt 4d2f565
rename typeinference to objtypeinference
jumormt 82f2e31
enable type check by default
jumormt 9e61dd0
refactor
jumormt b0980a0
rename cpp and add ctest type infer CI
jumormt d620c42
add some assertions for npd
jumormt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
separate cpp source and allocation
- Loading branch information
commit f854a53cae92b75d0db2c8ffbb30dca1c478c268
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,8 @@ class TypeInference { | |
static std::unique_ptr<TypeInference> _typeInference; | ||
ValueToInferSites _valueToInferSites; // value inference site cache | ||
ValueToType _valueToType; // value type cache | ||
ValueToSources _valueToSources; // value sources cache | ||
ValueToSources _valueToAllocs; // value allocations (stack, static, heap) cache | ||
ValueToSources _valueToCPPSources; // value cpp sources cache | ||
ValueToClassName _thisPtrClassName; // thisptr class name cache | ||
std::string _emptyClassName = ""; | ||
|
||
|
@@ -97,16 +98,23 @@ class TypeInference { | |
/// Forward collect all possible infer sites starting from a value | ||
const Type *fwGetOrInferLLVMObjType(const Value *startValue); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fwInferObjType |
||
|
||
/// Backward collect all possible sources starting from a value | ||
Set<const Value *> bwGetOrfindSourceVals(const Value *startValue); | ||
/// Backward collect all possible allocation sites (stack, static, heap) starting from a value | ||
Set<const Value *> bwGetOrfindAllocations(const Value *startValue); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bwInferObjType |
||
|
||
/// Backward collect all possible cpp constructors starting from a value | ||
Set<const Value *> bwGetOrfindCPPSources(const Value *startValue); | ||
|
||
/// Determine type based on infer site | ||
static const Type *infersiteToType(const Value *val); | ||
|
||
static bool isInfersite(const Value *val); | ||
|
||
inline static bool isSourceVal(const Value *val) { | ||
return LLVMUtil::isObject(val) || SVFUtil::isa<GetElementPtrInst>(val); | ||
inline static bool isAllocation(const Value *val) { | ||
return LLVMUtil::isObject(val); | ||
} | ||
|
||
inline static bool isCPPSource(const Value *val) { | ||
return isAllocation(val) || SVFUtil::isa<GetElementPtrInst>(val); | ||
} | ||
|
||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 unique_ptr