mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81461 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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;
|
||||
|
@@ -16,6 +16,7 @@
|
||||
#include "llvm/MC/MCCodeEmitter.h"
|
||||
#include "llvm/MC/MCSectionMachO.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCAsmLexer.h"
|
||||
#include "llvm/ADT/OwningPtr.h"
|
||||
#include "llvm/CodeGen/AsmPrinter.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
|
Reference in New Issue
Block a user