From: Ted Kremenek Date: Thu, 7 Aug 2008 22:28:30 +0000 (+0000) Subject: Don't flag any dead stores for variables marked unused. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b238c3e81e1334cb3cb909dc6174f8c71241eb9e;p=clang Don't flag any dead stores for variables marked unused. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54492 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/CheckDeadStores.cpp b/lib/Analysis/CheckDeadStores.cpp index 38078e3823..63de9adb8f 100644 --- a/lib/Analysis/CheckDeadStores.cpp +++ b/lib/Analysis/CheckDeadStores.cpp @@ -79,7 +79,7 @@ public: const LiveVariables::AnalysisDataTy& AD, const LiveVariables::ValTy& Live) { - if (VD->hasLocalStorage() && !Live(VD, AD)) + if (VD->hasLocalStorage() && !Live(VD, AD) && !VD->getAttr()) Report(VD, dsk, Ex->getSourceRange().getBegin(), Val->getSourceRange()); }