From 8093f4b9bb0d22a20dd37ac932003c4ddbdd453a Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 12 Feb 2015 21:16:34 +0000 Subject: [PATCH] Remove mostly unused setters. Most of the code was setting the TargetOptions directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228961 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Target/TargetMachine.h | 33 ++++++++++++----------------- lib/Target/TargetMachine.cpp | 24 --------------------- lib/Target/TargetMachineC.cpp | 2 +- 3 files changed, 15 insertions(+), 44 deletions(-) diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h index acce1d25d5c..028f9e2347b 100644 --- a/include/llvm/Target/TargetMachine.h +++ b/include/llvm/Target/TargetMachine.h @@ -165,28 +165,23 @@ public: bool shouldPrintMachineCode() const { return Options.PrintMachineCode; } - /// getAsmVerbosityDefault - Returns the default value of asm verbosity. + /// Returns the default value of asm verbosity. /// - bool getAsmVerbosityDefault() const ; + bool getAsmVerbosityDefault() const { + return Options.MCOptions.AsmVerbose; + } - /// setAsmVerbosityDefault - Set the default value of asm verbosity. Default - /// is false. - void setAsmVerbosityDefault(bool); + /// Return true if data objects should be emitted into their own section, + /// corresponds to -fdata-sections. + bool getDataSections() const { + return Options.DataSections; + } - /// getDataSections - Return true if data objects should be emitted into their - /// own section, corresponds to -fdata-sections. - bool getDataSections() const; - - /// getFunctionSections - Return true if functions should be emitted into - /// their own section, corresponding to -ffunction-sections. - bool getFunctionSections() const; - - /// setDataSections - Set if the data are emit into separate sections. - void setDataSections(bool); - - /// setFunctionSections - Set if the functions are emit into separate - /// sections. - void setFunctionSections(bool); + /// Return true if functions should be emitted into their own section, + /// corresponding to -ffunction-sections. + bool getFunctionSections() const { + return Options.FunctionSections; + } /// \brief Get a \c TargetIRAnalysis appropriate for the target. /// diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp index 1bd99eac7dc..7f44e8b93ce 100644 --- a/lib/Target/TargetMachine.cpp +++ b/lib/Target/TargetMachine.cpp @@ -148,30 +148,6 @@ void TargetMachine::setOptLevel(CodeGenOpt::Level Level) const { CodeGenInfo->setOptLevel(Level); } -bool TargetMachine::getAsmVerbosityDefault() const { - return Options.MCOptions.AsmVerbose; -} - -void TargetMachine::setAsmVerbosityDefault(bool V) { - Options.MCOptions.AsmVerbose = V; -} - -bool TargetMachine::getFunctionSections() const { - return Options.FunctionSections; -} - -bool TargetMachine::getDataSections() const { - return Options.DataSections; -} - -void TargetMachine::setFunctionSections(bool V) { - Options.FunctionSections = V; -} - -void TargetMachine::setDataSections(bool V) { - Options.DataSections = V; -} - TargetIRAnalysis TargetMachine::getTargetIRAnalysis() { return TargetIRAnalysis( [this](Function &) { return TargetTransformInfo(getDataLayout()); }); diff --git a/lib/Target/TargetMachineC.cpp b/lib/Target/TargetMachineC.cpp index 8be10cb3262..537b47b373d 100644 --- a/lib/Target/TargetMachineC.cpp +++ b/lib/Target/TargetMachineC.cpp @@ -179,7 +179,7 @@ LLVMTargetDataRef LLVMGetTargetMachineData(LLVMTargetMachineRef T) { void LLVMSetTargetMachineAsmVerbosity(LLVMTargetMachineRef T, LLVMBool VerboseAsm) { - unwrap(T)->setAsmVerbosityDefault(VerboseAsm); + unwrap(T)->Options.MCOptions.AsmVerbose = VerboseAsm; } static LLVMBool LLVMTargetMachineEmit(LLVMTargetMachineRef T, LLVMModuleRef M,