mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
c95190a559
This is necessary not only for representing empty ranges, but for handling multibyte characters in the input. (If the end pointer in a range refers to a multibyte character, should it point to the beginning or the end of the character in a char array?) Some of the code in the asm parsers was already assuming this anyway. llvm-svn: 171765
33 lines
855 B
C++
33 lines
855 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/MC/MCParser/MCAsmLexer.h"
|
|
#include "llvm/Support/SourceMgr.h"
|
|
|
|
using namespace llvm;
|
|
|
|
MCAsmLexer::MCAsmLexer() : CurTok(AsmToken::Error, StringRef()),
|
|
TokStart(0), SkipSpace(true) {
|
|
}
|
|
|
|
MCAsmLexer::~MCAsmLexer() {
|
|
}
|
|
|
|
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());
|
|
}
|