mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-10 22:43:46 +00:00
reverting per request
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191992 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
371d95851a
commit
6d389f5eba
@ -176,11 +176,6 @@ public:
|
||||
virtual void convertToMapAndConstraints(unsigned Kind,
|
||||
const SmallVectorImpl<MCParsedAsmOperand*> &Operands) = 0;
|
||||
|
||||
/// End of assembly processing.
|
||||
/// This gets called when all assembly has been read and gives the local
|
||||
/// Target AsmParsers an opportunity for any final data processing, etc..
|
||||
virtual void emitEndOfAsmFile(MCStreamer &Out) {}
|
||||
|
||||
virtual const MCExpr *applyModifierToExpr(const MCExpr *E,
|
||||
MCSymbolRefExpr::VariantKind,
|
||||
MCContext &Ctx) {
|
||||
|
@ -673,10 +673,8 @@ bool AsmParser::Run(bool NoInitialTextSection, bool NoFinalize) {
|
||||
|
||||
// Finalize the output stream if there are no errors and if the client wants
|
||||
// us to.
|
||||
if (!HadError && !NoFinalize) {
|
||||
getTargetParser().emitEndOfAsmFile(Out);
|
||||
if (!HadError && !NoFinalize)
|
||||
Out.Finish();
|
||||
}
|
||||
|
||||
return HadError;
|
||||
}
|
||||
|
@ -7,8 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "AsmParser/MipsAsmFlags.h"
|
||||
#include "MCTargetDesc/MipsELFStreamer.h"
|
||||
#include "MCTargetDesc/MipsMCTargetDesc.h"
|
||||
#include "MipsRegisterInfo.h"
|
||||
#include "llvm/ADT/StringSwitch.h"
|
||||
@ -61,7 +59,6 @@ class MipsAsmParser : public MCTargetAsmParser {
|
||||
MCSubtargetInfo &STI;
|
||||
MCAsmParser &Parser;
|
||||
MipsAssemblerOptions Options;
|
||||
MipsMCAsmFlags Flags;
|
||||
bool hasConsumedDollar;
|
||||
|
||||
#define GET_ASSEMBLER_HEADER
|
||||
@ -231,8 +228,6 @@ class MipsAsmParser : public MCTargetAsmParser {
|
||||
|
||||
bool processInstruction(MCInst &Inst, SMLoc IDLoc,
|
||||
SmallVectorImpl<MCInst> &Instructions);
|
||||
void emitEndOfAsmFile(MCStreamer &Out);
|
||||
|
||||
public:
|
||||
MipsAsmParser(MCSubtargetInfo &sti, MCAsmParser &parser,
|
||||
const MCInstrInfo &MII)
|
||||
@ -2177,23 +2172,9 @@ bool MipsAsmParser::ParseDirective(AsmToken DirectiveID) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (IDVal == ".abicalls") {
|
||||
Flags.setRelocationModel(MipsMCAsmFlags::MAF_RM_CPIC);
|
||||
if (Parser.getTok().isNot(AsmToken::EndOfStatement))
|
||||
return Error(Parser.getTok().getLoc(), "unexpected token in directive");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// End of assembly processing such as updating ELF header flags.
|
||||
void MipsAsmParser::emitEndOfAsmFile(MCStreamer &OutStreamer) {
|
||||
if (MipsELFStreamer *MES = dyn_cast<MipsELFStreamer>(&OutStreamer))
|
||||
MES->emitELFHeaderFlagsAsm(Flags);
|
||||
MCTargetAsmParser::emitEndOfAsmFile(OutStreamer);
|
||||
}
|
||||
|
||||
extern "C" void LLVMInitializeMipsAsmParser() {
|
||||
RegisterMCAsmParser<MipsAsmParser> X(TheMipsTarget);
|
||||
RegisterMCAsmParser<MipsAsmParser> Y(TheMipselTarget);
|
||||
|
@ -7,7 +7,6 @@
|
||||
//
|
||||
//===-------------------------------------------------------------------===//
|
||||
#include "MCTargetDesc/MipsELFStreamer.h"
|
||||
#include "AsmParser/MipsAsmFlags.h"
|
||||
#include "MipsSubtarget.h"
|
||||
#include "llvm/MC/MCAssembler.h"
|
||||
#include "llvm/MC/MCELF.h"
|
||||
@ -67,26 +66,10 @@ namespace llvm {
|
||||
Reloc::Model RM = Subtarget.getRelocationModel();
|
||||
if (RM == Reloc::PIC_ || RM == Reloc::Default)
|
||||
EFlags |= ELF::EF_MIPS_PIC;
|
||||
|
||||
MCA.setELFHeaderEFlags(EFlags);
|
||||
}
|
||||
|
||||
// For llvm-mc. Set a group of ELF header flags
|
||||
void MipsELFStreamer::emitELFHeaderFlagsAsm(const MipsMCAsmFlags &Flags) {
|
||||
|
||||
// Update e_header flags
|
||||
MCAssembler &MCA = getAssembler();
|
||||
unsigned EFlags = MCA.getELFHeaderEFlags();
|
||||
|
||||
// Relocation Model
|
||||
if (Flags.isModelCpic() || Flags.isModelDefault())
|
||||
EFlags |= ELF::EF_MIPS_CPIC;
|
||||
if (Flags.isModelStatic())
|
||||
else if (RM == Reloc::Static)
|
||||
; // Do nothing for Reloc::Static
|
||||
else if (Flags.isModelPic() || Flags.isModelDefault())
|
||||
EFlags |= ELF::EF_MIPS_PIC;
|
||||
else
|
||||
assert(0 && "Unsupported relocation model for e_flags");
|
||||
llvm_unreachable("Unsupported relocation model for e_flags");
|
||||
|
||||
MCA.setELFHeaderEFlags(EFlags);
|
||||
}
|
||||
|
@ -13,7 +13,6 @@
|
||||
|
||||
namespace llvm {
|
||||
class MipsAsmPrinter;
|
||||
class MipsMCAsmFlags;
|
||||
class MipsSubtarget;
|
||||
class MCSymbol;
|
||||
|
||||
@ -27,7 +26,6 @@ public:
|
||||
|
||||
~MipsELFStreamer() {}
|
||||
void emitELFHeaderFlagsCG(const MipsSubtarget &Subtarget);
|
||||
void emitELFHeaderFlagsAsm(const MipsMCAsmFlags &MAFlags);
|
||||
void emitMipsSTOCG(const MipsSubtarget &Subtarget,
|
||||
MCSymbol *Sym,
|
||||
unsigned Val);
|
||||
|
@ -594,8 +594,8 @@ void MipsAsmPrinter::EmitEndOfAsmFile(Module &M) {
|
||||
// Emit Mips ELF register info
|
||||
Subtarget->getMReginfo().emitMipsReginfoSectionCG(
|
||||
OutStreamer, getObjFileLowering(), *Subtarget);
|
||||
MipsELFStreamer *MES = cast<MipsELFStreamer>(&OutStreamer);
|
||||
MES->emitELFHeaderFlagsCG(*Subtarget);
|
||||
if (MipsELFStreamer *MES = dyn_cast<MipsELFStreamer>(&OutStreamer))
|
||||
MES->emitELFHeaderFlagsCG(*Subtarget);
|
||||
}
|
||||
|
||||
void MipsAsmPrinter::PrintDebugValueComment(const MachineInstr *MI,
|
||||
|
@ -1,12 +1,9 @@
|
||||
# RUN: llvm-mc -show-encoding -triple mips-unknown-unknown %s | FileCheck %s
|
||||
# RUN: llvm-mc -filetype=obj -triple mips-unknown-unknown %s | \
|
||||
# RUN: llvm-readobj -h | FileCheck -check-prefix=CHECK-ELF %s
|
||||
#
|
||||
# CHECK: .text
|
||||
# CHECK: $BB0_2:
|
||||
$BB0_2:
|
||||
.ent directives_test
|
||||
.abicalls
|
||||
.ent directives_test
|
||||
.frame $sp,0,$ra
|
||||
.mask 0x00000000,0
|
||||
.fmask 0x00000000,0
|
||||
@ -46,5 +43,3 @@ $JTI0_0:
|
||||
# CHECK: and $3, $15, $15 # encoding: [0x01,0xef,0x18,0x24]
|
||||
abs.s f6,FPU_MASK
|
||||
and r3,$t7,STORE_MASK
|
||||
|
||||
# CHECK-ELF: Flags [ (0x6)
|
||||
|
Loading…
x
Reference in New Issue
Block a user