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) {
306306 for (const auto &[Name, Info] : make_early_inc_range (ForwardRefVals)) {
307307 auto GetCommonFunctionType = [](Value *V) -> FunctionType * {
308308 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 ()))
312312 return nullptr ;
313313 FTy = CB->getFunctionType ();
314314 }
Original file line number Diff line number Diff line change 44; CHECK: @g1 = external global i8
55; CHECK: @g2 = external global i8
66; CHECK: @g3 = external global i8
7+ ; CHECK: @g4 = external global i8
78
89; CHECK: declare void @fn1(i32)
910
@@ -12,9 +13,10 @@ define ptr @test() {
1213 call void @fn1 (i32 1 )
1314 call void @fn2 (i32 2 )
1415 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
2022}
You can’t perform that action at this time.
0 commit comments