mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
LegacyDivergenceAnalysis: fix uninitialized value
Change-Id: I014502e431a68f7beddf169f6a3d19dac5dd2c26 llvm-svn: 348051
This commit is contained in:
parent
823fb6a6a7
commit
a2aef02f31
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user