return BOS.str();
}
+static std::string getMangledName(std::unique_ptr<MangleContext> &M,
+ std::unique_ptr<llvm::DataLayout> &DL,
+ const NamedDecl *ND) {
+ std::string FrontendBuf;
+ llvm::raw_string_ostream FOS(FrontendBuf);
+
+ M->mangleName(ND, FOS);
+
+ std::string BackendBuf;
+ llvm::raw_string_ostream BOS(BackendBuf);
+
+ llvm::Mangler::getNameWithPrefix(BOS, llvm::Twine(FOS.str()), *DL);
+
+ return BOS.str();
+}
+
+static std::string getMangledThunk(std::unique_ptr<MangleContext> &M,
+ std::unique_ptr<llvm::DataLayout> &DL,
+ const CXXMethodDecl *MD,
+ const ThunkInfo &T) {
+ std::string FrontendBuf;
+ llvm::raw_string_ostream FOS(FrontendBuf);
+
+ M->mangleThunk(MD, T, FOS);
+
+ std::string BackendBuf;
+ llvm::raw_string_ostream BOS(BackendBuf);
+
+ llvm::Mangler::getNameWithPrefix(BOS, llvm::Twine(FOS.str()), *DL);
+
+ return BOS.str();
+}
+
extern "C" {
unsigned clang_visitChildren(CXCursor parent,
return cxstring::createDup(FinalBufOS.str());
}
-static std::string getMangledName(std::unique_ptr<MangleContext> &M,
- std::unique_ptr<llvm::DataLayout> &DL,
- const NamedDecl *ND) {
- std::string FrontendBuf;
- llvm::raw_string_ostream FOS(FrontendBuf);
-
- M->mangleName(ND, FOS);
-
- std::string BackendBuf;
- llvm::raw_string_ostream BOS(BackendBuf);
-
- llvm::Mangler::getNameWithPrefix(BOS, llvm::Twine(FOS.str()), *DL);
-
- return BOS.str();
-}
-
-static std::string getMangledThunk(std::unique_ptr<MangleContext> &M,
- std::unique_ptr<llvm::DataLayout> &DL,
- const CXXMethodDecl *MD, const ThunkInfo &T) {
- std::string FrontendBuf;
- llvm::raw_string_ostream FOS(FrontendBuf);
-
- M->mangleThunk(MD, T, FOS);
-
- std::string BackendBuf;
- llvm::raw_string_ostream BOS(BackendBuf);
-
- llvm::Mangler::getNameWithPrefix(BOS, llvm::Twine(FOS.str()), *DL);
-
- return BOS.str();
-}
-
CXStringSet *clang_Cursor_getCXXManglings(CXCursor C) {
if (clang_isInvalid(C.kind) || !clang_isDeclaration(C.kind))
return nullptr;