[llvm] r287075 - Fix build break when the host C compiler is C89.
Richard Smith via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 15 19:36:30 PST 2016
Author: rsmith
Date: Tue Nov 15 21:36:29 2016
New Revision: 287075
URL: http://llvm.org/viewvc/llvm-project?rev=287075&view=rev
Log:
Fix build break when the host C compiler is C89.
Modified:
llvm/trunk/tools/llvm-c-test/attributes.c
Modified: llvm/trunk/tools/llvm-c-test/attributes.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-c-test/attributes.c?rev=287075&r1=287074&r2=287075&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-c-test/attributes.c (original)
+++ llvm/trunk/tools/llvm-c-test/attributes.c Tue Nov 15 21:36:29 2016
@@ -24,7 +24,8 @@ int llvm_test_function_attributes(void)
LLVMValueRef F = LLVMGetFirstFunction(M);
while (F) {
// Read attributes
- for (int Idx = LLVMAttributeFunctionIndex, ParamCount = LLVMCountParams(F);
+ int Idx, ParamCount;
+ for (Idx = LLVMAttributeFunctionIndex, ParamCount = LLVMCountParams(F);
Idx <= ParamCount; ++Idx) {
int AttrCount = LLVMGetAttributeCountAtIndex(F, Idx);
LLVMAttributeRef *Attrs =
@@ -53,8 +54,9 @@ int llvm_test_callsite_attributes(void)
for (I = LLVMGetFirstInstruction(BB); I; I = LLVMGetNextInstruction(I)) {
if (LLVMIsACallInst(I)) {
// Read attributes
- for (int Idx = LLVMAttributeFunctionIndex,
- ParamCount = LLVMCountParams(F);
+ int Idx, ParamCount;
+ for (Idx = LLVMAttributeFunctionIndex,
+ ParamCount = LLVMCountParams(F);
Idx <= ParamCount; ++Idx) {
int AttrCount = LLVMGetCallSiteAttributeCount(I, Idx);
LLVMAttributeRef *Attrs = (LLVMAttributeRef *)malloc(
More information about the llvm-commits
mailing list