diff options
Diffstat (limited to 'tools/llvm-c-test/module.c')
-rw-r--r-- | tools/llvm-c-test/module.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/llvm-c-test/module.c b/tools/llvm-c-test/module.c index 50e6e9c6de..180238664f 100644 --- a/tools/llvm-c-test/module.c +++ b/tools/llvm-c-test/module.c @@ -58,16 +58,18 @@ int module_list_functions(void) { if (LLVMIsDeclaration(f)) { printf("FunctionDeclaration: %s\n", LLVMGetValueName(f)); } else { + LLVMBasicBlockRef bb; + LLVMValueRef isn; unsigned nisn = 0; unsigned nbb = 0; printf("FunctionDefinition: %s [#bb=%u]\n", LLVMGetValueName(f), LLVMCountBasicBlocks(f)); - for (LLVMBasicBlockRef bb = LLVMGetFirstBasicBlock(f); bb; + for (bb = LLVMGetFirstBasicBlock(f); bb; bb = LLVMGetNextBasicBlock(bb)) { nbb++; - for (LLVMValueRef isn = LLVMGetFirstInstruction(bb); isn; + for (isn = LLVMGetFirstInstruction(bb); isn; isn = LLVMGetNextInstruction(isn)) { nisn++; if (LLVMIsACallInst(isn)) { |