LLVM  3.7.0
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/Support/SourceMgr.h"
12 
13 using namespace llvm;
14 
16  TokStart(nullptr), SkipSpace(true) {
17 }
18 
20 }
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:47
size_t size() const
size - Get the string size.
Definition: StringRef.h:113
SMLoc getLoc() const
Get the current source location.
Definition: MCAsmLexer.cpp:22
Target independent representation for an assembler token.
Definition: MCAsmLexer.h:22
const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition: StringRef.h:107
#define true
Definition: ConvertUTF.c:66
SMLoc getLoc() const
Definition: MCAsmLexer.cpp:26
const char * TokStart
Definition: MCAsmLexer.h:130
SMRange getLocRange() const
Definition: MCAsmLexer.cpp:34
static SMLoc getFromPointer(const char *Ptr)
Definition: SMLoc.h:35
virtual ~MCAsmLexer()
Definition: MCAsmLexer.cpp:19
SMLoc getEndLoc() const
Definition: MCAsmLexer.cpp:30
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40
Represents a location in source code.
Definition: SMLoc.h:23