LLVM API Documentation

MCAsmLexer.cpp
Go to the documentation of this file.
00001 //===-- MCAsmLexer.cpp - Abstract Asm Lexer Interface ---------------------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #include "llvm/MC/MCParser/MCAsmLexer.h"
00011 #include "llvm/Support/SourceMgr.h"
00012 
00013 using namespace llvm;
00014 
00015 MCAsmLexer::MCAsmLexer() : CurTok(AsmToken::Error, StringRef()),
00016                            TokStart(nullptr), SkipSpace(true) {
00017 }
00018 
00019 MCAsmLexer::~MCAsmLexer() {
00020 }
00021 
00022 SMLoc MCAsmLexer::getLoc() const {
00023   return SMLoc::getFromPointer(TokStart);
00024 }
00025 
00026 SMLoc AsmToken::getLoc() const {
00027   return SMLoc::getFromPointer(Str.data());
00028 }
00029 
00030 SMLoc AsmToken::getEndLoc() const {
00031   return SMLoc::getFromPointer(Str.data() + Str.size());
00032 }