File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -306,9 +306,9 @@ bool LLParser::validateEndOfModule(bool UpgradeDebugInfo) {
306
306
for (const auto &[Name, Info] : make_early_inc_range (ForwardRefVals)) {
307
307
auto GetCommonFunctionType = [](Value *V) -> FunctionType * {
308
308
FunctionType *FTy = nullptr ;
309
- for (User * U : V->users ()) {
310
- auto *CB = dyn_cast<CallBase>(U);
311
- if (!CB || (FTy && FTy != CB->getFunctionType ()))
309
+ for (Use & U : V->uses ()) {
310
+ auto *CB = dyn_cast<CallBase>(U. getUser () );
311
+ if (!CB || !CB-> isCallee (&U) || (FTy && FTy != CB->getFunctionType ()))
312
312
return nullptr ;
313
313
FTy = CB->getFunctionType ();
314
314
}
Original file line number Diff line number Diff line change 4
4
; CHECK: @g1 = external global i8
5
5
; CHECK: @g2 = external global i8
6
6
; CHECK: @g3 = external global i8
7
+ ; CHECK: @g4 = external global i8
7
8
8
9
; CHECK: declare void @fn1(i32)
9
10
@@ -12,9 +13,10 @@ define ptr @test() {
12
13
call void @fn1 (i32 1 )
13
14
call void @fn2 (i32 2 )
14
15
call void @fn2 (i32 2 , i32 3 )
15
- load i32 , ptr @g1
16
- store i32 0 , ptr @g1
17
- load i32 , ptr @g1
18
- load i64 , ptr @g2
19
- ret ptr @g3
16
+ call void @fn2 (ptr @g1 )
17
+ load i32 , ptr @g2
18
+ store i32 0 , ptr @g2
19
+ load i32 , ptr @g3
20
+ load i64 , ptr @g3
21
+ ret ptr @g4
20
22
}
You can’t perform that action at this time.
0 commit comments