Changeset c649d2c
- Timestamp:
- Nov 6, 2023, 4:33:44 PM (14 months ago)
- Branches:
- master
- Children:
- 6b419ce
- Parents:
- 0d41b2e
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Demangle.cc
r0d41b2e rc649d2c 9 9 // Author : Rob Schluntz 10 10 // Created On : Thu Jul 19 12:52:41 2018 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon Jan 11 21:28:27 202113 // Update Count : 1 111 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Nov 6 15:59:00 2023 13 // Update Count : 12 14 14 // 15 15 … … 18 18 19 19 #include "CodeGen/GenType.h" 20 #include "CodeGen/OperatorTable.h" 20 21 #include "Common/PassVisitor.h" 21 22 #include "Common/utility.h" // isPrefix … … 605 606 Type * type = nullptr; 606 607 if (! view.parse(name, type)) return mangleName; 608 auto info = CodeGen::operatorLookupByOutput(name); 609 if (info) name = info->inputName; 607 610 std::unique_ptr<Type> manager(type); 608 611 return genDemangleType(type, name); -
src/SymTab/Demangle.h
r0d41b2e rc649d2c 10 10 // Created On : Fri May 13 10:11:00 2022 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri May 13 10:30:00 202213 // Update Count : 012 // Last Modified On : Mon Nov 6 15:48:00 2023 13 // Update Count : 1 14 14 // 15 15 … … 17 17 18 18 extern "C" { 19 /// Main interface to the demangler as a utility. 20 /// Caller must free the returned string. 19 21 char * cforall_demangle(const char *, int); 20 22 } -
src/SymTab/demangler.cc
r0d41b2e rc649d2c 2 2 #include <iostream> 3 3 #include <fstream> 4 using namespace std;5 4 6 void f(const std::string & mangleName) {5 void demangleAndPrint(const std::string & mangleName) { 7 6 char * demangleName = cforall_demangle(mangleName.c_str(), 0); 8 cout << mangleName << " => " << std::flush << demangleName <<endl;7 std::cout << mangleName << " => " << demangleName << std::endl; 9 8 free(demangleName); 10 9 } 11 10 12 int main() { 13 ifstream in("in-demangle.txt"); 11 int main(int argc, char * argv[]) { 12 char const * fileName = (1 < argc) ? argv[1] : "in-demangle.txt"; 13 std::ifstream in(fileName); 14 14 15 std::string line; 15 while (getline(in, line)) { 16 if (line.empty()) { cout << "=================================" << endl; continue; } 17 else if (line[0] == '#') continue; 18 f(line); 16 while (std::getline(in, line)) { 17 if (line.empty()) { 18 std::cout << "=================================" << std::endl; 19 } else if (line[0] == '#') { 20 continue; 21 } else { 22 demangleAndPrint(line); 23 } 19 24 } 20 25 }
Note: See TracChangeset
for help on using the changeset viewer.