summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Carter <jcarter@mips.com>2012-09-07 00:48:02 +0000
committerJack Carter <jcarter@mips.com>2012-09-07 00:48:02 +0000
commitbe33217bb85c8034c0056395c58b74f61875eaf0 (patch)
tree9aa57f2a12d5ae11993838e36bfd31bbaacbc7db
parenta63b16ac1ed4272a2d5bd97f2d4326c24e531d14 (diff)
downloadbcm5719-llvm-be33217bb85c8034c0056395c58b74f61875eaf0.tar.gz
bcm5719-llvm-be33217bb85c8034c0056395c58b74f61875eaf0.zip
The Mips standalone assembler intial directive support.
Actually these are just stubs for parsing the directives. Semantic support will come later. Test cases included Contributer: Vladimir Medic llvm-svn: 163364
-rw-r--r--llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp43
-rw-r--r--llvm/test/MC/Mips/mips_directives.s10
2 files changed, 53 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index 6fdef524403..988a502f150 100644
--- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -894,6 +894,49 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
bool MipsAsmParser::
ParseDirective(AsmToken DirectiveID) {
+
+ if (DirectiveID.getString() == ".ent") {
+ //ignore this directive for now
+ Parser.Lex();
+ return false;
+ }
+
+ if (DirectiveID.getString() == ".end") {
+ //ignore this directive for now
+ Parser.Lex();
+ return false;
+ }
+
+ if (DirectiveID.getString() == ".frame") {
+ //ignore this directive for now
+ Parser.EatToEndOfStatement();
+ return false;
+ }
+
+ if (DirectiveID.getString() == ".set") {
+ //ignore this directive for now
+ Parser.EatToEndOfStatement();
+ return false;
+ }
+
+ if (DirectiveID.getString() == ".fmask") {
+ //ignore this directive for now
+ Parser.EatToEndOfStatement();
+ return false;
+ }
+
+ if (DirectiveID.getString() == ".mask") {
+ //ignore this directive for now
+ Parser.EatToEndOfStatement();
+ return false;
+ }
+
+ if (DirectiveID.getString() == ".gpword") {
+ //ignore this directive for now
+ Parser.EatToEndOfStatement();
+ return false;
+ }
+
return true;
}
diff --git a/llvm/test/MC/Mips/mips_directives.s b/llvm/test/MC/Mips/mips_directives.s
new file mode 100644
index 00000000000..f9d846078bf
--- /dev/null
+++ b/llvm/test/MC/Mips/mips_directives.s
@@ -0,0 +1,10 @@
+# RUN: llvm-mc -triple mips-unknown-unknown %s
+
+$BB0_2:
+ .frame $sp,0,$ra
+ .mask 0x00000000,0
+ .fmask 0x00000000,0
+ .set noreorder
+ .set nomacro
+$JTI0_0:
+ .gpword ($BB0_2)
OpenPOWER on IntegriCloud