Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVFType.cpp
Go to the documentation of this file.
1#include "SVFIR/SVFType.h"
2#include <sstream>
3
4namespace SVF
5{
6
7SVFType* SVFType::svfI8Ty = nullptr;
8SVFType* SVFType::svfPtrTy = nullptr;
9
11std::string SVFType::toString() const
12{
13 std::ostringstream os;
14 print(os);
15 return os.str();
16}
17
18std::ostream& operator<<(std::ostream& os, const SVFType& type)
19{
20 type.print(os);
21 return os;
22}
23
24void SVFPointerType::print(std::ostream& os) const
25{
26 os << "ptr";
27}
28
29void SVFIntegerType::print(std::ostream& os) const
30{
31 if (signAndWidth < 0)
32 os << 'i' << -signAndWidth;
33 else
34 os << 'u' << signAndWidth;
35}
36
37void SVFFunctionType::print(std::ostream& os) const
38{
39 os << *getReturnType() << "()";
40}
41
42void SVFStructType::print(std::ostream& os) const
43{
44 os << "S." << name;
45}
46
47void SVFArrayType::print(std::ostream& os) const
48{
49 os << '[' << numOfElement << 'x' << *typeOfElement << ']';
50}
51
52void SVFOtherType::print(std::ostream& os) const
53{
54 os << repr;
55}
56
57} // namespace SVF
newitem type
Definition cJSON.cpp:2739
const SVFType * typeOfElement
For printing & debugging.
Definition SVFType.h:384
unsigned numOfElement
Definition SVFType.h:383
void print(std::ostream &os) const override
Definition SVFType.cpp:47
const SVFType * getReturnType() const
Definition SVFType.h:336
void print(std::ostream &os) const override
Definition SVFType.cpp:37
short signAndWidth
For printing.
Definition SVFType.h:297
void print(std::ostream &os) const override
Definition SVFType.cpp:29
void print(std::ostream &os) const override
Definition SVFType.cpp:52
std::string repr
Definition SVFType.h:423
void print(std::ostream &os) const override
Definition SVFType.cpp:24
std::string name
Field for printing & debugging.
Definition SVFType.h:351
void print(std::ostream &os) const override
Definition SVFType.cpp:42
static SVFType * svfPtrTy
ptr type
Definition SVFType.h:192
std::string toString() const
static SVFType * svfI8Ty
8-bit int type
Definition SVFType.h:193
virtual void print(std::ostream &os) const =0
for isBitcode
Definition BasicTypes.h:68
__attribute__((weak)) std
Definition SVFType.cpp:10
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74
IntervalValue operator<<(const IntervalValue &lhs, const IntervalValue &rhs)
Left binary shift of IntervalValues.