diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index f6a6076df7b..6c1aa5ed10c 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -227,13 +227,15 @@ void TypePrinting::CalcTypeName(const Type *Ty, const StructType *STy = cast(Ty); if (STy->isPacked()) OS << '<'; - OS << "{ "; + OS << '{'; for (StructType::element_iterator I = STy->element_begin(), E = STy->element_end(); I != E; ++I) { - CalcTypeName(*I, TypeStack, OS); - if (next(I) != STy->element_end()) - OS << ','; OS << ' '; + CalcTypeName(*I, TypeStack, OS); + if (next(I) == STy->element_end()) + OS << ' '; + else + OS << ','; } OS << '}'; if (STy->isPacked()) @@ -242,13 +244,15 @@ void TypePrinting::CalcTypeName(const Type *Ty, } case Type::UnionTyID: { const UnionType *UTy = cast(Ty); - OS << "union { "; + OS << "union {"; for (StructType::element_iterator I = UTy->element_begin(), E = UTy->element_end(); I != E; ++I) { - CalcTypeName(*I, TypeStack, OS); - if (next(I) != UTy->element_end()) - OS << ','; OS << ' '; + CalcTypeName(*I, TypeStack, OS); + if (next(I) == UTy->element_end()) + OS << ' '; + else + OS << ','; } OS << '}'; break; diff --git a/test/FrontendC/2007-05-16-EmptyStruct.c b/test/FrontendC/2007-05-16-EmptyStruct.c index 748aa98351d..23c0b1d6a3f 100644 --- a/test/FrontendC/2007-05-16-EmptyStruct.c +++ b/test/FrontendC/2007-05-16-EmptyStruct.c @@ -1,5 +1,5 @@ // PR 1417 -// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep "struct.anon = type \{ \}" +// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep "struct.anon = type \{\}" struct { } *X; diff --git a/test/Transforms/InstCombine/invariant.ll b/test/Transforms/InstCombine/invariant.ll index c67ad331959..38323802269 100644 --- a/test/Transforms/InstCombine/invariant.ll +++ b/test/Transforms/InstCombine/invariant.ll @@ -3,13 +3,13 @@ declare void @g(i8*) -declare { }* @llvm.invariant.start(i64, i8* nocapture) nounwind readonly +declare {}* @llvm.invariant.start(i64, i8* nocapture) nounwind readonly define i8 @f() { %a = alloca i8 ; [#uses=4] store i8 0, i8* %a - %i = call { }* @llvm.invariant.start(i64 1, i8* %a) ; <{ }*> [#uses=0] - ; CHECK: call { }* @llvm.invariant.start + %i = call {}* @llvm.invariant.start(i64 1, i8* %a) ; <{}*> [#uses=0] + ; CHECK: call {}* @llvm.invariant.start call void @g(i8* %a) %r = load i8* %a ; [#uses=1] ret i8 %r diff --git a/test/Transforms/SCCP/ipsccp-basic.ll b/test/Transforms/SCCP/ipsccp-basic.ll index e3699209a35..a3c7637f986 100644 --- a/test/Transforms/SCCP/ipsccp-basic.ll +++ b/test/Transforms/SCCP/ipsccp-basic.ll @@ -188,7 +188,7 @@ define void @test8b(i32* %P) { %X = call {} @test8a(i32 5, i32* %P) ret void ; CHECK: define void @test8b -; CHECK-NEXT: call { } @test8a +; CHECK-NEXT: call {} @test8a ; CHECK-NEXT: ret void }