aboutsummaryrefslogtreecommitdiff
path: root/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-10-17 06:42:15 +0000
committerTed Kremenek <kremenek@apple.com>2009-10-17 06:42:15 +0000
commit85f5468d87c2e767ee632c16d01c7d9e31a1fcbd (patch)
tree6aae2c22068ddcd6368be70a83e1a29d184bbbed /tools/c-index-test/c-index-test.c
parent8ce88a449c4ae09af2108f5c1203caa37145817d (diff)
Fix compiler warning: "ISO C90 forbids mixed declarations and code"
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84318 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/c-index-test/c-index-test.c')
-rw-r--r--tools/c-index-test/c-index-test.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 1ad48266ee..fc84faac2b 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -87,15 +87,21 @@ int main(int argc, char **argv) {
return 0;
}
{
- CXIndex Idx = clang_createIndex();
+ CXIndex Idx;
+ CXTranslationUnit TU;
+ enum CXCursorKind K = CXCursor_NotImplemented;
+
+ Idx = clang_createIndex();
+
if (!strcmp(argv[2], "local"))
clang_wantOnlyLocalDeclarations(Idx);
- CXTranslationUnit TU = clang_createTranslationUnit(Idx, argv[1]);
+
+ TU = clang_createTranslationUnit(Idx, argv[1]);
+
if (!TU) {
fprintf(stderr, "Unable to load translation unit!\n");
return 1;
}
- enum CXCursorKind K = CXCursor_NotImplemented;
if (!strcmp(argv[2], "all") || !strcmp(argv[2], "local")) {
clang_loadTranslationUnit(TU, TranslationUnitVisitor, 0);