cast<DerivedType>(FI->second.first.get())->refineAbstractTypeTo(Ty);
Ty = FI->second.first.get();
ForwardRefTypes.erase(FI);
+ return false;
}
// Inserting a name that is already defined, get the existing name.
const Type *Existing = M->getTypeByName(Name);
assert(Existing && "Conflict but no matching type?!");
- // Otherwise, this is an attempt to redefine a type. That's okay if
- // the redefinition is identical to the original.
- // FIXME: REMOVE REDEFINITIONS IN LLVM 3.0
- if (Existing == Ty) return false;
-
- // Any other kind of (non-equivalent) redefinition is an error.
+ // Otherwise, this is an attempt to redefine a type, report the error.
return Error(NameLoc, "redefinition of type named '" + Name + "' of type '" +
Ty->getDescription() + "'");
}
ForwardRefVals.erase(FRVI);
} else if ((Fn = M->getFunction(FunctionName))) {
- // If this function already exists in the symbol table, then it is
- // multiply defined. We accept a few cases for old backwards compat.
- // FIXME: Remove this stuff for LLVM 3.0.
- if (Fn->getType() != PFT || Fn->getAttributes() != PAL ||
- (!Fn->isDeclaration() && isDefine)) {
- // If the redefinition has different type or different attributes,
- // reject it. If both have bodies, reject it.
- return Error(NameLoc, "invalid redefinition of function '" +
- FunctionName + "'");
- } else if (Fn->isDeclaration()) {
- // Make sure to strip off any argument names so we can't get conflicts.
- for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
- AI != AE; ++AI)
- AI->setName("");
- }
+ // Reject redefinitions.
+ return Error(NameLoc, "invalid redefinition of function '" +
+ FunctionName + "'");
} else if (M->getNamedValue(FunctionName)) {
return Error(NameLoc, "redefinition of function '@" + FunctionName + "'");
}
; CHECK: ret i32 0
}
-declare void @llvm.memcpy.i8(i8*, i8*, i8, i32)
-
define i8 @test1() {
; CHECK: @test1
%A = alloca i8
+++ /dev/null
-; Test to make sure that the 'internal' tag is not lost!
-;
-; RUN: llvm-as < %s | llvm-dis | grep internal
-
-declare void @foo()
-
-define internal void @foo() {
- ret void
-}
+++ /dev/null
-; RUN: llvm-as %s -o /dev/null
-
-declare i32 @"ArrayRef"([100 x i32] * %Array)
-
-define i32 @"ArrayRef"([100 x i32] * %Array) {
- ret i32 0
-}
+++ /dev/null
-; Test to make sure that the 'private' tag is not lost!
-;
-; RUN: llvm-as < %s | llvm-dis | grep private
-
-declare void @foo()
-
-define private void @foo() {
- ret void
-}
ret void
}
- %struct.III_psy_xmin = type { [22 x double], [13 x [3 x double]] }
- %struct.III_scalefac_t = type { [22 x i32], [13 x [3 x i32]] }
- %struct.gr_info = type { i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32*, [4 x i32] }
- %struct.lame_global_flags = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, float, float, float, float, i32, i32, i32, i32, i32, i32, i32, i32 }
-
define fastcc void @outer_loop2(%struct.lame_global_flags* %gfp, double* %xr, i32 %targ_bits, double* %best_noise, %struct.III_psy_xmin* %l3_xmin, i32* %l3_enc, %struct.III_scalefac_t* %scalefac, %struct.gr_info* %cod_info, i32 %ch) {
entry:
%cod_info.20128.1 = getelementptr %struct.gr_info* %cod_info, i32 0, i32 20, i32 1 ; <i32*> [#uses=1]
; RUN: grep .Lbaz: %t
; RUN: grep long.*\.Lbaz %t
-declare void @foo()
-
define private void @foo() {
ret void
}
ret <2 x i32> %1
}
-declare <2 x i32> @llvm.arm.neon.vqrdmulh.v2i32(<2 x i32>, <2 x i32>) nounwind readnone
declare <4 x i16> @llvm.arm.neon.vqrdmulh.v4i16(<4 x i16>, <4 x i16>) nounwind readnone
declare <2 x i32> @llvm.arm.neon.vqrdmulh.v2i32(<2 x i32>, <2 x i32>) nounwind readnone
; RUN: grep \\\$baz: %t
; RUN: grep ldah.*\\\$baz %t
-declare void @foo()
-
define private void @foo() {
ret void
}
; RUN: grep .Lbaz: %t
; RUN: grep ila.*\.Lbaz %t
-
-declare void @foo()
-
define private void @foo() {
ret void
}
; RUN: grep \\\$baz: %t
; RUN: grep lw.*\\\$baz %t
-declare void @foo()
-
define private void @foo() {
ret void
}
; RUN: grep .baz: %t
; RUN: grep ld.*\.baz %t
-declare void @foo()
-
define private void @foo() {
ret void
}
br label %for.inc
}
-declare i32 @safe()
-
define i32 @func_35(i8 signext %p_35) nounwind readonly {
entry:
%tobool = icmp eq i8 %p_35, 0 ; <i1> [#uses=1]
; RUN: llc < %s -mtriple=x86_64-pc-linux | grep .Lbaz:
; RUN: llc < %s -mtriple=x86_64-pc-linux | grep movl.*\.Lbaz
-declare void @foo()
-
define private void @foo() {
ret void
}
ret void
}
-declare void @foo()
-
; If caller / callee calling convention mismatch then check if the return
; values are returned in the same registers.
; rdar://7874780
; RUN: grep .Lbaz: %t
; RUN: grep ldw.*\.Lbaz %t
-declare void @foo()
-
define private void @foo() {
ret void
}
%FunTy = type i32 (i32)
-declare i32 @test(i32) ; Test forward declaration merging
-
define void @invoke(%FunTy* %x) {
%foo = call i32 %x( i32 123 ) ; <i32> [#uses=0]
%foo2 = tail call i32 %x( i32 123 ) ; <i32> [#uses=0]
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; Test forward references and redefinitions of globals
-
-@A = global i32* @B ; <i32**> [#uses=0]
-@B = global i32 7 ; <i32*> [#uses=1]
-
-declare void @X()
-
-declare void @X()
-
-define void @X() {
- ret void
-}
-
-declare void @X()
+++ /dev/null
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; Test forward references and redefinitions of globals
-
-@A = global i17* @B
-@B = global i17 7
-
-declare void @X()
-
-declare void @X()
-
-define void @X() {
- ret void
-}
-
-declare void @X()
}
; PR5284
-declare i64 @llvm.bswap.i64(i64)
-declare i32 @llvm.bswap.i32(i32)
-declare i16 @llvm.bswap.i16(i16)
-
define i16 @test7(i32 %A) {
%B = tail call i32 @llvm.bswap.i32(i32 %A) nounwind
%C = trunc i32 %B to i16
; CHECK-NEXT: ret i32
}
-declare i32 @llvm.ctlz.i32(i32) nounwind readnone
declare noalias i8* @malloc(i32) nounwind
-declare i32 @llvm.objectsize.i32(i8*, i1) nounwind readonly
-
define i32 @test7() {
; CHECK: @test7
%alloc = call noalias i8* @malloc(i32 48) nounwind
declare void @test5a(%struct.S* byval align 16) nounwind ssp
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
; rdar://8713376 - This memcpy can't be eliminated.
define i32 @test5(i32 %x) nounwind ssp {
ret float %t
}
-declare float @fabsf(float %f)
declare x86_fp80 @fabsl(x86_fp80 %f)