LLVM API Documentation

llvm::Mangler Class Reference

#include <Mangler.h>

Collaboration diagram for llvm::Mangler:
[legend]

List of all members.

Public Member Functions

 Mangler (Module &M, const char *Prefix="", const char *privatePrefix="")
void setUseQuotes (bool Val)
void setPreserveAsmNames (bool Val)
void markCharAcceptable (unsigned char X)
void markCharUnacceptable (unsigned char X)
bool isCharAcceptable (unsigned char X) const
std::string getValueName (const GlobalValue *V, const char *Suffix="")
std::string getValueName (const Value *V)
std::string makeNameProper (const std::string &x, const char *Prefix="")


Detailed Description

Definition at line 27 of file Mangler.h.


Constructor & Destructor Documentation

Mangler::Mangler ( Module &  M,
const char *  Prefix = "",
const char *  privatePrefix = "" 
)

Definition at line 161 of file Mangler.cpp.

References llvm::array_endof(), markCharAcceptable(), and X.


Member Function Documentation

void llvm::Mangler::setUseQuotes ( bool  Val  )  [inline]

setUseQuotes - If UseQuotes is set to true, this target accepts quoted strings for assembler labels.

Definition at line 66 of file Mangler.h.

Referenced by llvm::X86ATTAsmPrinter::doInitialization().

void llvm::Mangler::setPreserveAsmNames ( bool  Val  )  [inline]

setPreserveAsmNames - If the mangler should not strip off the asm name

identifier (\001), this should be set. 

Definition at line 70 of file Mangler.h.

void llvm::Mangler::markCharAcceptable ( unsigned char  X  )  [inline]

Acceptable Characters - This allows the target to specify which characters are acceptable to the assembler without being mangled. By default we allow letters, numbers, '_', '$', and '.', which is what GAS accepts.

Definition at line 75 of file Mangler.h.

Referenced by Mangler().

void llvm::Mangler::markCharUnacceptable ( unsigned char  X  )  [inline]

Definition at line 78 of file Mangler.h.

Referenced by llvm::X86IntelAsmPrinter::doInitialization().

bool llvm::Mangler::isCharAcceptable ( unsigned char  X  )  const [inline]

Definition at line 81 of file Mangler.h.

Referenced by makeNameProper().

std::string Mangler::getValueName ( const GlobalValue *  V,
const char *  Suffix = "" 
)

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

Definition at line 118 of file Mangler.cpp.

References llvm::Value::getType(), getValueName(), GV, Name, and llvm::utostr().

std::string Mangler::makeNameProper ( const std::string &  X,
const char *  Prefix = "" 
)

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.

makeNameProper - We don't want identifier names non-C-identifier characters in them, so mangle them as appropriate.

Definition at line 34 of file Mangler.cpp.

References E, isCharAcceptable(), and MangleLetter().

Referenced by llvm::X86ATTAsmPrinter::doFinalization(), llvm::AsmPrinter::getCurrentFunctionEHName(), getValueName(), and llvm::X86ATTAsmPrinter::runOnMachineFunction().


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