[llvm] 7fe486a - TargetMachine: Move trivial setter/getter to header

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 12 04:55:50 PDT 2024


Author: Matt Arsenault
Date: 2024-08-12T15:47:58+04:00
New Revision: 7fe486acfa9ca58a82c1ef42e1baf479d4ad7102

URL: https://github.com/llvm/llvm-project/commit/7fe486acfa9ca58a82c1ef42e1baf479d4ad7102
DIFF: https://github.com/llvm/llvm-project/commit/7fe486acfa9ca58a82c1ef42e1baf479d4ad7102.diff

LOG: TargetMachine: Move trivial setter/getter to header

The others are already inline here.

Added: 
    

Modified: 
    llvm/include/llvm/Target/TargetMachine.h
    llvm/lib/Target/TargetMachine.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Target/TargetMachine.h b/llvm/include/llvm/Target/TargetMachine.h
index b8e56c755fbda8..c3e9d41315f617 100644
--- a/llvm/include/llvm/Target/TargetMachine.h
+++ b/llvm/include/llvm/Target/TargetMachine.h
@@ -254,10 +254,10 @@ class TargetMachine {
   TLSModel::Model getTLSModel(const GlobalValue *GV) const;
 
   /// Returns the optimization level: None, Less, Default, or Aggressive.
-  CodeGenOptLevel getOptLevel() const;
+  CodeGenOptLevel getOptLevel() const { return OptLevel; }
 
   /// Overrides the optimization level.
-  void setOptLevel(CodeGenOptLevel Level);
+  void setOptLevel(CodeGenOptLevel Level) { OptLevel = Level; }
 
   void setFastISel(bool Enable) { Options.EnableFastISel = Enable; }
   bool getO0WantsFastISel() { return O0WantsFastISel; }

diff  --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index f5065bfcb752af..c0985f3be91a53 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -262,11 +262,6 @@ TLSModel::Model TargetMachine::getTLSModel(const GlobalValue *GV) const {
   return Model;
 }
 
-/// Returns the optimization level: None, Less, Default, or Aggressive.
-CodeGenOptLevel TargetMachine::getOptLevel() const { return OptLevel; }
-
-void TargetMachine::setOptLevel(CodeGenOptLevel Level) { OptLevel = Level; }
-
 TargetTransformInfo
 TargetMachine::getTargetTransformInfo(const Function &F) const {
   return TargetTransformInfo(F.getDataLayout());


        


More information about the llvm-commits mailing list