1 Pull in r229911 from upstream llvm trunk (by Benjamin Kramer):
3 MC: Allow multiple comma-separated expressions on the .uleb128 directive.
5 For compatiblity with GNU as. Binutils documents this as
6 '.uleb128 expressions'. Subtle, isn't it?
8 Introduced here: http://svnweb.freebsd.org/changeset/base/281775
10 Index: lib/MC/MCParser/AsmParser.cpp
11 ===================================================================
12 --- lib/MC/MCParser/AsmParser.cpp
13 +++ lib/MC/MCParser/AsmParser.cpp
14 @@ -3636,22 +3636,28 @@ bool AsmParser::parseDirectiveSpace(StringRef IDVa
17 /// parseDirectiveLEB128
18 -/// ::= (.sleb128 | .uleb128) expression
19 +/// ::= (.sleb128 | .uleb128) [ expression (, expression)* ]
20 bool AsmParser::parseDirectiveLEB128(bool Signed) {
21 checkForValidSection();
24 - if (parseExpression(Value))
27 + if (parseExpression(Value))
30 - if (getLexer().isNot(AsmToken::EndOfStatement))
31 - return TokError("unexpected token in directive");
33 + getStreamer().EmitSLEB128Value(Value);
35 + getStreamer().EmitULEB128Value(Value);
38 - getStreamer().EmitSLEB128Value(Value);
40 - getStreamer().EmitULEB128Value(Value);
41 + if (getLexer().is(AsmToken::EndOfStatement))
44 + if (getLexer().isNot(AsmToken::Comma))
45 + return TokError("unexpected token in directive");
52 Index: test/MC/ELF/uleb.s
53 ===================================================================
54 --- test/MC/ELF/uleb.s
55 +++ test/MC/ELF/uleb.s
56 @@ -11,16 +11,17 @@ foo:
62 // ELF_32: Name: .text
63 // ELF_32: SectionData (
64 -// ELF_32: 0000: 00017F80 01FF7F80 8001
65 +// ELF_32: 0000: 00017F80 01FF7F80 8001172A
67 // ELF_64: Name: .text
68 // ELF_64: SectionData (
69 -// ELF_64: 0000: 00017F80 01FF7F80 8001
70 +// ELF_64: 0000: 00017F80 01FF7F80 8001172A
72 // MACHO_32: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
73 -// MACHO_32: ('_section_data', '00017f80 01ff7f80 8001')
74 +// MACHO_32: ('_section_data', '00017f80 01ff7f80 8001172a')
75 // MACHO_64: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
76 -// MACHO_64: ('_section_data', '00017f80 01ff7f80 8001')
77 +// MACHO_64: ('_section_data', '00017f80 01ff7f80 8001172a')