[llvm-branch-commits] [llvm-branch] r231675 - Merging r229911 by d0k:

Joerg Sonnenberger joerg at bec.de
Mon Mar 9 11:07:19 PDT 2015


Author: joerg
Date: Mon Mar  9 13:07:19 2015
New Revision: 231675

URL: http://llvm.org/viewvc/llvm-project?rev=231675&view=rev
Log:
Merging r229911 by d0k:
MC: Allow multiple comma-separated expressions on the .uleb128
directive.

For compatiblity with GNU as. Binutils documents this as
'.uleb128 expressions'. Subtle, isn't it?

Modified:
    llvm/branches/release_36/   (props changed)
    llvm/branches/release_36/lib/MC/MCParser/AsmParser.cpp
    llvm/branches/release_36/test/MC/ELF/uleb.s

Propchange: llvm/branches/release_36/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Mar  9 13:07:19 2015
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,226023,226029,226044,226046,226048,226058,226075,226170-226171,226182,226473,226588,226616,226664,226708,226711,226755,226791,226808-226809,227005,227085,227250,227260-227261,227290,227294,227299,227319,227339,227491,227584,227603,227628,227670,227809,227815,227903,227934,227972,227983,228049,228129,228168,228331,228411,228444,228490,228500,228507,228518,228525,228565,228656,228760-228761,228793,228842,228899,228957,228969,228979,229029,229343,229351-229352,229421,229495,229529,229731
+/llvm/trunk:155241,226023,226029,226044,226046,226048,226058,226075,226170-226171,226182,226473,226588,226616,226664,226708,226711,226755,226791,226808-226809,227005,227085,227250,227260-227261,227290,227294,227299,227319,227339,227491,227584,227603,227628,227670,227809,227815,227903,227934,227972,227983,228049,228129,228168,228331,228411,228444,228490,228500,228507,228518,228525,228565,228656,228760-228761,228793,228842,228899,228957,228969,228979,229029,229343,229351-229352,229421,229495,229529,229731,229911

Modified: llvm/branches/release_36/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_36/lib/MC/MCParser/AsmParser.cpp?rev=231675&r1=231674&r2=231675&view=diff
==============================================================================
--- llvm/branches/release_36/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/branches/release_36/lib/MC/MCParser/AsmParser.cpp Mon Mar  9 13:07:19 2015
@@ -3636,21 +3636,27 @@ bool AsmParser::parseDirectiveSpace(Stri
 }
 
 /// parseDirectiveLEB128
-/// ::= (.sleb128 | .uleb128) expression
+/// ::= (.sleb128 | .uleb128) [ expression (, expression)* ]
 bool AsmParser::parseDirectiveLEB128(bool Signed) {
   checkForValidSection();
   const MCExpr *Value;
 
-  if (parseExpression(Value))
-    return true;
+  for (;;) {
+    if (parseExpression(Value))
+      return true;
 
-  if (getLexer().isNot(AsmToken::EndOfStatement))
-    return TokError("unexpected token in directive");
+    if (Signed)
+      getStreamer().EmitSLEB128Value(Value);
+    else
+      getStreamer().EmitULEB128Value(Value);
 
-  if (Signed)
-    getStreamer().EmitSLEB128Value(Value);
-  else
-    getStreamer().EmitULEB128Value(Value);
+    if (getLexer().is(AsmToken::EndOfStatement))
+      break;
+
+    if (getLexer().isNot(AsmToken::Comma))
+      return TokError("unexpected token in directive");
+    Lex();
+  }
 
   return false;
 }

Modified: llvm/branches/release_36/test/MC/ELF/uleb.s
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_36/test/MC/ELF/uleb.s?rev=231675&r1=231674&r2=231675&view=diff
==============================================================================
--- llvm/branches/release_36/test/MC/ELF/uleb.s (original)
+++ llvm/branches/release_36/test/MC/ELF/uleb.s Mon Mar  9 13:07:19 2015
@@ -11,16 +11,17 @@ foo:
 	.uleb128	128
 	.uleb128	16383
 	.uleb128	16384
+        .uleb128	23, 42
 
 // ELF_32:   Name: .text
 // ELF_32:   SectionData (
-// ELF_32:     0000: 00017F80 01FF7F80 8001
+// ELF_32:     0000: 00017F80 01FF7F80 8001172A
 // ELF_32:   )
 // ELF_64:   Name: .text
 // ELF_64:   SectionData (
-// ELF_64:     0000: 00017F80 01FF7F80 8001
+// ELF_64:     0000: 00017F80 01FF7F80 8001172A
 // ELF_64:   )
 // MACHO_32: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-// MACHO_32: ('_section_data', '00017f80 01ff7f80 8001')
+// MACHO_32: ('_section_data', '00017f80 01ff7f80 8001172a')
 // MACHO_64: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-// MACHO_64: ('_section_data', '00017f80 01ff7f80 8001')
+// MACHO_64: ('_section_data', '00017f80 01ff7f80 8001172a')





More information about the llvm-branch-commits mailing list