aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-mc/AsmParser.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-24 04:31:49 +0000
committerChris Lattner <sabre@nondot.org>2009-06-24 04:31:49 +0000
commite462e4e6ff10bba8c1fb816a51b7a2ed78426628 (patch)
tree26910e29853b269ea7cd8ee87dc65b8f3381280d /tools/llvm-mc/AsmParser.cpp
parent9d331725a787e00f73bcece2318430b587e16e29 (diff)
downloadexternal_llvm-e462e4e6ff10bba8c1fb816a51b7a2ed78426628.zip
external_llvm-e462e4e6ff10bba8c1fb816a51b7a2ed78426628.tar.gz
external_llvm-e462e4e6ff10bba8c1fb816a51b7a2ed78426628.tar.bz2
add trivial support for passing label definitions through the MCStreamer.
This is suboptimal in several aspects, see the commented out assertion. I need to talk to Daniel about this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74057 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-mc/AsmParser.cpp')
-rw-r--r--tools/llvm-mc/AsmParser.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/llvm-mc/AsmParser.cpp b/tools/llvm-mc/AsmParser.cpp
index 4dd136d..ca0b933 100644
--- a/tools/llvm-mc/AsmParser.cpp
+++ b/tools/llvm-mc/AsmParser.cpp
@@ -185,6 +185,12 @@ bool AsmParser::ParseStatement() {
if (Lexer.Lex() == asmtok::Colon) {
// identifier ':' -> Label.
Lexer.Lex();
+
+ // Since we saw a label, create a symbol and emit it.
+ // FIXME: If the label starts with L it is an assembler temporary label.
+ // Why does the client of this api need to know this?
+ Out.EmitLabel(Ctx.GetOrCreateSymbol(IDVal));
+
return ParseStatement();
}