mirror of
https://github.com/intel/llvm.git
synced 2026-02-04 11:38:04 +08:00
Added version of CheckDeadStores that accepts a client-provided LiveVariables object.
Modified the DeadStores logic in AnalysisConsumer.cpp to use the LiveVariables object created by the AnalysisManager. llvm-svn: 53043
This commit is contained in:
@@ -264,7 +264,8 @@ void AnalysisConsumer::HandleCode(Decl* D, Stmt* Body, Actions actions) {
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static void ActionDeadStores(AnalysisManager& mgr) {
|
||||
CheckDeadStores(*mgr.getCFG(), mgr.getContext(), *mgr.getParentMap(),
|
||||
CheckDeadStores(*mgr.getCFG(), mgr.getContext(),
|
||||
*mgr.getLiveVariables(), *mgr.getParentMap(),
|
||||
mgr.getDiagnostic());
|
||||
}
|
||||
|
||||
|
||||
@@ -26,10 +26,14 @@ class GRTransferFuncs;
|
||||
class BugType;
|
||||
class LangOptions;
|
||||
class ParentMap;
|
||||
class LiveVariables;
|
||||
|
||||
void CheckDeadStores(CFG& cfg, ASTContext &Ctx, ParentMap& Parents,
|
||||
Diagnostic &Diags);
|
||||
|
||||
void CheckDeadStores(CFG& cfg, ASTContext &Ctx, LiveVariables& L,
|
||||
ParentMap& Parents, Diagnostic &Diags);
|
||||
|
||||
void CheckUninitializedValues(CFG& cfg, ASTContext& Ctx, Diagnostic& Diags,
|
||||
bool FullUninitTaint=false);
|
||||
|
||||
|
||||
@@ -151,6 +151,12 @@ void clang::CheckDeadStores(CFG& cfg, ASTContext &Ctx,
|
||||
ParentMap& Parents, Diagnostic &Diags) {
|
||||
LiveVariables L(cfg);
|
||||
L.runOnCFG(cfg);
|
||||
CheckDeadStores(cfg, Ctx, L, Parents, Diags);
|
||||
}
|
||||
|
||||
void clang::CheckDeadStores(CFG& cfg, ASTContext &Ctx, LiveVariables& L,
|
||||
ParentMap& Parents, Diagnostic &Diags) {
|
||||
|
||||
DeadStoreObs A(Ctx, Diags, Diags.getClient(), Parents);
|
||||
L.runOnAllBlocks(cfg, &A);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user