summaryrefslogtreecommitdiffstats
path: root/clang/tools/c-index-test
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
commit5ccfc98d197f32a6fb4103d07dfd9325500bb4b7 (patch)
treea8cd7662385bfd2b541c5086a6f2b95703e1ec6e /clang/tools/c-index-test
parentbbf7fa317a777bb125df2f16fef83ba01af944e6 (diff)
downloadbcm5719-llvm-5ccfc98d197f32a6fb4103d07dfd9325500bb4b7.tar.gz
bcm5719-llvm-5ccfc98d197f32a6fb4103d07dfd9325500bb4b7.zip
Fix compiler warning: "ISO C90 forbids mixed declarations and code"
llvm-svn: 84318
Diffstat (limited to 'clang/tools/c-index-test')
-rw-r--r--clang/tools/c-index-test/c-index-test.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c
index 1ad48266eee..fc84faac2bb 100644
--- a/clang/tools/c-index-test/c-index-test.c
+++ b/clang/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);
OpenPOWER on IntegriCloud