From 2298981669bf3bd63335a4be179bc0f96823a8f4 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 20 Aug 2019 20:50:49 +0000 Subject: Vendor import of stripped clang trunk r366426 (just before the release_90 branch point): https://llvm.org/svn/llvm-project/cfe/trunk@366426 --- include/clang/Basic/SourceLocation.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'include/clang/Basic/SourceLocation.h') diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h index 014bdc3f3f0bd..d6e2f6e6de94d 100644 --- a/include/clang/Basic/SourceLocation.h +++ b/include/clang/Basic/SourceLocation.h @@ -1,9 +1,8 @@ //===- SourceLocation.h - Compact identifier for Source Files ---*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -26,7 +25,6 @@ namespace llvm { template struct DenseMapInfo; -template struct isPodLike; } // namespace llvm @@ -284,13 +282,15 @@ public: /// You can get a PresumedLoc from a SourceLocation with SourceManager. class PresumedLoc { const char *Filename = nullptr; + FileID ID; unsigned Line, Col; SourceLocation IncludeLoc; public: PresumedLoc() = default; - PresumedLoc(const char *FN, unsigned Ln, unsigned Co, SourceLocation IL) - : Filename(FN), Line(Ln), Col(Co), IncludeLoc(IL) {} + PresumedLoc(const char *FN, FileID FID, unsigned Ln, unsigned Co, + SourceLocation IL) + : Filename(FN), ID(FID), Line(Ln), Col(Co), IncludeLoc(IL) {} /// Return true if this object is invalid or uninitialized. /// @@ -307,6 +307,11 @@ public: return Filename; } + FileID getFileID() const { + assert(isValid()); + return ID; + } + /// Return the presumed line number of this location. /// /// This can be affected by \#line etc. @@ -458,11 +463,6 @@ namespace llvm { } }; - template <> - struct isPodLike { static const bool value = true; }; - template <> - struct isPodLike { static const bool value = true; }; - // Teach SmallPtrSet how to handle SourceLocation. template<> struct PointerLikeTypeTraits { -- cgit v1.2.3