gdb uses DW_AT_prototyped to identify K&R style in C based languages.
[oota-llvm.git] / lib / Analysis / SparsePropagation.cpp
index 59a63d40854696da01ecf50e83468ef054f697b8..8f042c278392f6645bab6954233de8be3200b361 100644 (file)
@@ -57,8 +57,10 @@ SparseSolver::LatticeVal SparseSolver::getOrInitValueState(Value *V) {
     return LatticeFunc->getUntrackedVal();
   else if (Constant *C = dyn_cast<Constant>(V))
     LV = LatticeFunc->ComputeConstant(C);
+  else if (Argument *A = dyn_cast<Argument>(V))
+    LV = LatticeFunc->ComputeArgument(A);
   else if (!isa<Instruction>(V))
-    // Non-instructions (e.g. formal arguments) are overdefined.
+    // All other non-instructions are overdefined.
     LV = LatticeFunc->getOverdefinedVal();
   else
     // All instructions are underdefined by default.
@@ -272,7 +274,7 @@ void SparseSolver::visitInst(Instruction &I) {
 }
 
 void SparseSolver::Solve(Function &F) {
-  MarkBlockExecutable(F.begin());
+  MarkBlockExecutable(&F.getEntryBlock());
   
   // Process the work lists until they are empty!
   while (!BBWorkList.empty() || !InstWorkList.empty()) {