[llvm] d4c0a08 - [TargetLowering] Move TargetLoweringBase::isJumpTableRelative() implementation into TargetLoweringBase.cpp. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri May 22 06:27:47 PDT 2020


Author: Simon Pilgrim
Date: 2020-05-22T14:26:27+01:00
New Revision: d4c0a082a48236df427e3244212aea50887b2e9f

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

LOG: [TargetLowering] Move TargetLoweringBase::isJumpTableRelative() implementation into TargetLoweringBase.cpp. NFC.

This will help with reducing header dependencies in TargetLowering.h in a future patch.

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/TargetLowering.h
    llvm/lib/CodeGen/TargetLoweringBase.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h
index db501c8c64f2..be37e5bd4a09 100644
--- a/llvm/include/llvm/CodeGen/TargetLowering.h
+++ b/llvm/include/llvm/CodeGen/TargetLowering.h
@@ -1651,9 +1651,7 @@ class TargetLoweringBase {
   /// Zero if no limit.
   unsigned getMaximumJumpTableSize() const;
 
-  virtual bool isJumpTableRelative() const {
-    return TM.isPositionIndependent();
-  }
+  virtual bool isJumpTableRelative() const;
 
   /// If a physical register, this specifies the register that
   /// llvm.savestack/llvm.restorestack should save and restore.

diff  --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp
index 893298cde459..565415df24f3 100644
--- a/llvm/lib/CodeGen/TargetLoweringBase.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp
@@ -1834,6 +1834,10 @@ void TargetLoweringBase::setMaximumJumpTableSize(unsigned Val) {
   MaximumJumpTableSize = Val;
 }
 
+bool TargetLoweringBase::isJumpTableRelative() const {
+  return getTargetMachine().isPositionIndependent();
+}
+
 //===----------------------------------------------------------------------===//
 //  Reciprocal Estimates
 //===----------------------------------------------------------------------===//


        


More information about the llvm-commits mailing list