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 735 of file CppUtil.cpp.
737 typedef std::pair<u32_t, u32_t> StEdIdxPair;
738 std::stack<int> stack;
739 std::vector<StEdIdxPair> innerMostPairs;
740 std::vector<bool> used(input.length(),
false);
742 for (
u32_t i = 0; i < input.length(); ++i)
748 else if (input[i] ==
'>' && i > 0 && input[i - 1] !=
'-')
752 int openIndex = stack.top();
756 bool isInnermost =
true;
757 for (
u32_t j = openIndex + 1; j < i && isInnermost; ++j)
767 innerMostPairs.emplace_back(openIndex, i);
768 used[openIndex] = used[i] =
true;
773 std::vector<std::string> ans(innerMostPairs.size());
774 std::transform(innerMostPairs.begin(), innerMostPairs.end(), ans.begin(), [&input](StEdIdxPair &
p) ->
std::string
776 return input.substr(p.first + 1, p.second - p.first - 1);
◆ getBeforeParenthesis()
Definition at line 107 of file CppUtil.cpp.
109 size_t lastRightParen =
name.rfind(
')');
110 assert(lastRightParen > 0);
112 s32_t paren_num = 1, pos;
113 for (pos = lastRightParen - 1; pos >= 0; pos--)
115 if (
name[pos] ==
')')
117 if (
name[pos] ==
'(')
122 return name.substr(0, pos);
◆ handleThunkFunction()
Definition at line 146 of file CppUtil.cpp.
161 for (
unsigned i = 0; i < thunkPrefixes.size(); i++)
163 auto prefix = thunkPrefixes[i];
164 if (dname.
className.size() > prefix.size() &&
165 dname.
className.compare(0, prefix.size(), prefix) == 0)
const std::string VThunkFuncLabel
const std::string NVThunkFunLabel
◆ isOperOverload()
Definition at line 84 of file CppUtil.cpp.
86 u32_t leftnum = 0, rightnum = 0;
88 size_t leftpos, rightpos;
89 leftpos = subname.find(
'<');
90 while (leftpos != std::string::npos)
92 subname = subname.substr(leftpos + 1);
93 leftpos = subname.find(
'<');
97 rightpos = subname.find(
'>');
98 while (rightpos != std::string::npos)
100 subname = subname.substr(rightpos + 1);
101 rightpos = subname.find(
'>');
104 return leftnum != rightnum;
◆ splitAndStrip()
Definition at line 800 of file CppUtil.cpp.
802 std::vector<std::string> tokens;
803 size_t start = 0, end = 0;
805 while ((end = input.find(delimiter, start)) != std::string::npos)
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 472 of file CppUtil.cpp.
476 size_t colon = dname.
className.rfind(
"::");
477 if (colon == std::string::npos)
std::string getBeforeBrackets(const std::string &name)
◆ stripWhitespaces()
strip off the whitespaces from the beginning and ending of str
- Parameters
-
- Returns
Definition at line 786 of file CppUtil.cpp.
788 auto start = std::find_if(str.begin(), str.end(), [](
unsigned char ch)
790 return !std::isspace(ch);
792 auto end = std::find_if(str.rbegin(), str.rend(), [](
unsigned char ch)
794 return !std::isspace(ch);
◆ clsName
◆ dyncast
◆ NVThunkFunLabel
const std::string NVThunkFunLabel = "non-virtual thunk to " |
◆ structName
◆ vfunPreLabel
◆ vtableType
◆ vtblLabelAfterDemangle
◆ vtblLabelBeforeDemangle
◆ VThunkFuncLabel
const std::string VThunkFuncLabel = "virtual thunk to " |
◆ zn1Label
◆ znk9Label
◆ znkLabel
◆ znkst20Label
◆ znkst23Label
◆ znkst5Label
◆ znkstLabel
◆ znst12Label
◆ znst14Label
◆ znst5Label
◆ znst6Label
◆ znst7Label
◆ znstLabel
◆ znwm
◆ ztilabel
◆ ztiprefix