2009-07-20 22:01:54 +02:00
|
|
|
//===-- MCAsmLexer.cpp - Abstract Asm Lexer Interface ---------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2010-01-22 02:44:57 +01:00
|
|
|
#include "llvm/MC/MCParser/MCAsmLexer.h"
|
2009-08-14 04:18:40 +02:00
|
|
|
#include "llvm/Support/SourceMgr.h"
|
2009-07-20 22:01:54 +02:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
2016-09-16 20:30:20 +02:00
|
|
|
MCAsmLexer::MCAsmLexer()
|
|
|
|
: TokStart(nullptr), SkipSpace(true), IsAtStartOfStatement(true) {
|
2016-06-02 19:15:05 +02:00
|
|
|
CurTok.emplace_back(AsmToken::Space, StringRef());
|
2009-07-20 22:01:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
MCAsmLexer::~MCAsmLexer() {
|
|
|
|
}
|
2009-08-14 04:18:40 +02:00
|
|
|
|
2010-07-12 19:10:00 +02:00
|
|
|
SMLoc MCAsmLexer::getLoc() const {
|
|
|
|
return SMLoc::getFromPointer(TokStart);
|
|
|
|
}
|
|
|
|
|
2009-08-14 04:18:40 +02:00
|
|
|
SMLoc AsmToken::getLoc() const {
|
|
|
|
return SMLoc::getFromPointer(Str.data());
|
|
|
|
}
|
2011-10-16 14:10:27 +02:00
|
|
|
|
|
|
|
SMLoc AsmToken::getEndLoc() const {
|
2013-01-07 20:00:49 +01:00
|
|
|
return SMLoc::getFromPointer(Str.data() + Str.size());
|
2011-10-16 14:10:27 +02:00
|
|
|
}
|
2014-10-03 17:37:37 +02:00
|
|
|
|
|
|
|
SMRange AsmToken::getLocRange() const {
|
|
|
|
return SMRange(getLoc(), getEndLoc());
|
|
|
|
}
|