Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SVF::cppUtil::ItaniumABI Class Reference

#include <CppUtil.h>

Inheritance diagram for SVF::cppUtil::ItaniumABI:
SVF::cppUtil::CXXABI

Public Member Functions

bool isVtable (const std::string &name) override
 
bool isTypeInfo (const std::string &name) override
 
bool isConstructor (const std::string &name) override
 
bool isDestructor (const std::string &name) override
 
std::string extractClassName (const std::string &name) override
 
DemangledName demangle (const std::string &name) override
 
- Public Member Functions inherited from SVF::cppUtil::CXXABI
virtual ~CXXABI ()=default
 

Detailed Description

Definition at line 66 of file CppUtil.h.

Member Function Documentation

◆ demangle()

DemangledName SVF::cppUtil::ItaniumABI::demangle ( const std::string &  name)
overridevirtual

Implements SVF::cppUtil::CXXABI.

Definition at line 1065 of file CppUtil.cpp.

1066{
1067 DemangledName dname;
1068 dname.isThunkFunc = false;
1069
1070 std::string realnameStr = llvm::demangle(name);
1071 if (realnameStr == name)
1072 {
1073 dname.className = "";
1074 dname.funcName = "";
1075 }
1076 else
1077 {
1079 if (beforeParenthesis.find("::") == std::string::npos ||
1081 {
1082 dname.className = "";
1083 dname.funcName = "";
1084 }
1085 else
1086 {
1088 size_t colon = beforeBracket.rfind("::");
1089 if (colon == std::string::npos)
1090 {
1091 dname.className = "";
1092 dname.funcName = "";
1093 }
1094 else
1095 {
1096 dname.className = beforeParenthesis.substr(0, colon);
1097 dname.funcName = beforeParenthesis.substr(colon + 2);
1098 }
1099 }
1100 }
1101
1103
1104 return dname;
1105}
static void handleThunkFunction(cppUtil::DemangledName &dname)
Definition CppUtil.cpp:146
static bool isOperOverload(const std::string &name)
Definition CppUtil.cpp:84
static std::string getBeforeParenthesis(const std::string &name)
Definition CppUtil.cpp:107
const char *const name
Definition cJSON.h:264
std::string getBeforeBrackets(const std::string &name)
Definition CppUtil.cpp:127
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

◆ extractClassName()

std::string SVF::cppUtil::ItaniumABI::extractClassName ( const std::string &  name)
overridevirtual

Implements SVF::cppUtil::CXXABI.

Definition at line 1050 of file CppUtil.cpp.

1051{
1052 std::string className = "";
1053 std::string realnameStr = llvm::demangle(name);
1054 if (realnameStr != name)
1055 {
1056 if (realnameStr.compare(0, vtblLabelAfterDemangle.size(),
1058 {
1059 className = realnameStr.substr(vtblLabelAfterDemangle.size());
1060 }
1061 }
1062 return className;
1063}
const std::string vtblLabelAfterDemangle
Definition CppUtil.cpp:43

◆ isConstructor()

bool SVF::cppUtil::ItaniumABI::isConstructor ( const std::string &  name)
overridevirtual

Implements SVF::cppUtil::CXXABI.

Definition at line 1017 of file CppUtil.cpp.

1018{
1019 if (name.compare(0, vfunPreLabel.size(), vfunPreLabel) != 0)
1020 {
1021 return false;
1022 }
1024 if (dname.className.size() == 0)
1025 {
1026 return false;
1027 }
1029 return dname.className.size() > 0 && dname.className == dname.funcName;
1030}
void stripBracketsAndNamespace(cppUtil::DemangledName &dname)
Definition CppUtil.cpp:484
const std::string vfunPreLabel
Definition CppUtil.cpp:53
DemangledName demangle(const std::string &name) override
Definition CppUtil.cpp:1065

◆ isDestructor()

bool SVF::cppUtil::ItaniumABI::isDestructor ( const std::string &  name)
overridevirtual

Implements SVF::cppUtil::CXXABI.

Definition at line 1032 of file CppUtil.cpp.

1033{
1034 if (name.compare(0, vfunPreLabel.size(), vfunPreLabel) != 0)
1035 {
1036 return false;
1037 }
1039 if (dname.className.size() == 0)
1040 {
1041 return false;
1042 }
1044 return (dname.className.size() > 0 && dname.funcName.size() > 0 &&
1045 dname.className.size() + 1 == dname.funcName.size() &&
1046 dname.funcName.compare(0, 1, "~") == 0 &&
1047 dname.className.compare(dname.funcName.substr(1)) == 0);
1048}

◆ isTypeInfo()

bool SVF::cppUtil::ItaniumABI::isTypeInfo ( const std::string &  name)
overridevirtual

Implements SVF::cppUtil::CXXABI.

Definition at line 1012 of file CppUtil.cpp.

1013{
1014 return name.compare(0, ztilabel.size(), ztilabel) == 0;
1015}
const std::string ztilabel
Definition CppUtil.cpp:79

◆ isVtable()

bool SVF::cppUtil::ItaniumABI::isVtable ( const std::string &  name)
overridevirtual

Implements SVF::cppUtil::CXXABI.

Definition at line 1006 of file CppUtil.cpp.

1007{
1008 return name.compare(0, vtblLabelBeforeDemangle.size(),
1010}
const std::string vtblLabelBeforeDemangle
Definition CppUtil.cpp:50

The documentation for this class was generated from the following files: