summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CIndex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/tools/libclang/CIndex.cpp')
-rw-r--r--clang/tools/libclang/CIndex.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 716f79ac33e..97a27591cf7 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -3283,6 +3283,18 @@ int clang_getFileUniqueID(CXFile file, CXFileUniqueID *outID) {
return 0;
}
+int clang_File_isEqual(CXFile file1, CXFile file2) {
+ if (file1 == file2)
+ return true;
+
+ if (!file1 || !file2)
+ return false;
+
+ FileEntry *FEnt1 = static_cast<FileEntry *>(file1);
+ FileEntry *FEnt2 = static_cast<FileEntry *>(file2);
+ return FEnt1->getUniqueID() == FEnt2->getUniqueID();
+}
+
} // end: extern "C"
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud