summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mc/AsmParser.cpp
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2009-09-10 20:51:44 +0000
committerKevin Enderby <enderby@apple.com>2009-09-10 20:51:44 +0000
commitce4bec8e0ce57f3e11fb34db49cf81ffdf216f78 (patch)
treecf58243baefffdc5c43c438a7cc0c1bbfbb46c74 /llvm/tools/llvm-mc/AsmParser.cpp
parent04e1e22fe7a5d2728714fb2e5fd031f341d63640 (diff)
downloadbcm5719-llvm-ce4bec8e0ce57f3e11fb34db49cf81ffdf216f78.tar.gz
bcm5719-llvm-ce4bec8e0ce57f3e11fb34db49cf81ffdf216f78.zip
Added the ParseInstruction() hook for target specific assembler directives so
that things like .word can be parsed as target specific. Moved parsing .word out of AsmParser.cpp into X86AsmParser.cpp as it is 2 bytes on X86 and 4 bytes for other targets that support the .word directive. llvm-svn: 81461
Diffstat (limited to 'llvm/tools/llvm-mc/AsmParser.cpp')
-rw-r--r--llvm/tools/llvm-mc/AsmParser.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/tools/llvm-mc/AsmParser.cpp b/llvm/tools/llvm-mc/AsmParser.cpp
index f51f43adc12..b1e8e9ae404 100644
--- a/llvm/tools/llvm-mc/AsmParser.cpp
+++ b/llvm/tools/llvm-mc/AsmParser.cpp
@@ -591,10 +591,9 @@ bool AsmParser::ParseStatement() {
if (IDVal == ".asciz")
return ParseDirectiveAscii(true);
- // FIXME: Target hooks for size? Also for "word", "hword".
if (IDVal == ".byte")
return ParseDirectiveValue(1);
- if (IDVal == ".short" || IDVal == ".word")
+ if (IDVal == ".short")
return ParseDirectiveValue(2);
if (IDVal == ".long")
return ParseDirectiveValue(4);
@@ -685,6 +684,10 @@ bool AsmParser::ParseStatement() {
if (IDVal == ".loc")
return ParseDirectiveLoc(IDLoc);
+ // Target hook for parsing target specific directives.
+ if (!getTargetParser().ParseDirective(ID))
+ return false;
+
Warning(IDLoc, "ignoring directive for now");
EatToEndOfStatement();
return false;
OpenPOWER on IntegriCloud