Register all parameters even if they didn't occur in the function body.
We may query their liveness because they are added to store when passing
argument values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97562 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp
index 94ed752..c636a43 100644
--- a/lib/Analysis/LiveVariables.cpp
+++ b/lib/Analysis/LiveVariables.cpp
@@ -86,6 +86,12 @@
 
   RegisterDecls R(getAnalysisData());
   cfg.VisitBlockStmts(R);
+
+  // Register all parameters even if they didn't occur in the function body.
+  if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(AC.getDecl()))
+    for (FunctionDecl::param_const_iterator PI = FD->param_begin(), 
+           PE = FD->param_end(); PI != PE; ++PI)
+      getAnalysisData().Register(*PI);
 }
 
 //===----------------------------------------------------------------------===//