summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-03-17 00:11:42 +0000
committerJim Grosbach <grosbach@apple.com>2012-03-17 00:11:42 +0000
commit2c8e0ac85c89eff01e7a44ce0c0751010cca6c74 (patch)
treee312faf10864a37fe1126bddd76e9bbf904ff8a9 /llvm/lib
parent0f73197364e04a9a52e11151564a73ae2bf4214e (diff)
downloadbcm5719-llvm-2c8e0ac85c89eff01e7a44ce0c0751010cca6c74.tar.gz
bcm5719-llvm-2c8e0ac85c89eff01e7a44ce0c0751010cca6c74.zip
MC asm parser macro argument count was wrong when empty.
evaluated to '1' when the argument list was empty (should be '0'). rdar://11057257 llvm-svn: 152967
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index bd5956f9b48..41ad1642d28 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -1528,6 +1528,11 @@ bool AsmParser::HandleMacroEntry(StringRef Name, SMLoc NameLoc,
}
Lex();
}
+ // If there weren't any arguments, erase the token vector so everything
+ // else knows that. Leaving around the vestigal empty token list confuses
+ // things.
+ if (MacroArguments.size() == 1 && MacroArguments.back().empty())
+ MacroArguments.clear();
// Macro instantiation is lexical, unfortunately. We construct a new buffer
// to hold the macro body with substitutions.
OpenPOWER on IntegriCloud