mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 23:23:38 -04:00
LegacyDivergenceAnalysis: fix uninitialized value
Change-Id: I014502e431a68f7beddf169f6a3d19dac5dd2c26 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348051 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -356,7 +356,7 @@ void LegacyDivergenceAnalysis::print(raw_ostream &OS, const Module *) const {
|
||||
if ((!gpuDA || !gpuDA->hasDivergence()) && DivergentValues.empty())
|
||||
return;
|
||||
|
||||
const Function *F;
|
||||
const Function *F = nullptr;
|
||||
if (!DivergentValues.empty()) {
|
||||
const Value *FirstDivergentValue = *DivergentValues.begin();
|
||||
if (const Argument *Arg = dyn_cast<Argument>(FirstDivergentValue)) {
|
||||
@@ -370,6 +370,8 @@ void LegacyDivergenceAnalysis::print(raw_ostream &OS, const Module *) const {
|
||||
} else if (gpuDA) {
|
||||
F = &gpuDA->getFunction();
|
||||
}
|
||||
if (!F)
|
||||
return;
|
||||
|
||||
// Dumps all divergent values in F, arguments and then instructions.
|
||||
for (auto &Arg : F->args()) {
|
||||
|
||||
Reference in New Issue
Block a user