aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/SourceLocation.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Basic/SourceLocation.h')
-rw-r--r--include/clang/Basic/SourceLocation.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h
index 014bdc3f3f0b..d6e2f6e6de94 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 <typename T> struct DenseMapInfo;
-template <typename T> 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<clang::SourceLocation> { static const bool value = true; };
- template <>
- struct isPodLike<clang::FileID> { static const bool value = true; };
-
// Teach SmallPtrSet how to handle SourceLocation.
template<>
struct PointerLikeTypeTraits<clang::SourceLocation> {