diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-05-09 20:39:03 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-05-09 20:39:03 +0000 | 
| commit | 2051c06119b84e514a0ca3c28bec2bc54917587d (patch) | |
| tree | d8b3b03cf59e14261c5e341cc36babfdb7c8adf6 /llvm/lib/CWriter/Writer.cpp | |
| parent | 5166d35e5d3de9c383397093c5b9ba5e42753542 (diff) | |
| download | bcm5719-llvm-2051c06119b84e514a0ca3c28bec2bc54917587d.tar.gz bcm5719-llvm-2051c06119b84e514a0ca3c28bec2bc54917587d.zip | |
Remove CLocalVars data structure entirely, instead of building stuff and
then printing it out, just print as we go.
llvm-svn: 2585
Diffstat (limited to 'llvm/lib/CWriter/Writer.cpp')
| -rw-r--r-- | llvm/lib/CWriter/Writer.cpp | 31 | 
1 files changed, 3 insertions, 28 deletions
| diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp index a36f2aeb442..98503f3bbe1 100644 --- a/llvm/lib/CWriter/Writer.cpp +++ b/llvm/lib/CWriter/Writer.cpp @@ -8,7 +8,6 @@  //===-----------------------------------------------------------------------==//  #include "llvm/Assembly/CWriter.h" -#include "CLocalVars.h"  #include "llvm/SlotCalculator.h"  #include "llvm/Constants.h"  #include "llvm/DerivedTypes.h" @@ -32,21 +31,8 @@  #include <strstream>  using std::string;  using std::map; -using std::vector;  using std::ostream; -//===-----------------------------------------------------------------------==// -// -// Implementation of the CLocalVars methods - -// Appends a variable to the LocalVars map if it does not already exist -// Also check that the type exists on the map. -void CLocalVars::addLocalVar(const Type *t, const string &V) { -  if (!LocalVars.count(t) ||  -      find(LocalVars[t].begin(), LocalVars[t].end(), V) == LocalVars[t].end()) -    LocalVars[t].push_back(V); -} -  static std::string getConstStrValue(const Constant* CPV); @@ -746,22 +732,11 @@ void CWriter::printFunction(Function *F) {    printFunctionSignature(F);    Out << " {\n"; -  // Process each of the basic blocks, gather information and call the   -  // output methods on the CLocalVars and Function* objects. -     -  // gather local variable information for each basic block -  CLocalVars CLV; +  // print local variable information for the function    for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) -    if ((*I)->getType() != Type::VoidTy) -      CLV.addLocalVar((*I)->getType(), getValueName(*I)); - -  // print the local variables   -  for (map<const Type*, VarListType>::iterator I = CLV.LocalVars.begin(), -         E = CLV.LocalVars.end(); I != E; ++I) -    for (VarListType::iterator TI = I->second.begin(), E = I->second.end(); -         TI != E; ++TI) { +    if ((*I)->getType() != Type::VoidTy) {        Out << "  "; -      printTypeVar(I->first, *TI); +      printTypeVar((*I)->getType(), getValueName(*I));        Out << ";\n";      } | 

