LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

llvm::Mangler Class Reference

#include <Mangler.h>

Collaboration diagram for llvm::Mangler:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Mangler (Module &M, const char *Prefix="")
unsigned getTypeID (const Type *Ty)
std::string getValueName (const Value *V)

Static Public Member Functions

static std::string makeNameProper (const std::string &x)

Detailed Description

Definition at line 27 of file Mangler.h.


Constructor & Destructor Documentation

Mangler::Mangler Module M,
const char *  Prefix = ""
 

Definition at line 117 of file Mangler.cpp.

References llvm::Module::begin(), E, llvm::Module::end(), llvm::Module::gbegin(), llvm::Module::gend(), I, and M.


Member Function Documentation

unsigned Mangler::getTypeID const Type Ty  ) 
 

getTypeID - Return a unique ID for the specified LLVM type.

Definition at line 51 of file Mangler.cpp.

References E.

Referenced by getValueName().

std::string Mangler::getValueName const Value V  ) 
 

getValueName - Returns the mangled name of V, an LLVM Value, in the current module.

Definition at line 58 of file Mangler.cpp.

References llvm::Value::getName(), llvm::Value::getType(), getTypeID(), llvm::Value::hasName(), makeNameProper(), name, llvm::cl::Prefix, and llvm::utostr().

Referenced by llvm::AsmPrinter::emitConstantValueOnly(), and llvm::AsmPrinter::setupMachineFunction().

std::string Mangler::makeNameProper const std::string &  x  )  [static]
 

makeNameProper - We don't want identifier names with ., space, or

  • in them, so we mangle these characters into the strings "d_", "s_", and "D_", respectively. This is a very simple mangling that doesn't guarantee unique names for values. getValueName already does this for you, so there's no point calling it on the result from getValueName.

Definition at line 31 of file Mangler.cpp.

References E, I, and MangleLetter().

Referenced by getValueName().


The documentation for this class was generated from the following files: