Go to the source code of this file.
◆ findInnermostBrackets()
find the innermost brackets, e.g., return "int const, A" for "__gnu_cxx::__aligned_membuf<std::pair<int const, A> >::_M_ptr() const"
- Parameters
-
- Returns
Definition at line 746 of file CppUtil.cpp.
747{
749 std::stack<int>
stack;
751 std::vector<bool>
used(
input.length(),
false);
752
754 {
756 {
758 }
760 {
762 {
765
766
769 {
771 {
773 }
774 }
775
777 {
780 }
781 }
782 }
783 }
786 {
787 return input.substr(p.first + 1, p.second - p.first - 1);
788 });
790}
llvm::IRBuilder IRBuilder
◆ getBeforeParenthesis()
Definition at line 107 of file CppUtil.cpp.
108{
111
114 {
120 break;
121 }
123}
◆ handleThunkFunction()
Definition at line 146 of file CppUtil.cpp.
147{
148
149
150
151
152
153
154
155
156
157
160 };
162 {
166 {
168 dname.isThunkFunc =
true;
169 return;
170 }
171 }
172}
const std::string VThunkFuncLabel
const std::string NVThunkFunLabel
◆ isDerivedFromThisPtr()
Check if V is derived from thisPtr Handles O0 pattern: this1 = load ptr, ptr this.addr
Definition at line 362 of file CppUtil.cpp.
363{
364 V =
V->stripPointerCasts();
366 return true;
367
368 if (
const LoadInst* load = SVFUtil::dyn_cast<LoadInst>(
V))
369 {
371 SVFUtil::dyn_cast<AllocaInst>(load->getPointerOperand()))
372 {
374 {
375 if (
const StoreInst* store = SVFUtil::dyn_cast<StoreInst>(
U))
376 {
377 if (store->getPointerOperand() ==
alloca &&
378 store->getValueOperand()->stripPointerCasts() ==
thisPtr)
379 return true;
380 }
381 }
382 }
383 }
384 return false;
385}
llvm::AllocaInst AllocaInst
llvm::StoreInst StoreInst
◆ isOperOverload()
Definition at line 84 of file CppUtil.cpp.
85{
90 while (
leftpos != std::string::npos)
91 {
95 }
98 while (
rightpos != std::string::npos)
99 {
103 }
105}
◆ splitAndStrip()
Definition at line 811 of file CppUtil.cpp.
812{
813 std::vector<std::string>
tokens;
814 size_t start = 0, end = 0;
815
817 {
819 start = end + 1;
820 }
821
823
825}
std::string stripWhitespaces(const std::string &str)
◆ stripBracketsAndNamespace()
strip off brackets and namespace from classname e.g., for ‘namespace::A<...::...>::f’, we get ‘A’ by stripping off namespace and <>
Definition at line 484 of file CppUtil.cpp.
485{
489 if (
colon == std::string::npos)
490 {
492 }
493 else
494 {
495
498 }
499}
std::string getBeforeBrackets(const std::string &name)
◆ stripWhitespaces()
strip off the whitespaces from the beginning and ending of str
- Parameters
-
- Returns
Definition at line 797 of file CppUtil.cpp.
798{
799 auto start = std::find_if(
str.begin(),
str.end(), [](
unsigned char ch)
800 {
801 return !std::isspace(ch);
802 });
803 auto end = std::find_if(
str.rbegin(),
str.rend(), [](
unsigned char ch)
804 {
805 return !std::isspace(ch);
806 }).base();
807
808 return (start < end) ? std::string(start, end) : std::
string();
809}
◆ clsName
◆ dyncast
◆ NVThunkFunLabel
◆ structName
◆ vfunPreLabel
◆ vtableType
◆ vtblLabelAfterDemangle
◆ vtblLabelBeforeDemangle
◆ VThunkFuncLabel
◆ zn1Label
◆ znk9Label
◆ znkLabel
◆ znkst20Label
◆ znkst23Label
◆ znkst5Label
◆ znkstLabel
◆ znst12Label
◆ znst14Label
◆ znst5Label
◆ znst6Label
◆ znst7Label
◆ znstLabel
◆ znwm
◆ ztilabel
◆ ztiprefix