MCAsmLexer.cpp revision 5efabcf01d1c9cdf7ac59a17d757c6ad4cdb112c
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 10#include "llvm/MC/MCParser/MCAsmLexer.h" 11#include "llvm/Support/SourceMgr.h" 12 13using namespace llvm; 14 15MCAsmLexer::MCAsmLexer() : CurTok(AsmToken::Error, StringRef()), TokStart(0) { 16} 17 18MCAsmLexer::~MCAsmLexer() { 19} 20 21SMLoc MCAsmLexer::getLoc() const { 22 return SMLoc::getFromPointer(TokStart); 23} 24 25SMLoc AsmToken::getLoc() const { 26 return SMLoc::getFromPointer(Str.data()); 27} 28 29SMLoc AsmToken::getEndLoc() const { 30 return SMLoc::getFromPointer(Str.data() + Str.size() - 1); 31} 32