aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-01-20 00:26:57 +0000
committerDouglas Gregor <dgregor@apple.com>2010-01-20 00:26:57 +0000
commite0356b10832390d5f44b3dc7ad4e6e104ebad556 (patch)
tree75bcf135eb52d38fc844ea4a1fcd162526e61b14
parent7eaa8ae8692c5cd3eed8cb334fe5346470522091 (diff)
Kill off clang_getDeclColumn, clang_getDeclExtent, clang_getDeclLine,
clang_getDeclSource, and clang_getDeclSourceFile; the cursor equivalents are the way of the future. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93955 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang-c/Index.h11
-rw-r--r--tools/CIndex/CIndex.cpp42
-rw-r--r--tools/CIndex/CIndex.exports6
3 files changed, 0 insertions, 59 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
index d203ff8b8f..00e47be2b7 100644
--- a/include/clang-c/Index.h
+++ b/include/clang-c/Index.h
@@ -416,10 +416,6 @@ CINDEX_LINKAGE CXDecl clang_getDeclaration(CXEntity, CXTranslationUnit);
CINDEX_LINKAGE CXCursor clang_getCursorFromDecl(CXDecl);
CINDEX_LINKAGE CXEntity clang_getEntityFromDecl(CXIndex, CXDecl);
CINDEX_LINKAGE CXString clang_getDeclSpelling(CXDecl);
-CINDEX_LINKAGE unsigned clang_getDeclLine(CXDecl); /* deprecate */
-CINDEX_LINKAGE unsigned clang_getDeclColumn(CXDecl); /* deprecate */
-CINDEX_LINKAGE const char *clang_getDeclSource(CXDecl); /* deprecate */
-CINDEX_LINKAGE CXFile clang_getDeclSourceFile(CXDecl); /* deprecate */
/**
* \brief Identifies a specific source location within a translation
@@ -478,13 +474,6 @@ CINDEX_LINKAGE CXSourceLocation clang_getRangeStart(CXSourceRange range);
*/
CINDEX_LINKAGE CXSourceLocation clang_getRangeEnd(CXSourceRange range);
-/* clang_getDeclExtent() returns the physical extent of a declaration. The
- * beginning line/column pair points to the start of the first token in the
- * declaration, and the ending line/column pair points to the last character in
- * the last token of the declaration.
- */
-CINDEX_LINKAGE CXSourceRange clang_getDeclExtent(CXDecl);
-
/*
* CXCursor Operations.
*/
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index 8dfaa4cbe1..395f1a1c8d 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -691,16 +691,6 @@ CXSourceLocation clang_getRangeEnd(CXSourceRange range) {
// CXDecl Operations.
//===----------------------------------------------------------------------===//
-static const FileEntry *getFileEntryFromSourceLocation(SourceManager &SMgr,
- SourceLocation SLoc) {
- FileID FID;
- if (SLoc.isFileID())
- FID = SMgr.getFileID(SLoc);
- else
- FID = SMgr.getDecomposedSpellingLoc(SLoc).first;
- return SMgr.getFileEntryForID(FID);
-}
-
extern "C" {
CXString clang_getDeclSpelling(CXDecl AnonDecl) {
assert(AnonDecl && "Passed null CXDecl");
@@ -725,38 +715,6 @@ CXString clang_getDeclSpelling(CXDecl AnonDecl) {
return CIndexer::createCXString("");
}
-unsigned clang_getDeclLine(CXDecl AnonDecl) {
- assert(AnonDecl && "Passed null CXDecl");
- NamedDecl *ND = static_cast<NamedDecl *>(AnonDecl);
- SourceManager &SourceMgr = ND->getASTContext().getSourceManager();
- return SourceMgr.getSpellingLineNumber(ND->getLocation());
-}
-
-unsigned clang_getDeclColumn(CXDecl AnonDecl) {
- assert(AnonDecl && "Passed null CXDecl");
- NamedDecl *ND = static_cast<NamedDecl *>(AnonDecl);
- SourceManager &SourceMgr = ND->getASTContext().getSourceManager();
- return SourceMgr.getSpellingColumnNumber(ND->getLocation());
-}
-
-CXSourceRange clang_getDeclExtent(CXDecl AnonDecl) {
- return clang_getCursorExtent(clang_getCursorFromDecl(AnonDecl));
-}
-
-const char *clang_getDeclSource(CXDecl AnonDecl) {
- assert(AnonDecl && "Passed null CXDecl");
- FileEntry *FEnt = static_cast<FileEntry *>(clang_getDeclSourceFile(AnonDecl));
- assert(FEnt && "Cannot find FileEntry for Decl");
- return clang_getFileName(FEnt);
-}
-
-
-CXFile clang_getDeclSourceFile(CXDecl AnonDecl) {
- assert(AnonDecl && "Passed null CXDecl");
- NamedDecl *ND = static_cast<NamedDecl *>(AnonDecl);
- SourceManager &SourceMgr = ND->getASTContext().getSourceManager();
- return (void *)getFileEntryFromSourceLocation(SourceMgr, ND->getLocation());
-}
} // end: extern "C"
//===----------------------------------------------------------------------===//
diff --git a/tools/CIndex/CIndex.exports b/tools/CIndex/CIndex.exports
index 7a70e545b6..aedd17be5c 100644
--- a/tools/CIndex/CIndex.exports
+++ b/tools/CIndex/CIndex.exports
@@ -22,12 +22,6 @@ _clang_getCursorLocation
_clang_getCursorReferenced
_clang_getCursorSpelling
_clang_getCursorUSR
-_clang_getDeclColumn
-_clang_getDeclExtent
-_clang_getDeclExtent
-_clang_getDeclLine
-_clang_getDeclSource
-_clang_getDeclSourceFile
_clang_getDeclSpelling
_clang_getDeclaration
_clang_getDefinitionSpellingAndExtent