template <typename T> class SmallVectorImpl;
class MCContext;
class MCSymbol;
+class TargetData;
class Mangler {
public:
private:
MCContext &Context;
+ const TargetData &TD;
/// AnonGlobalIDs - We need to give global values the same name every time
/// they are mangled. This keeps track of the number we give to anonymous
unsigned NextAnonGlobalID;
public:
- Mangler(MCContext &context) : Context(context), NextAnonGlobalID(1) {}
+ Mangler(MCContext &context, const TargetData &td)
+ : Context(context), TD(td), NextAnonGlobalID(1) {}
/// getSymbol - Return the MCSymbol for the specified global value. This
/// symbol is the main label that is the address of the global.
const_cast<TargetLoweringObjectFile&>(getObjFileLowering())
.Initialize(OutContext, TM);
- Mang = new Mangler(OutContext);
+ Mang = new Mangler(OutContext, *TM.getTargetData());
// Allow the target to emit any magic that it wants at the start of the file.
EmitStartOfAsmFile(M);
// Initialize TargetLoweringObjectFile.
const_cast<TargetLoweringObjectFile&>(TLOF).Initialize(OutContext, TM);
- Mang = new Mangler(OutContext);
+ Mang = new Mangler(OutContext, *TM.getTargetData());
// ELF Header
// ----------
#endif
TAsm = new CBEMCAsmInfo();
TCtx = new MCContext(*TAsm);
- Mang = new Mangler(*TCtx);
+ Mang = new Mangler(*TCtx, *TD);
// Keep track of which functions are static ctors/dtors so they can have
// an attribute added to their prototypes.
// mark which symbols can not be internalized
if (!_mustPreserveSymbols.empty()) {
MCContext Context(*_target->getMCAsmInfo());
- Mangler mangler(Context);
+ Mangler mangler(Context, *_target->getTargetData());
std::vector<const char*> mustPreserveList;
for (Module::iterator f = mergedModule->begin(),
e = mergedModule->end(); f != e; ++f) {
// Use mangler to add GlobalPrefix to names to match linker names.
MCContext Context(*_target->getMCAsmInfo());
- Mangler mangler(Context);
+ Mangler mangler(Context, *_target->getTargetData());
// add functions
for (Module::iterator f = _module->begin(); f != _module->end(); ++f) {