-
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
Changes from 1 commit
f3761ea
18970cb
40b8def
19fc337
f57fc37
f38e36a
9c8d789
8e13066
5144f86
fae7e57
8934f21
4fcfafe
14efeb5
27fb0ea
2e6d12d
6f62afb
7279bee
5edb5f2
3138be2
7cad38a
cc5f2aa
28b941e
f1cab1a
8c838bf
87b671c
d38f373
076ca38
8d15f3f
cf89135
4712b6b
550ebb1
3063af8
376d729
fd0e4d4
9a89761
868e023
9f45f32
578a379
ef078d7
8889fd0
ef8ccd1
058f626
b13b37f
8639716
ec19b79
1d33ec4
d17948b
5f35694
1d52b55
f854a53
1857464
a243d10
8efc471
04d89a8
f3a4f8e
6cf0f73
146fbd8
ab8963d
ab04330
0aeeacb
76cdfc3
22dd059
12b3431
7352b98
c363ad3
6ffb132
3cdc19e
37f43f2
8118f53
eb34d0a
a176ca5
63aa46e
4d2f565
82f2e31
9e61dd0
b0980a0
d620c42
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,7 +88,7 @@ class SymbolTableBuilder | |
std::unique_ptr<TypeInference> & getTypeInference(); | ||
|
||
/// Forward collect all possible infer sites starting from a value | ||
const Type* fwGetOrInferLLVMObjType(const Value *startValue); | ||
const Type* getOrInferLLVMObjType(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. InferObjType |
||
|
||
/// Get the reference type of heap/static object from an allocation site. | ||
//@{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,11 +64,8 @@ class TypeInference { | |
return _typeInference; | ||
} | ||
|
||
/// Forward collect all possible infer sites starting from a value | ||
const Type *fwGetOrInferLLVMObjType(const Value *startValue); | ||
|
||
/// Backward collect all possible sources starting from a value | ||
Set<const Value*> bwGetOrfindSourceVals(const Value * startValue); | ||
/// get or infer the type of a value | ||
const Type *getOrInferLLVMObjType(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. InferObjType |
||
|
||
/// Validate type inference | ||
void validateTypeCheck(const CallBase *cs); | ||
|
@@ -78,16 +75,23 @@ class TypeInference { | |
void typeDiffTest(const PointerType *oPTy, const Type *iTy, const Value *val); | ||
|
||
/// Default type | ||
const Type *defaultTy(const Value *val); | ||
static const Type *defaultTy(const Value *val); | ||
|
||
inline static const Type *defaultPtrTy() { | ||
return PointerType::getUnqual(LLVMModuleSet::getLLVMModuleSet()->getContext()); | ||
} | ||
|
||
private: | ||
|
||
/// 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); | ||
|
||
static const Type *infersiteToType(const Value *val); | ||
|
||
inline bool isSourceVal(const Value* val) const { | ||
inline bool isSourceVal(const Value *val) const { | ||
return LLVMUtil::isObject(val) || SVFUtil::isa<GetElementPtrInst>(val); | ||
} | ||
|
||
|
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.
manual release