mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-22 20:18:38 +00:00
c51124b83c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294685 91177308-0d34-0410-b5e6-96231b3b80d8
37 lines
931 B
C++
37 lines
931 B
C++
//===- 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.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/ADT/StringRef.h"
|
|
#include "llvm/MC/MCParser/MCAsmLexer.h"
|
|
#include "llvm/Support/SMLoc.h"
|
|
|
|
using namespace llvm;
|
|
|
|
MCAsmLexer::MCAsmLexer() {
|
|
CurTok.emplace_back(AsmToken::Space, StringRef());
|
|
}
|
|
|
|
MCAsmLexer::~MCAsmLexer() = default;
|
|
|
|
SMLoc MCAsmLexer::getLoc() const {
|
|
return SMLoc::getFromPointer(TokStart);
|
|
}
|
|
|
|
SMLoc AsmToken::getLoc() const {
|
|
return SMLoc::getFromPointer(Str.data());
|
|
}
|
|
|
|
SMLoc AsmToken::getEndLoc() const {
|
|
return SMLoc::getFromPointer(Str.data() + Str.size());
|
|
}
|
|
|
|
SMRange AsmToken::getLocRange() const {
|
|
return SMRange(getLoc(), getEndLoc());
|
|
}
|