diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-01-20 23:34:41 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-01-20 23:34:41 +0000 |
commit | 58552bcd65fc18d9bfc57563cc095d1fa2ba3b4c (patch) | |
tree | d2e74981d13f9f753e96d4477cfaae2e4b5928ef /clang/tools/CIndex/CXCursor.cpp | |
parent | 3c5bf713535ee1fdfb75b5a1067d8d9cfa344556 (diff) | |
download | bcm5719-llvm-58552bcd65fc18d9bfc57563cc095d1fa2ba3b4c.tar.gz bcm5719-llvm-58552bcd65fc18d9bfc57563cc095d1fa2ba3b4c.zip |
Eliminate the MakeCXCursor routines that require their callers to know too much about the cursor's storage
llvm-svn: 94049
Diffstat (limited to 'clang/tools/CIndex/CXCursor.cpp')
-rw-r--r-- | clang/tools/CIndex/CXCursor.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/clang/tools/CIndex/CXCursor.cpp b/clang/tools/CIndex/CXCursor.cpp index 7dd3ae9cc00..7c8b33d1ae4 100644 --- a/clang/tools/CIndex/CXCursor.cpp +++ b/clang/tools/CIndex/CXCursor.cpp @@ -22,16 +22,10 @@ using namespace clang; -CXCursor cxcursor::MakeCXCursor(CXCursorKind K, Decl *D) { - CXCursor C = { K, { D, 0, 0 } }; - return C; -} - -CXCursor cxcursor::MakeCXCursor(CXCursorKind K, Decl *D, Stmt *S, - ASTContext &Context) { - assert(clang_isReference(K)); - CXCursor C = { K, { D, S, &Context } }; - return C; +CXCursor cxcursor::MakeCXCursorInvalid(CXCursorKind K) { + assert(K >= CXCursor_FirstInvalid && K <= CXCursor_LastInvalid); + CXCursor C = { K, { 0, 0, 0 } }; + return C; } static CXCursorKind GetCursorKind(Decl *D) { @@ -78,7 +72,8 @@ static CXCursorKind GetCursorKind(Decl *D) { } CXCursor cxcursor::MakeCXCursor(Decl *D) { - return MakeCXCursor(GetCursorKind(D), D); + CXCursor C = { GetCursorKind(D), { D, 0, 0 } }; + return C; } CXCursor cxcursor::MakeCXCursor(Stmt *S, Decl *Parent) { |