OLD | NEW |
1 //===-- X86AsmParser.cpp - Parse X86 assembly to MCInst instructions ------===// | 1 //===-- X86AsmParser.cpp - Parse X86 assembly to MCInst instructions ------===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 | 9 |
10 #include "MCTargetDesc/X86BaseInfo.h" | 10 #include "MCTargetDesc/X86BaseInfo.h" |
(...skipping 2735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2746 getParser().setAssemblerDialect(1); | 2746 getParser().setAssemblerDialect(1); |
2747 if (getLexer().isNot(AsmToken::EndOfStatement)) { | 2747 if (getLexer().isNot(AsmToken::EndOfStatement)) { |
2748 if (Parser.getTok().getString() == "noprefix") | 2748 if (Parser.getTok().getString() == "noprefix") |
2749 Parser.Lex(); | 2749 Parser.Lex(); |
2750 else if (Parser.getTok().getString() == "prefix") | 2750 else if (Parser.getTok().getString() == "prefix") |
2751 return Error(DirectiveID.getLoc(), "'.intel_syntax prefix' is not " | 2751 return Error(DirectiveID.getLoc(), "'.intel_syntax prefix' is not " |
2752 "supported: registers must not have " | 2752 "supported: registers must not have " |
2753 "a '%' prefix in .intel_syntax"); | 2753 "a '%' prefix in .intel_syntax"); |
2754 } | 2754 } |
2755 return false; | 2755 return false; |
| 2756 // @LOCALMOD-START |
| 2757 } else if (IDVal.startswith(".dwarf_addr_size")) { |
| 2758 // For compatibility with NaCl gas, which needs to override the size of |
| 2759 // DWARF address values on x86-64 (normally it assumes that the address size |
| 2760 // matches the ELF class, which is not currently true for x86-64 NaCl). |
| 2761 // Require the size to be 4, since that matches the module address size. |
| 2762 if (Parser.getTok().getString() != "4") |
| 2763 return Error(DirectiveID.getLoc(), ".dwarf_addr_size must be 4"); |
| 2764 Parser.Lex(); |
| 2765 return false; |
2756 } | 2766 } |
| 2767 // @LOCALMOD-END |
2757 return true; | 2768 return true; |
2758 } | 2769 } |
2759 | 2770 |
2760 /// ParseDirectiveWord | 2771 /// ParseDirectiveWord |
2761 /// ::= .word [ expression (, expression)* ] | 2772 /// ::= .word [ expression (, expression)* ] |
2762 bool X86AsmParser::ParseDirectiveWord(unsigned Size, SMLoc L) { | 2773 bool X86AsmParser::ParseDirectiveWord(unsigned Size, SMLoc L) { |
2763 MCAsmParser &Parser = getParser(); | 2774 MCAsmParser &Parser = getParser(); |
2764 if (getLexer().isNot(AsmToken::EndOfStatement)) { | 2775 if (getLexer().isNot(AsmToken::EndOfStatement)) { |
2765 for (;;) { | 2776 for (;;) { |
2766 const MCExpr *Value; | 2777 const MCExpr *Value; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2818 // Force static initialization. | 2829 // Force static initialization. |
2819 extern "C" void LLVMInitializeX86AsmParser() { | 2830 extern "C" void LLVMInitializeX86AsmParser() { |
2820 RegisterMCAsmParser<X86AsmParser> X(TheX86_32Target); | 2831 RegisterMCAsmParser<X86AsmParser> X(TheX86_32Target); |
2821 RegisterMCAsmParser<X86AsmParser> Y(TheX86_64Target); | 2832 RegisterMCAsmParser<X86AsmParser> Y(TheX86_64Target); |
2822 } | 2833 } |
2823 | 2834 |
2824 #define GET_REGISTER_MATCHER | 2835 #define GET_REGISTER_MATCHER |
2825 #define GET_MATCHER_IMPLEMENTATION | 2836 #define GET_MATCHER_IMPLEMENTATION |
2826 #define GET_SUBTARGET_FEATURE_NAME | 2837 #define GET_SUBTARGET_FEATURE_NAME |
2827 #include "X86GenAsmMatcher.inc" | 2838 #include "X86GenAsmMatcher.inc" |
OLD | NEW |