36 cl::desc(
"Emit data into separate sections"),
40 cl::desc(
"Emit functions into separate sections"),
47 TargetMachine::TargetMachine(
const Target &
T,
50 : TheTarget(T), TargetTriple(TT), TargetCPU(CPU), TargetFS(FS),
51 CodeGenInfo(0), AsmInfo(0),
54 MCSaveTempLabels(
false),
57 MCUseDwarfDirectory(
false),
71 #define RESET_OPTION(X, Y) \
73 if (F->hasFnAttribute(Y)) \
75 (F->getAttributes(). \
76 getAttribute(AttributeSet::FunctionIndex, \
77 Y).getValueAsString() == "true"); \
80 RESET_OPTION(NoFramePointerElim,
"no-frame-pointer-elim");
81 RESET_OPTION(LessPreciseFPMADOption,
"less-precise-fpmad");
126 if (
const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV))
127 GV = GA->resolveAliasedGlobal(
false);
139 if (isPIC && !isPIE) {
140 if (isLocal || isHidden)
145 if (!isDeclaration || isHidden)
153 if (SelectedModel > Model)
154 return SelectedModel;
CodeModel::Model getCodeModel() const
ThreadLocalMode getThreadLocalMode() const
Reloc::Model getRelocationModel() const
static cl::opt< bool > DataSections("fdata-sections", cl::desc("Emit data into separate sections"), cl::init(false))
const Function * getFunction() const
void resetTargetOptions(const MachineFunction *MF) const
Reset the target options based on the function's attributes.
void setOptLevel(CodeGenOpt::Level Level) const
Overrides the optimization level.
#define llvm_unreachable(msg)
static bool isDeclaration(const GlobalValue &V)
isDeclaration - Return 'true' if the global value is a declaration.
#define RESET_OPTION(X, Y)
bool AsmVerbosityDefault(false)
const MCAsmInfo * AsmInfo
static TLSModel::Model getSelectedTLSModel(const GlobalVariable *Var)
Get the IR-specified TLS model for Var.
Reloc::Model getRelocationModel() const
CodeGenOpt::Level getOptLevel() const
initializer< Ty > init(const Ty &Val)
CodeModel::Model getCodeModel() const
bool hasHiddenVisibility() const
static bool getAsmVerbosityDefault()
static bool getDataSections()
static bool getFunctionSections()
static void setAsmVerbosityDefault(bool)
CodeGenOpt::Level getOptLevel() const
static cl::opt< bool > FunctionSections("ffunction-sections", cl::desc("Emit functions into separate sections"), cl::init(false))
MCCodeGenInfo * CodeGenInfo
cl::opt< bool > DisableTailCalls("disable-tail-calls", cl::desc("Never emit tail calls"), cl::init(false))
void setOptLevel(CodeGenOpt::Level Level)
bool isDeclaration() const
unsigned PositionIndependentExecutable
const TargetMachine & getTarget() const
bool hasLocalLinkage() const
TLSModel::Model getTLSModel(const GlobalValue *GV) const
static void setDataSections(bool)
setDataSections - Set if the data are emit into separate sections.
static void setFunctionSections(bool)