[llvm] 23a6ae2 - [NFC] Make X86MCCodeEmitter::isPCRel32Branch static

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 30 23:13:21 PST 2019


Author: Shengchen Kan
Date: 2019-12-31T15:12:45+08:00
New Revision: 23a6ae2b0624278646929d5cbed360f79be505ac

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

LOG: [NFC] Make X86MCCodeEmitter::isPCRel32Branch static

Added: 
    

Modified: 
    llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
index 296ac7aae86b..24f0f2b66ba8 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
@@ -142,8 +142,6 @@ class X86MCCodeEmitter : public MCCodeEmitter {
 
   uint8_t determineREXPrefix(const MCInst &MI, uint64_t TSFlags, int MemOperand,
                              const MCInstrDesc &Desc) const;
-
-  bool isPCRel32Branch(const MCInst &MI) const;
 };
 
 } // end anonymous namespace
@@ -266,7 +264,7 @@ static bool hasSecRelSymbolRef(const MCExpr *Expr) {
   return false;
 }
 
-bool X86MCCodeEmitter::isPCRel32Branch(const MCInst &MI) const {
+static bool isPCRel32Branch(const MCInst &MI, const MCInstrInfo &MCII) {
   unsigned Opcode = MI.getOpcode();
   const MCInstrDesc &Desc = MCII.get(Opcode);
   if ((Opcode != X86::CALL64pcrel32 && Opcode != X86::JMP_4) ||
@@ -1388,7 +1386,7 @@ void X86MCCodeEmitter::encodeInstruction(const MCInst &MI, raw_ostream &OS,
   case X86II::RawFrm:
     emitByte(BaseOpcode + OpcodeOffset, CurByte, OS);
 
-    if (!STI.hasFeature(X86::Mode64Bit) || !isPCRel32Branch(MI))
+    if (!STI.hasFeature(X86::Mode64Bit) || !isPCRel32Branch(MI, MCII))
       break;
 
     const MCOperand &Op = MI.getOperand(CurOp++);


        


More information about the llvm-commits mailing list