source: src/SymTab/ManglerCommon.cc @ d1e0979

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprno_listpersistent-indexerpthread-emulationqualifiedEnum
Last change on this file since d1e0979 was d1e0979, checked in by Rob Schluntz <rschlunt@…>, 5 years ago

Add a basic demangler that works for basic types, pointers, tuples, and functions

  • Property mode set to 100644
File size: 1.7 KB
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// Mangler.h --
8//
9// Author           : Richard C. Bilson
10// Created On       : Sun May 17 21:44:03 2015
11// Last Modified By : Peter A. Buhr
12// Last Modified On : Sat Jul 22 09:45:30 2017
13// Update Count     : 15
14//
15
16#include "Mangler.h"
17#include "SynTree/Type.h"
18
19namespace SymTab {
20        namespace Mangler {
21                const char * btLetter[] = {
22                        "b",  // Bool
23                        "c",  // Char
24                        "Sc", // SignedChar
25                        "Uc", // UnsignedChar
26                        "s",  // ShortSignedInt
27                        "Us", // ShortUnsignedInt
28                        "i",  // SignedInt
29                        "Ui", // UnsignedInt
30                        "l",  // LongSignedInt
31                        "Ul", // LongUnsignedInt
32                        "q",  // LongLongSignedInt
33                        "Uq", // LongLongUnsignedInt
34                        "f",  // Float
35                        "d",  // Double
36                        "r",  // LongDouble
37                        "Xf", // FloatComplex
38                        "Xd", // DoubleComplex
39                        "Xr", // LongDoubleComplex
40                        "If", // FloatImaginary
41                        "Id", // DoubleImaginary
42                        "Ir", // LongDoubleImaginary
43                        "w",  // SignedInt128
44                        "Uw", // UnsignedInt128
45                        "x",  // Float80
46                        "y",  // Float128
47                };
48                const int numBtLetter = sizeof(btLetter)/sizeof(btLetter[0]);
49                static_assert(
50                        numBtLetter == BasicType::NUMBER_OF_BASIC_TYPES,
51                        "Each basic type kind should have a corresponding mangler letter"
52                );
53
54                const std::map<int, const char *> qualifierLetter = {
55                        { Type::Const, "C" },
56                        { Type::Volatile, "V" },
57                        { Type::Atomic, "A" }, // A = Atomic, A0 = Array and forall parameter...
58                        { Type::Mutex, "M" },
59                        { Type::Lvalue, "L" },
60                };
61
62                const std::string nameSeparator = "__cfa__";
63        } // namespace Mangler
64} // namespace SymTab
Note: See TracBrowser for help on using the repository browser.