aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-11-09 18:24:53 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2009-11-09 18:24:53 +0000
commit858e5de143d36815b9cd4dcaf01614e1a8e502f2 (patch)
tree7a0982e08e2244885e99992ef66782e6729b2ed8
parent88d23952eadb0737e5bd839654d69a0a578e19bc (diff)
Writing to a struct passed by value is pointless. Remove dead code.
- free(NULL) is a nop anyway. - if someone thinks calling clang_disposeString twice should be legal please change the method to take a pointer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86568 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/CIndex/CIndex.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index 8fba3cf6b5..ac297e64a1 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -958,13 +958,8 @@ const char *clang_getCString(CXString string) {
// Free CXString.
void clang_disposeString(CXString string) {
- if (string.MustFreeString) {
- if (string.Spelling) {
- free((void *)string.Spelling);
- string.Spelling = NULL;
- }
- string.MustFreeString = 0;
- }
+ if (string.MustFreeString)
+ free((void*)string.Spelling);
}
unsigned clang_getCursorColumn(CXCursor C)