From f010a2b41a1674d39ed29d4eafd61e9f160321a3 Mon Sep 17 00:00:00 2001 From: Dylan McKay Date: Wed, 28 Sep 2016 14:34:42 +0000 Subject: [AVR] Enable the assembly parser We very recently landed the code. This commit enables the parser. It also adds a missing include to AVRAsmParser.cpp llvm-svn: 282593 --- llvm/lib/Target/AVR/AVR.td | 31 +++++++++++++------------- llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp | 2 ++ 2 files changed, 18 insertions(+), 15 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Target/AVR/AVR.td b/llvm/lib/Target/AVR/AVR.td index 27cf212704f..949b30d5197 100644 --- a/llvm/lib/Target/AVR/AVR.td +++ b/llvm/lib/Target/AVR/AVR.td @@ -537,27 +537,28 @@ include "AVRCallingConv.td" // Assembly Parsers //===---------------------------------------------------------------------===// -// def AVRAsmParser : AsmParser { -// let ShouldEmitMatchRegisterName = 1; -// let ShouldEmitMatchRegisterAltName = 1; -// } +def AVRAsmParser : AsmParser { + let ShouldEmitMatchRegisterName = 1; + let ShouldEmitMatchRegisterAltName = 1; +} -// def AVRAsmParserVariant : AsmParserVariant { -// int Variant = 0; -// -// // Recognize hard coded registers. -// string RegisterPrefix = "$"; -// } +def AVRAsmParserVariant : AsmParserVariant { + int Variant = 0; + + // Recognize hard coded registers. + string RegisterPrefix = "$"; + string TokenizingCharacters = "+"; +} //===---------------------------------------------------------------------===// // Target Declaration //===---------------------------------------------------------------------===// def AVR : Target { - let InstructionSet = AVRInstrInfo; -// let AssemblyWriters = [AVRAsmWriter]; -// -// let AssemblyParsers = [AVRAsmParser]; -// let AssemblyParserVariants = [AVRAsmParserVariant]; + let InstructionSet = AVRInstrInfo; + /* let AssemblyWriters = [AVRAsmWriter]; */ + + let AssemblyParsers = [AVRAsmParser]; + let AssemblyParserVariants = [AVRAsmParserVariant]; } diff --git a/llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp b/llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp index 94229442d3f..4aeac446db2 100644 --- a/llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp +++ b/llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp @@ -29,6 +29,8 @@ #include "llvm/Support/MathExtras.h" #include "llvm/Support/TargetRegistry.h" +#include + #define DEBUG_TYPE "avr-asm-parser" namespace llvm { -- cgit v1.2.3