From 31729162bcfe8073356c98d046e9838b0935d2e1 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 27 May 2010 16:57:42 +0000 Subject: [PATCH] Remove clang_isFromMainFile(). It doesn't work correctly with CXDiagnostics, and we shouldn't have an API around that cannot be implemented correctly yet. llvm-svn: 104849 --- clang/include/clang-c/Index.h | 6 ------ clang/tools/libclang/CIndex.cpp | 10 ---------- clang/tools/libclang/libclang.darwin.exports | 1 - clang/tools/libclang/libclang.exports | 1 - 4 files changed, 18 deletions(-) diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 86926bd683ba..ef779d622a8a 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -342,12 +342,6 @@ CINDEX_LINKAGE CXSourceLocation clang_getRangeStart(CXSourceRange range); */ CINDEX_LINKAGE CXSourceLocation clang_getRangeEnd(CXSourceRange range); -/** - * \brief Determine if the source location occurs within the main file - * of the translation unit (as opposed to an included header). - */ -CINDEX_LINKAGE unsigned clang_isFromMainFile(CXSourceLocation loc); - /** * @} */ diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index a077589c8f79..21396ad1c536 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -1479,16 +1479,6 @@ CXSourceLocation clang_getRangeEnd(CXSourceRange range) { return Result; } -unsigned clang_isFromMainFile(CXSourceLocation loc) { - SourceLocation Loc = SourceLocation::getFromRawEncoding(loc.int_data); - if (!loc.ptr_data[0] || Loc.isInvalid()) - return 0; - - const SourceManager &SM = - *static_cast(loc.ptr_data[0]); - return SM.isFromMainFile(Loc) ? 1 : 0; -} - } // end: extern "C" //===----------------------------------------------------------------------===// diff --git a/clang/tools/libclang/libclang.darwin.exports b/clang/tools/libclang/libclang.darwin.exports index a9f4f0777cdc..3ef3b748547b 100644 --- a/clang/tools/libclang/libclang.darwin.exports +++ b/clang/tools/libclang/libclang.darwin.exports @@ -78,7 +78,6 @@ _clang_getTypeKindSpelling _clang_isCursorDefinition _clang_isDeclaration _clang_isExpression -_clang_isFromMainFile _clang_isInvalid _clang_isPreprocessing _clang_isReference diff --git a/clang/tools/libclang/libclang.exports b/clang/tools/libclang/libclang.exports index b09e6ac56c85..7df674037ba4 100644 --- a/clang/tools/libclang/libclang.exports +++ b/clang/tools/libclang/libclang.exports @@ -78,7 +78,6 @@ clang_getTypeKindSpelling clang_isCursorDefinition clang_isDeclaration clang_isExpression -clang_isFromMainFile clang_isInvalid clang_isPreprocessing clang_isReference -- GitLab