Backport commit from upstream LLVM:

r229911
MC: Allow multiple comma-separated expressions on the .uleb128 directive.

from brad (maintainer)
This commit is contained in:
ajacoutot 2015-06-04 05:58:43 +00:00
parent a9ce7f64cd
commit fd433c3589
2 changed files with 46 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.105 2015/06/03 06:23:21 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.106 2015/06/04 05:58:43 ajacoutot Exp $
# XXX: Remember to bump MODCLANG_VERSION in lang/clang/clang.port.mk when
# updating this port.
@ -10,7 +10,7 @@ COMMENT = modular, fast C/C++/ObjC compiler, static analyzer and tools
LLVM_V = 3.5
DISTNAME = llvm-${LLVM_V}.20140228
REVISION = 32
REVISION = 33
CATEGORIES = devel
MASTER_SITES = http://comstyle.com/source/
EXTRACT_SUFX = .tar.xz

View File

@ -0,0 +1,44 @@
$OpenBSD: patch-lib_MC_MCParser_AsmParser_cpp,v 1.1 2015/06/04 05:58:43 ajacoutot Exp $
r229911
MC: Allow multiple comma-separated expressions on the .uleb128 directive.
--- lib/MC/MCParser/AsmParser.cpp.orig Thu Jun 4 00:34:57 2015
+++ lib/MC/MCParser/AsmParser.cpp Thu Jun 4 00:40:09 2015
@@ -3574,21 +3574,27 @@ bool AsmParser::parseDirectiveSpace(StringRef IDVal) {
}
/// 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;
}