summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetMachine.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2014-09-26 01:28:10 +0000
committerEric Christopher <echristo@gmail.com>2014-09-26 01:28:10 +0000
commit3976f78247528d7f37006790d7c3c36a7c4d6621 (patch)
tree35765d9442682dbe9f127d65fd4e3ecebdd8b679 /llvm/lib/Target/TargetMachine.cpp
parentb4379f9c2c5de9d407d7a4d989683e2cc2d9fb56 (diff)
downloadbcm5719-llvm-3976f78247528d7f37006790d7c3c36a7c4d6621.tar.gz
bcm5719-llvm-3976f78247528d7f37006790d7c3c36a7c4d6621.zip
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
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/TargetMachine.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index dcb83384693..309e1bf2786 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -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
OpenPOWER on IntegriCloud