[llvm-branch-commits] [llvm-branch] r195220 - Merging r195152:
Bill Wendling
isanbard at gmail.com
Tue Nov 19 22:21:08 PST 2013
Author: void
Date: Wed Nov 20 00:21:08 2013
New Revision: 195220
URL: http://llvm.org/viewvc/llvm-project?rev=195220&view=rev
Log:
Merging r195152:
------------------------------------------------------------------------
r195152 | jacksprat | 2013-11-19 12:53:28 -0800 (Tue, 19 Nov 2013) | 1 line
reverts 195057 per request
------------------------------------------------------------------------
Modified:
llvm/branches/release_34/ (props changed)
llvm/branches/release_34/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
llvm/branches/release_34/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp
llvm/branches/release_34/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
llvm/branches/release_34/lib/Target/Mips/MipsAsmPrinter.cpp
llvm/branches/release_34/lib/Target/Mips/MipsTargetStreamer.h
llvm/branches/release_34/test/MC/Mips/elf_eflags.ll
llvm/branches/release_34/test/MC/Mips/elf_eflags.s
llvm/branches/release_34/test/MC/Mips/elf_st_other.ll
llvm/branches/release_34/test/MC/Mips/elf_st_other.s
Propchange: llvm/branches/release_34/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Nov 20 00:21:08 2013
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,195092-195094,195100,195102-195103,195118,195129,195138,195193
+/llvm/trunk:155241,195092-195094,195100,195102-195103,195118,195129,195138,195152,195193
Modified: llvm/branches/release_34/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_34/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=195220&r1=195219&r2=195220&view=diff
==============================================================================
--- llvm/branches/release_34/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
+++ llvm/branches/release_34/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Wed Nov 20 00:21:08 2013
@@ -193,6 +193,8 @@ class MipsAsmParser : public MCTargetAsm
bool isEvaluated(const MCExpr *Expr);
bool parseDirectiveSet();
+ bool parseDirectiveMipsHackStocg();
+ bool parseDirectiveMipsHackELFFlags();
bool parseSetAtDirective();
bool parseSetNoAtDirective();
@@ -2368,6 +2370,34 @@ bool MipsAsmParser::parseDirectiveSet()
return true;
}
+bool MipsAsmParser::parseDirectiveMipsHackStocg() {
+ MCAsmParser &Parser = getParser();
+ StringRef Name;
+ if (Parser.parseIdentifier(Name))
+ reportParseError("expected identifier");
+
+ MCSymbol *Sym = getContext().GetOrCreateSymbol(Name);
+ if (getLexer().isNot(AsmToken::Comma))
+ return TokError("unexpected token");
+ Lex();
+
+ int64_t Flags = 0;
+ if (Parser.parseAbsoluteExpression(Flags))
+ return TokError("unexpected token");
+
+ getTargetStreamer().emitMipsHackSTOCG(Sym, Flags);
+ return false;
+}
+
+bool MipsAsmParser::parseDirectiveMipsHackELFFlags() {
+ int64_t Flags = 0;
+ if (Parser.parseAbsoluteExpression(Flags))
+ return TokError("unexpected token");
+
+ getTargetStreamer().emitMipsHackELFFlags(Flags);
+ return false;
+}
+
/// parseDirectiveWord
/// ::= .word [ expression (, expression)* ]
bool MipsAsmParser::parseDirectiveWord(unsigned Size, SMLoc L) {
@@ -2458,6 +2488,12 @@ bool MipsAsmParser::ParseDirective(AsmTo
return false;
}
+ if (IDVal == ".mips_hack_stocg")
+ return parseDirectiveMipsHackStocg();
+
+ if (IDVal == ".mips_hack_elf_flags")
+ return parseDirectiveMipsHackELFFlags();
+
return true;
}
Modified: llvm/branches/release_34/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_34/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp?rev=195220&r1=195219&r2=195220&view=diff
==============================================================================
--- llvm/branches/release_34/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp (original)
+++ llvm/branches/release_34/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp Wed Nov 20 00:21:08 2013
@@ -141,7 +141,7 @@ createMCAsmStreamer(MCContext &Ctx, form
bool isVerboseAsm, bool useLoc, bool useCFI,
bool useDwarfDirectory, MCInstPrinter *InstPrint,
MCCodeEmitter *CE, MCAsmBackend *TAB, bool ShowInst) {
- MipsTargetAsmStreamer *S = new MipsTargetAsmStreamer();
+ MipsTargetAsmStreamer *S = new MipsTargetAsmStreamer(OS);
return llvm::createAsmStreamer(Ctx, S, OS, isVerboseAsm, useLoc, useCFI,
useDwarfDirectory, InstPrint, CE, TAB,
Modified: llvm/branches/release_34/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_34/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp?rev=195220&r1=195219&r2=195220&view=diff
==============================================================================
--- llvm/branches/release_34/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp (original)
+++ llvm/branches/release_34/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp Wed Nov 20 00:21:08 2013
@@ -20,11 +20,33 @@
using namespace llvm;
+static cl::opt<bool> PrintHackDirectives("print-hack-directives",
+ cl::init(false), cl::Hidden);
+
// pin vtable to this file
void MipsTargetStreamer::anchor() {}
-void MipsTargetAsmStreamer::emitMipsHackELFFlags(unsigned Flags) { return; }
-void MipsTargetAsmStreamer::emitSymSTO(MCSymbol *Sym, unsigned Val) { return; }
+MipsTargetAsmStreamer::MipsTargetAsmStreamer(formatted_raw_ostream &OS)
+ : OS(OS) {}
+
+void MipsTargetAsmStreamer::emitMipsHackELFFlags(unsigned Flags) {
+ if (!PrintHackDirectives)
+ return;
+
+ OS << "\t.mips_hack_elf_flags 0x";
+ OS.write_hex(Flags);
+ OS << '\n';
+}
+void MipsTargetAsmStreamer::emitMipsHackSTOCG(MCSymbol *Sym, unsigned Val) {
+ if (!PrintHackDirectives)
+ return;
+
+ OS << "\t.mips_hack_stocg ";
+ OS << Sym->getName();
+ OS << ", ";
+ OS << Val;
+ OS << '\n';
+}
MCELFStreamer &MipsTargetELFStreamer::getStreamer() {
return static_cast<MCELFStreamer &>(*Streamer);
@@ -36,7 +58,7 @@ void MipsTargetELFStreamer::emitMipsHack
}
// Set a symbol's STO flags
-void MipsTargetELFStreamer::emitSymSTO(MCSymbol *Sym, unsigned Val) {
+void MipsTargetELFStreamer::emitMipsHackSTOCG(MCSymbol *Sym, unsigned Val) {
MCSymbolData &Data = getStreamer().getOrCreateSymbolData(Sym);
// The "other" values are stored in the last 6 bits of the second byte
// The traditional defines for STO values assume the full byte and thus
Modified: llvm/branches/release_34/lib/Target/Mips/MipsAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_34/lib/Target/Mips/MipsAsmPrinter.cpp?rev=195220&r1=195219&r2=195220&view=diff
==============================================================================
--- llvm/branches/release_34/lib/Target/Mips/MipsAsmPrinter.cpp (original)
+++ llvm/branches/release_34/lib/Target/Mips/MipsAsmPrinter.cpp Wed Nov 20 00:21:08 2013
@@ -276,8 +276,8 @@ void MipsAsmPrinter::EmitFunctionEntryLa
}
if (Subtarget->inMicroMipsMode())
- getTargetStreamer().emitSymSTO(CurrentFnSym,
- (unsigned)ELF::STO_MIPS_MICROMIPS);
+ getTargetStreamer().emitMipsHackSTOCG(CurrentFnSym,
+ (unsigned)ELF::STO_MIPS_MICROMIPS);
OutStreamer.EmitLabel(CurrentFnSym);
}
Modified: llvm/branches/release_34/lib/Target/Mips/MipsTargetStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_34/lib/Target/Mips/MipsTargetStreamer.h?rev=195220&r1=195219&r2=195220&view=diff
==============================================================================
--- llvm/branches/release_34/lib/Target/Mips/MipsTargetStreamer.h (original)
+++ llvm/branches/release_34/lib/Target/Mips/MipsTargetStreamer.h Wed Nov 20 00:21:08 2013
@@ -19,14 +19,17 @@ class MipsTargetStreamer : public MCTarg
public:
virtual void emitMipsHackELFFlags(unsigned Flags) = 0;
- virtual void emitSymSTO(MCSymbol *Sym, unsigned Val) = 0;
+ virtual void emitMipsHackSTOCG(MCSymbol *Sym, unsigned Val) = 0;
};
// This part is for ascii assembly output
class MipsTargetAsmStreamer : public MipsTargetStreamer {
+ formatted_raw_ostream &OS;
+
public:
+ MipsTargetAsmStreamer(formatted_raw_ostream &OS);
virtual void emitMipsHackELFFlags(unsigned Flags);
- virtual void emitSymSTO(MCSymbol *Sym, unsigned Val);
+ virtual void emitMipsHackSTOCG(MCSymbol *Sym, unsigned Val);
};
// This part is for ELF object output
@@ -34,7 +37,7 @@ class MipsTargetELFStreamer : public Mip
public:
MCELFStreamer &getStreamer();
virtual void emitMipsHackELFFlags(unsigned Flags);
- virtual void emitSymSTO(MCSymbol *Sym, unsigned Val);
+ virtual void emitMipsHackSTOCG(MCSymbol *Sym, unsigned Val);
};
}
Modified: llvm/branches/release_34/test/MC/Mips/elf_eflags.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_34/test/MC/Mips/elf_eflags.ll?rev=195220&r1=195219&r2=195220&view=diff
==============================================================================
--- llvm/branches/release_34/test/MC/Mips/elf_eflags.ll (original)
+++ llvm/branches/release_34/test/MC/Mips/elf_eflags.ll Wed Nov 20 00:21:08 2013
@@ -1,5 +1,3 @@
-; XFAIL: *
-
; This tests ELF EFLAGS setting with direct object.
; When the assembler is ready a .s file for it will
; be created.
@@ -18,19 +16,19 @@
; Note that EF_MIPS_CPIC is set by -mabicalls which is the default on Linux
; TODO need to support -mno-abicalls
-; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-BE32 %s
-; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32 %s -o - | FileCheck -check-prefix=CHECK-BE32_PIC %s
-; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-BE32R2 %s
-; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 %s -o - | FileCheck -check-prefix=CHECK-BE32R2_PIC %s
-; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-BE32R2-MICROMIPS %s
-; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips %s -o - | FileCheck -check-prefix=CHECK-BE32R2-MICROMIPS_PIC %s
-
-; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-BE64 %s
-; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64 %s -o - | FileCheck -check-prefix=CHECK-BE64_PIC %s
-; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64r2 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-BE64R2 %s
-; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64r2 %s -o - | FileCheck -check-prefix=CHECK-BE64R2_PIC %s
+; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32 -relocation-model=static %s -print-hack-directives -o - | FileCheck -check-prefix=CHECK-BE32 %s
+; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32 -print-hack-directives %s -o - | FileCheck -check-prefix=CHECK-BE32_PIC %s
+; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -relocation-model=static %s -print-hack-directives -o - | FileCheck -check-prefix=CHECK-BE32R2 %s
+; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -print-hack-directives %s -o - | FileCheck -check-prefix=CHECK-BE32R2_PIC %s
+; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips -relocation-model=static -print-hack-directives %s -o - | FileCheck -check-prefix=CHECK-BE32R2-MICROMIPS %s
+; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips -print-hack-directives %s -o - | FileCheck -check-prefix=CHECK-BE32R2-MICROMIPS_PIC %s
+
+; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64 -relocation-model=static %s -print-hack-directives -o - | FileCheck -check-prefix=CHECK-BE64 %s
+; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64 %s -print-hack-directives -o - | FileCheck -check-prefix=CHECK-BE64_PIC %s
+; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64r2 -relocation-model=static -print-hack-directives %s -o - | FileCheck -check-prefix=CHECK-BE64R2 %s
+; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64r2 -print-hack-directives %s -o - | FileCheck -check-prefix=CHECK-BE64R2_PIC %s
-; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+mips16 -relocation-model=pic %s -o - | FileCheck -check-prefix=CHECK-LE32R2-MIPS16 %s
+; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+mips16 -relocation-model=pic -print-hack-directives %s -o - | FileCheck -check-prefix=CHECK-LE32R2-MIPS16 %s
; 32(R1) bit with NO_REORDER and static
; CHECK-BE32: .mips_hack_elf_flags 0x50001005
Modified: llvm/branches/release_34/test/MC/Mips/elf_eflags.s
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_34/test/MC/Mips/elf_eflags.s?rev=195220&r1=195219&r2=195220&view=diff
==============================================================================
--- llvm/branches/release_34/test/MC/Mips/elf_eflags.s (original)
+++ llvm/branches/release_34/test/MC/Mips/elf_eflags.s Wed Nov 20 00:21:08 2013
@@ -1,5 +1,5 @@
-; XFAIL: *
// RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux %s -o -| llvm-readobj -h | FileCheck %s
+ .mips_hack_elf_flags 0x50001005
// CHECK: Flags [ (0x50001005)
Modified: llvm/branches/release_34/test/MC/Mips/elf_st_other.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_34/test/MC/Mips/elf_st_other.ll?rev=195220&r1=195219&r2=195220&view=diff
==============================================================================
--- llvm/branches/release_34/test/MC/Mips/elf_st_other.ll (original)
+++ llvm/branches/release_34/test/MC/Mips/elf_st_other.ll Wed Nov 20 00:21:08 2013
@@ -1,9 +1,7 @@
-; XFAIL: *
-
; This tests value of ELF st_other field for function symbol table entries.
; For microMIPS value should be equal to STO_MIPS_MICROMIPS.
-; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips %s -o - | FileCheck %s
+; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips -print-hack-directives %s -o - | FileCheck %s
define i32 @main() nounwind {
entry:
Modified: llvm/branches/release_34/test/MC/Mips/elf_st_other.s
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_34/test/MC/Mips/elf_st_other.s?rev=195220&r1=195219&r2=195220&view=diff
==============================================================================
--- llvm/branches/release_34/test/MC/Mips/elf_st_other.s (original)
+++ llvm/branches/release_34/test/MC/Mips/elf_st_other.s Wed Nov 20 00:21:08 2013
@@ -1,5 +1,3 @@
-; XFAIL: *
-
// RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux %s -o -| llvm-readobj -t | FileCheck %s
.text
More information about the llvm-branch-commits
mailing list