diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2014-08-16 00:26:19 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2014-08-16 00:26:19 +0000 |
commit | ac3997eb52022555af90d9be49e7e7fa4afa2672 (patch) | |
tree | 540660dd5f27bcb9f2294ceab2f3aa8b4148f6b1 /clang/tools | |
parent | 41a55ad0a5c71af70dfe8b7a4f934e2063a52f06 (diff) | |
download | bcm5719-llvm-ac3997eb52022555af90d9be49e7e7fa4afa2672.tar.gz bcm5719-llvm-ac3997eb52022555af90d9be49e7e7fa4afa2672.zip |
[libclang] Introduce clang_File_isEqual for comparing CXFile handles.
llvm-svn: 215796
Diffstat (limited to 'clang/tools')
-rw-r--r-- | clang/tools/libclang/CIndex.cpp | 12 | ||||
-rw-r--r-- | clang/tools/libclang/libclang.exports | 1 |
2 files changed, 13 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" //===----------------------------------------------------------------------===// diff --git a/clang/tools/libclang/libclang.exports b/clang/tools/libclang/libclang.exports index ad0d585c850..5a029f7e4f9 100644 --- a/clang/tools/libclang/libclang.exports +++ b/clang/tools/libclang/libclang.exports @@ -25,6 +25,7 @@ clang_Cursor_isNull clang_Cursor_isObjCOptional clang_Cursor_isVariadic clang_Cursor_getModule +clang_File_isEqual clang_Module_getASTFile clang_Module_getParent clang_Module_getName |