mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
Move resetTargetOptions from taking a MachineFunction to a Function
since we are accessing the TargetMachine that we're a member function of. llvm-svn: 218489
This commit is contained in:
parent
7bca916f1f
commit
3b65e1ff31
@ -114,7 +114,7 @@ public:
|
||||
}
|
||||
|
||||
/// \brief Reset the target options based on the function's attributes.
|
||||
void resetTargetOptions(const MachineFunction *MF) const;
|
||||
void resetTargetOptions(const Function &F) const;
|
||||
|
||||
/// getMCAsmInfo - Return target specific asm information.
|
||||
///
|
||||
|
@ -421,7 +421,7 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
|
||||
LibInfo = &getAnalysis<TargetLibraryInfo>();
|
||||
GFI = Fn.hasGC() ? &getAnalysis<GCModuleInfo>().getFunctionInfo(Fn) : nullptr;
|
||||
|
||||
TM.resetTargetOptions(MF);
|
||||
TM.resetTargetOptions(Fn);
|
||||
|
||||
// Reset OptLevel to None for optnone functions.
|
||||
CodeGenOpt::Level NewOptLevel = OptLevel;
|
||||
|
@ -48,17 +48,13 @@ TargetMachine::~TargetMachine() {
|
||||
}
|
||||
|
||||
/// \brief Reset the target options based on the function's attributes.
|
||||
void TargetMachine::resetTargetOptions(const MachineFunction *MF) const {
|
||||
const Function *F = MF->getFunction();
|
||||
TargetOptions &TO = MF->getTarget().Options;
|
||||
|
||||
#define RESET_OPTION(X, Y) \
|
||||
do { \
|
||||
if (F->hasFnAttribute(Y)) \
|
||||
TO.X = \
|
||||
(F->getAttributes(). \
|
||||
getAttribute(AttributeSet::FunctionIndex, \
|
||||
Y).getValueAsString() == "true"); \
|
||||
void TargetMachine::resetTargetOptions(const Function &F) const {
|
||||
#define RESET_OPTION(X, Y) \
|
||||
do { \
|
||||
if (F.hasFnAttribute(Y)) \
|
||||
Options.X = (F.getAttributes() \
|
||||
.getAttribute(AttributeSet::FunctionIndex, Y) \
|
||||
.getValueAsString() == "true"); \
|
||||
} while (0)
|
||||
|
||||
RESET_OPTION(NoFramePointerElim, "no-frame-pointer-elim");
|
||||
@ -69,7 +65,7 @@ void TargetMachine::resetTargetOptions(const MachineFunction *MF) const {
|
||||
RESET_OPTION(UseSoftFloat, "use-soft-float");
|
||||
RESET_OPTION(DisableTailCalls, "disable-tail-calls");
|
||||
|
||||
TO.MCOptions.SanitizeAddress = F->hasFnAttribute(Attribute::SanitizeAddress);
|
||||
Options.MCOptions.SanitizeAddress = F.hasFnAttribute(Attribute::SanitizeAddress);
|
||||
}
|
||||
|
||||
/// getRelocationModel - Returns the code generation relocation model. The
|
||||
|
Loading…
Reference in New Issue
Block a user