Commit 81155380 authored by Daniel Sanders's avatar Daniel Sanders
Browse files

Revert r231463 and r231462.

The build fails after merging them due to two missing functions.

llvm-svn: 231464
parent 8f20452c
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -461,10 +461,6 @@ public:
                                     unsigned AsmVariant, const char *ExtraCode,
                                     raw_ostream &OS);

  /// Let the target do anything it needs to do before emitting inlineasm.
  /// \p StartInfo - the subtarget info before parsing inline asm
  virtual void emitInlineAsmStart(const MCSubtargetInfo &StartInfo) const;

  /// Let the target do anything it needs to do after emitting inlineasm.
  /// This callback can be used restore the original mode in case the
  /// inlineasm contains directives to switch modes.
+0 −4
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@ void AsmPrinter::EmitInlineAsm(StringRef Str, const MDNode *LocMDNode,
  assert(MCAI && "No MCAsmInfo");
  if (!MCAI->useIntegratedAssembler() &&
      !OutStreamer.isIntegratedAssemblerRequired()) {
    emitInlineAsmStart(TM.getSubtarget<MCSubtargetInfo>());
    OutStreamer.EmitRawText(Str);
    emitInlineAsmEnd(TM.getSubtarget<MCSubtargetInfo>(), nullptr);
    return;
@@ -148,7 +147,6 @@ void AsmPrinter::EmitInlineAsm(StringRef Str, const MDNode *LocMDNode,
  Parser->setAssemblerDialect(Dialect);
  Parser->setTargetParser(*TAP.get());

  emitInlineAsmStart(STIOrig);
  // Don't implicitly switch to the text section before the asm.
  int Res = Parser->Run(/*NoInitialTextSection*/ true,
                        /*NoFinalize*/ true);
@@ -563,7 +561,5 @@ bool AsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
  return true;
}

void AsmPrinter::emitInlineAsmStart(const MCSubtargetInfo &StartInfo) const {}

void AsmPrinter::emitInlineAsmEnd(const MCSubtargetInfo &StartInfo,
                                  const MCSubtargetInfo *EndInfo) const {}
+2 −0
Original line number Diff line number Diff line
@@ -458,6 +458,7 @@ static void createFPFnStub(Function *F, Module *M, FPParamVariant PV,
  FStub->setSection(SectionName);
  BasicBlock *BB = BasicBlock::Create(Context, "entry", FStub);
  InlineAsmHelper IAH(Context, BB);
  IAH.Out(" .set  macro");
  if (PicMode) {
    IAH.Out(".set noreorder");
    IAH.Out(".cpload  $$25");
@@ -466,6 +467,7 @@ static void createFPFnStub(Function *F, Module *M, FPParamVariant PV,
    IAH.Out("la $$25," + LocalName);
  }
  else {
    IAH.Out(".set reorder");
    IAH.Out("la $$25," + Name);
  }
  swapFPIntParams(PV, M, IAH, LE, false);
+1 −24
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ using namespace llvm;

#define DEBUG_TYPE "mips-asm-printer"

MipsTargetStreamer &MipsAsmPrinter::getTargetStreamer() const {
MipsTargetStreamer &MipsAsmPrinter::getTargetStreamer() {
  return static_cast<MipsTargetStreamer &>(*OutStreamer.getTargetStreamer());
}

@@ -721,29 +721,6 @@ void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) {
                                                    Subtarget->isABI_O32());
}

void MipsAsmPrinter::emitInlineAsmStart(
    const MCSubtargetInfo &StartInfo) const {
  MipsTargetStreamer &TS = getTargetStreamer();

  // GCC's choice of assembler options for inline assembly code ('at', 'macro'
  // and 'reorder') is different from LLVM's choice for generated code ('noat',
  // 'nomacro' and 'noreorder').
  // In order to maintain compatibility with inline assembly code which depends
  // on GCC's assembler options being used, we have to switch to those options
  // for the duration of the inline assembly block and then switch back.
  TS.emitDirectiveSetPush();
  TS.emitDirectiveSetAt();
  TS.emitDirectiveSetMacro();
  TS.emitDirectiveSetReorder();
  OutStreamer.AddBlankLine();
}

void MipsAsmPrinter::emitInlineAsmEnd(const MCSubtargetInfo &StartInfo,
                                      const MCSubtargetInfo *EndInfo) const {
  OutStreamer.AddBlankLine();
  getTargetStreamer().emitDirectiveSetPop();
}

void MipsAsmPrinter::EmitJal(MCSymbol *Symbol) {
  MCInst I;
  I.setOpcode(Mips::JAL);
+1 −6
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ class Module;
class raw_ostream;

class LLVM_LIBRARY_VISIBILITY MipsAsmPrinter : public AsmPrinter {
  MipsTargetStreamer &getTargetStreamer() const;
  MipsTargetStreamer &getTargetStreamer();

  void EmitInstrWithMacroNoAT(const MachineInstr *MI);

@@ -60,11 +60,6 @@ private:
  std::map<const char *, const llvm::Mips16HardFloatInfo::FuncSignature *>
  StubsNeeded;

  void emitInlineAsmStart(const MCSubtargetInfo &StartInfo) const override;

  void emitInlineAsmEnd(const MCSubtargetInfo &StartInfo,
                        const MCSubtargetInfo *EndInfo) const override;

  void EmitJal(MCSymbol *Symbol);

  void EmitInstrReg(unsigned Opcode, unsigned Reg);
Loading