2009-07-20 20:01:54 +00: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 01:44:57 +00:00
|
|
|
#include "llvm/MC/MCParser/MCAsmLexer.h"
|
2009-08-14 02:18:40 +00:00
|
|
|
#include "llvm/Support/SourceMgr.h"
|
2009-07-20 20:01:54 +00:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
2010-07-12 17:10:00 +00:00
|
|
|
MCAsmLexer::MCAsmLexer() : CurTok(AsmToken::Error, StringRef()), TokStart(0) {
|
2009-07-20 20:01:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
MCAsmLexer::~MCAsmLexer() {
|
|
|
|
}
|
2009-08-14 02:18:40 +00:00
|
|
|
|
2010-07-12 17:10:00 +00:00
|
|
|
SMLoc MCAsmLexer::getLoc() const {
|
|
|
|
return SMLoc::getFromPointer(TokStart);
|
|
|
|
}
|
|
|
|
|
2009-08-14 02:18:40 +00:00
|
|
|
SMLoc AsmToken::getLoc() const {
|
|
|
|
return SMLoc::getFromPointer(Str.data());
|
|
|
|
}
|
2011-10-16 12:10:27 +00:00
|
|
|
|
|
|
|
SMLoc AsmToken::getEndLoc() const {
|
|
|
|
return SMLoc::getFromPointer(Str.data() + Str.size() - 1);
|
|
|
|
}
|