Changes in / [6b419ce:fe293bf]


Ignore:
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Demangle.cc

    r6b419ce rfe293bf  
    99// Author           : Rob Schluntz
    1010// Created On       : Thu Jul 19 12:52:41 2018
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Nov  6 15:59:00 2023
    13 // Update Count     : 12
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Jan 11 21:28:27 2021
     13// Update Count     : 11
    1414//
    1515
     
    1818
    1919#include "CodeGen/GenType.h"
    20 #include "CodeGen/OperatorTable.h"
    2120#include "Common/PassVisitor.h"
    2221#include "Common/utility.h"                                                             // isPrefix
     
    606605                                Type * type = nullptr;
    607606                                if (! view.parse(name, type)) return mangleName;
    608                                 auto info = CodeGen::operatorLookupByOutput(name);
    609                                 if (info) name = info->inputName;
    610607                                std::unique_ptr<Type> manager(type);
    611608                                return genDemangleType(type, name);
  • src/SymTab/Demangle.h

    r6b419ce rfe293bf  
    1010// Created On       : Fri May 13 10:11:00 2022
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Nov  6 15:48:00 2023
    13 // Update Count     : 1
     12// Last Modified On : Fri May 13 10:30:00 2022
     13// Update Count     : 0
    1414//
    1515
     
    1717
    1818extern "C" {
    19         /// Main interface to the demangler as a utility.
    20         /// Caller must free the returned string.
    2119        char * cforall_demangle(const char *, int);
    2220}
  • src/SymTab/demangler.cc

    r6b419ce rfe293bf  
    22#include <iostream>
    33#include <fstream>
     4using namespace std;
    45
    5 void demangleAndPrint(const std::string & mangleName) {
     6void f(const std::string & mangleName) {
    67        char * demangleName = cforall_demangle(mangleName.c_str(), 0);
    7         std::cout << mangleName << " => " << demangleName << std::endl;
     8        cout << mangleName << " => " << std::flush << demangleName << endl;
    89        free(demangleName);
    910}
    1011
    11 int main(int argc, char * argv[]) {
    12         char const * fileName = (1 < argc) ? argv[1] : "in-demangle.txt";
    13         std::ifstream in(fileName);
    14 
     12int main() {
     13        ifstream in("in-demangle.txt");
    1514        std::string 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                 }
     15        while (getline(in, line)) {
     16                if (line.empty()) { cout << "=================================" << endl; continue; }
     17                else if (line[0] == '#') continue;
     18                f(line);
    2419        }
    2520}
Note: See TracChangeset for help on using the changeset viewer.