LLVM  4.0.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), IsAtStartOfStatement(true),
17  CommentConsumer(nullptr) {
18  CurTok.emplace_back(AsmToken::Space, StringRef());
19 }
20 
22 }
23 
26 }
27 
29  return SMLoc::getFromPointer(Str.data());
30 }
31 
33  return SMLoc::getFromPointer(Str.data() + Str.size());
34 }
35 
37  return SMRange(getLoc(), getEndLoc());
38 }
Represents a range in source code.
Definition: SMLoc.h:49
SMLoc getLoc() const
Get the current source location.
Definition: MCAsmLexer.cpp:24
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
Definition: StringRef.h:135
SMLoc getLoc() const
Definition: MCAsmLexer.cpp:28
const char * TokStart
Definition: MCAsmLexer.h:158
SMRange getLocRange() const
Definition: MCAsmLexer.cpp:36
static SMLoc getFromPointer(const char *Ptr)
Definition: SMLoc.h:37
Basic Alias true
virtual ~MCAsmLexer()
Definition: MCAsmLexer.cpp:21
SMLoc getEndLoc() const
Definition: MCAsmLexer.cpp:32
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition: StringRef.h:125
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47
Represents a location in source code.
Definition: SMLoc.h:24