]>
git.proxmox.com Git - rustc.git/blob - src/llvm/lib/MC/MCParser/MCAsmLexer.cpp
1 //===-- MCAsmLexer.cpp - Abstract Asm Lexer Interface ---------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/MC/MCParser/MCAsmLexer.h"
11 #include "llvm/Support/SourceMgr.h"
15 MCAsmLexer::MCAsmLexer() : CurTok(AsmToken::Error
, StringRef()),
16 TokStart(nullptr), SkipSpace(true) {
19 MCAsmLexer::~MCAsmLexer() {
22 SMLoc
MCAsmLexer::getLoc() const {
23 return SMLoc::getFromPointer(TokStart
);
26 SMLoc
AsmToken::getLoc() const {
27 return SMLoc::getFromPointer(Str
.data());
30 SMLoc
AsmToken::getEndLoc() const {
31 return SMLoc::getFromPointer(Str
.data() + Str
.size());
34 SMRange
AsmToken::getLocRange() const {
35 return SMRange(getLoc(), getEndLoc());