From ff4bc460c52c1f285d8a56da173641bf92d49e3f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 10 Aug 2009 01:39:42 +0000 Subject: Make the big switch: Change MCSectionMachO to represent a section *semantically* instead of syntactically as a string. This means that it keeps track of the segment, section, flags, etc directly and asmprints them in the right format. This also includes parsing and validation support for llvm-mc and "attribute(section)", so we should now start getting errors about invalid section attributes from the compiler instead of the assembler on darwin. Still todo: 1) Uniquing of darwin mcsections 2) Move all the Darwin stuff out to MCSectionMachO.[cpp|h] 3) there are a few FIXMEs, for example what is the syntax to get the S_GB_ZEROFILL segment type? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78547 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-mc/AsmLexer.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tools/llvm-mc/AsmLexer.cpp') diff --git a/tools/llvm-mc/AsmLexer.cpp b/tools/llvm-mc/AsmLexer.cpp index 28b0c1e3c9..5b394b6cc4 100644 --- a/tools/llvm-mc/AsmLexer.cpp +++ b/tools/llvm-mc/AsmLexer.cpp @@ -242,6 +242,17 @@ AsmToken AsmLexer::LexQuote() { return AsmToken(AsmToken::String, StringRef(TokStart, CurPtr - TokStart)); } +StringRef AsmLexer::LexUntilEndOfStatement() { + TokStart = CurPtr; + + while (*CurPtr != '#' && // Start of line comment. + *CurPtr != ';' && // End of statement marker. + *CurPtr != '\n' && + *CurPtr != '\r' && + (*CurPtr != 0 || CurPtr != CurBuf->getBufferEnd())) + ++CurPtr; + return StringRef(TokStart, CurPtr-TokStart); +} AsmToken AsmLexer::LexToken() { TokStart = CurPtr; -- cgit v1.2.3-18-g5258