aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJack Carter <jack.carter@imgtec.com>2013-10-04 22:52:31 +0000
committerJack Carter <jack.carter@imgtec.com>2013-10-04 22:52:31 +0000
commit6d389f5ebae9aa08309c5795234cf155054b6b39 (patch)
tree6a2e3713dcd17abfd68f04c8e3eebe42e539700f /lib
parent371d95851a4e506dd0baba01c759f5dafcb3c128 (diff)
downloadexternal_llvm-6d389f5ebae9aa08309c5795234cf155054b6b39.zip
external_llvm-6d389f5ebae9aa08309c5795234cf155054b6b39.tar.gz
external_llvm-6d389f5ebae9aa08309c5795234cf155054b6b39.tar.bz2
reverting per request
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191992 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/MC/MCParser/AsmParser.cpp4
-rw-r--r--lib/Target/Mips/AsmParser/MipsAsmParser.cpp19
-rw-r--r--lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp21
-rw-r--r--lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h2
-rw-r--r--lib/Target/Mips/MipsAsmPrinter.cpp4
5 files changed, 5 insertions, 45 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp
index 53ce02c..9a36256 100644
--- a/lib/MC/MCParser/AsmParser.cpp
+++ b/lib/MC/MCParser/AsmParser.cpp
@@ -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;
}
diff --git a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index c2e4bba..447e7dc 100644
--- a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -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);
diff --git a/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp b/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp
index 144cb1e..cfcb877 100644
--- a/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp
+++ b/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp
@@ -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);
}
diff --git a/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h b/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h
index 9987f34..b10ccc7 100644
--- a/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h
+++ b/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h
@@ -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);
diff --git a/lib/Target/Mips/MipsAsmPrinter.cpp b/lib/Target/Mips/MipsAsmPrinter.cpp
index b12cb62..1dc3326 100644
--- a/lib/Target/Mips/MipsAsmPrinter.cpp
+++ b/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -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,