From b773203fb58f3ef282fb69c832d8710cab5bc82d Mon Sep 17 00:00:00 2001 From: patrick Date: Sun, 27 Jan 2019 16:42:12 +0000 Subject: Import LLVM 7.0.1 release including clang, lld and lldb. --- gnu/llvm/tools/clang/lib/Basic/SourceLocation.cpp | 32 +++++++---------------- 1 file changed, 10 insertions(+), 22 deletions(-) (limited to 'gnu/llvm/tools/clang/lib/Basic/SourceLocation.cpp') diff --git a/gnu/llvm/tools/clang/lib/Basic/SourceLocation.cpp b/gnu/llvm/tools/clang/lib/Basic/SourceLocation.cpp index 89ddbc946a4..eb916ec76fd 100644 --- a/gnu/llvm/tools/clang/lib/Basic/SourceLocation.cpp +++ b/gnu/llvm/tools/clang/lib/Basic/SourceLocation.cpp @@ -1,4 +1,4 @@ -//==--- SourceLocation.cpp - Compact identifier for Source Files -*- C++ -*-==// +//===- SourceLocation.cpp - Compact identifier for Source Files -----------===// // // The LLVM Compiler Infrastructure // @@ -12,10 +12,17 @@ //===----------------------------------------------------------------------===// #include "clang/Basic/SourceLocation.h" +#include "clang/Basic/LLVM.h" #include "clang/Basic/PrettyStackTrace.h" #include "clang/Basic/SourceManager.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/Compiler.h" +#include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" -#include +#include +#include +#include + using namespace clang; //===----------------------------------------------------------------------===// @@ -42,7 +49,7 @@ void SourceLocation::print(raw_ostream &OS, const SourceManager &SM)const{ if (isFileID()) { PresumedLoc PLoc = SM.getPresumedLoc(*this); - + if (PLoc.isInvalid()) { OS << ""; return; @@ -81,7 +88,6 @@ FileID FullSourceLoc::getFileID() const { return SrcMgr->getFileID(*this); } - FullSourceLoc FullSourceLoc::getExpansionLoc() const { assert(isValid()); return FullSourceLoc(SrcMgr->getExpansionLoc(*this), *SrcMgr); @@ -97,15 +103,6 @@ FullSourceLoc FullSourceLoc::getFileLoc() const { return FullSourceLoc(SrcMgr->getFileLoc(*this), *SrcMgr); } -std::pair -FullSourceLoc::getImmediateExpansionRange() const { - assert(isValid()); - std::pair Range = - SrcMgr->getImmediateExpansionRange(*this); - return std::make_pair(FullSourceLoc(Range.first, *SrcMgr), - FullSourceLoc(Range.second, *SrcMgr)); -} - PresumedLoc FullSourceLoc::getPresumedLoc(bool UseLineDirectives) const { if (!isValid()) return PresumedLoc(); @@ -148,15 +145,6 @@ unsigned FullSourceLoc::getColumnNumber(bool *Invalid) const { return SrcMgr->getColumnNumber(getFileID(), getFileOffset(), Invalid); } -std::pair -FullSourceLoc::getExpansionRange() const { - assert(isValid()); - std::pair Range = - SrcMgr->getExpansionRange(*this); - return std::make_pair(FullSourceLoc(Range.first, *SrcMgr), - FullSourceLoc(Range.second, *SrcMgr)); -} - const FileEntry *FullSourceLoc::getFileEntry() const { assert(isValid()); return SrcMgr->getFileEntryForID(getFileID()); -- cgit v1.2.3-59-g8ed1b