2009-07-21 04:01:54 +08: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 09:44:57 +08:00
|
|
|
#include "llvm/MC/MCParser/MCAsmLexer.h"
|
2009-08-14 10:18:40 +08:00
|
|
|
#include "llvm/Support/SourceMgr.h"
|
2009-07-21 04:01:54 +08:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
2012-09-20 04:36:12 +08:00
|
|
|
MCAsmLexer::MCAsmLexer() : CurTok(AsmToken::Error, StringRef()),
|
2014-04-24 14:44:33 +08:00
|
|
|
TokStart(nullptr), SkipSpace(true) {
|
2009-07-21 04:01:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
MCAsmLexer::~MCAsmLexer() {
|
|
|
|
}
|
2009-08-14 10:18:40 +08:00
|
|
|
|
2010-07-13 01:10:00 +08:00
|
|
|
SMLoc MCAsmLexer::getLoc() const {
|
|
|
|
return SMLoc::getFromPointer(TokStart);
|
|
|
|
}
|
|
|
|
|
2009-08-14 10:18:40 +08:00
|
|
|
SMLoc AsmToken::getLoc() const {
|
|
|
|
return SMLoc::getFromPointer(Str.data());
|
|
|
|
}
|
2011-10-16 20:10:27 +08:00
|
|
|
|
|
|
|
SMLoc AsmToken::getEndLoc() const {
|
2013-01-08 03:00:49 +08:00
|
|
|
return SMLoc::getFromPointer(Str.data() + Str.size());
|
2011-10-16 20:10:27 +08:00
|
|
|
}
|
2014-10-03 23:37:37 +08:00
|
|
|
|
|
|
|
SMRange AsmToken::getLocRange() const {
|
|
|
|
return SMRange(getLoc(), getEndLoc());
|
|
|
|
}
|