[llvm] ea5abf1 - Fix "use of uninitialized variable" static analyzer warning. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 6 08:37:17 PST 2020
Author: Simon Pilgrim
Date: 2020-01-06T16:36:56Z
New Revision: ea5abf14530634d05b9d1dc6d5d7d5f7934f0ea3
URL: https://github.com/llvm/llvm-project/commit/ea5abf14530634d05b9d1dc6d5d7d5f7934f0ea3
DIFF: https://github.com/llvm/llvm-project/commit/ea5abf14530634d05b9d1dc6d5d7d5f7934f0ea3.diff
LOG: Fix "use of uninitialized variable" static analyzer warning. NFCI.
Added:
Modified:
llvm/lib/CodeGen/LiveDebugVariables.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp
index 254503c8941b..2cc547a6b741 100644
--- a/llvm/lib/CodeGen/LiveDebugVariables.cpp
+++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp
@@ -506,7 +506,7 @@ static void printExtendedName(raw_ostream &OS, const DINode *Node,
const DILocation *DL) {
const LLVMContext &Ctx = Node->getContext();
StringRef Res;
- unsigned Line;
+ unsigned Line = 0;
if (const auto *V = dyn_cast<const DILocalVariable>(Node)) {
Res = V->getName();
Line = V->getLine();
More information about the llvm-commits
mailing list