13#ifndef FORTRAN_LOWER_MANGLER_H
14#define FORTRAN_LOWER_MANGLER_H
16#include "flang/Evaluate/expression.h"
17#include "flang/Optimizer/Dialect/FIRType.h"
18#include "mlir/IR/BuiltinTypes.h"
19#include "llvm/ADT/StringRef.h"
34namespace lower::mangle {
36using ScopeBlockIdMap =
37 llvm::DenseMap<Fortran::semantics::Scope *, std::int64_t>;
45std::string mangleName(
const semantics::Symbol &, ScopeBlockIdMap &,
46 bool keepExternalInScope =
false,
47 bool underscoring =
true);
48std::string mangleName(
const semantics::Symbol &,
49 bool keepExternalInScope =
false,
50 bool underscoring =
true);
53std::string mangleName(
const semantics::DerivedTypeSpec &, ScopeBlockIdMap &);
60std::string demangleName(llvm::StringRef name);
63mangleArrayLiteral(
size_t size,
64 const Fortran::evaluate::ConstantSubscripts &shape,
65 Fortran::common::TypeCategory cat,
int kind = 0,
66 Fortran::common::ConstantSubscript charLen = -1,
67 llvm::StringRef derivedName = {});
69template <Fortran::common::TypeCategory TC,
int KIND>
70std::string mangleArrayLiteral(
73 return mangleArrayLiteral(x.values().size() *
sizeof(x.values()[0]),
79mangleArrayLiteral(mlir::Type,
81 Fortran::common::TypeCategory::Character, KIND>> &x) {
82 return mangleArrayLiteral(x.values().size() *
sizeof(x.values()[0]),
83 x.shape(), Fortran::common::TypeCategory::Character,
87inline std::string mangleArrayLiteral(
90 return mangleArrayLiteral(x.values().size() *
sizeof(x.values()[0]),
91 x.shape(), Fortran::common::TypeCategory::Derived,
93 mlir::cast<fir::RecordType>(eleTy).getName());
Definition: constant.h:141
Definition: bit-population-count.h:20