LLVM  6.0.0svn
MCAsmLexer.cpp
Go to the documentation of this file.
1 //===- MCAsmLexer.cpp - Abstract Asm Lexer Interface ----------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
11 #include "llvm/ADT/StringRef.h"
12 #include "llvm/Support/SMLoc.h"
13 
14 using namespace llvm;
15 
16 MCAsmLexer::MCAsmLexer() : AltMacroMode(false) {
17  CurTok.emplace_back(AsmToken::Space, StringRef());
18 }
19 
20 MCAsmLexer::~MCAsmLexer() = default;
21 
24 }
25 
27  return SMLoc::getFromPointer(Str.data());
28 }
29 
31  return SMLoc::getFromPointer(Str.data() + Str.size());
32 }
33 
35  return SMRange(getLoc(), getEndLoc());
36 }
Represents a range in source code.
Definition: SMLoc.h:49
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
SMRange getLocRange() const
Definition: MCAsmLexer.cpp:34
SMLoc getLoc() const
Get the current source location.
Definition: MCAsmLexer.cpp:22
SMLoc getLoc() const
Definition: MCAsmLexer.cpp:26
SMLoc getEndLoc() const
Definition: MCAsmLexer.cpp:30
const char * TokStart
Definition: MCAsmLexer.h:158
static SMLoc getFromPointer(const char *Ptr)
Definition: SMLoc.h:37
virtual ~MCAsmLexer()
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
Represents a location in source code.
Definition: SMLoc.h:24