The only clients of the slot calculator are now the asmwriter and bcwriter.
Since this really only makes sense for these two, change hte instance variable
to reflect whether we are writing a bytecode file or not. This makes it
reasonable to add bcwriter specific stuff to it as necessary.
llvm-svn: 10837
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index 6718649..98bc093 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -60,15 +60,15 @@
static SlotCalculator *createSlotCalculator(const Value *V) {
assert(!isa<Type>(V) && "Can't create an SC for a type!");
if (const Argument *FA = dyn_cast<Argument>(V)) {
- return new SlotCalculator(FA->getParent(), true);
+ return new SlotCalculator(FA->getParent(), false);
} else if (const Instruction *I = dyn_cast<Instruction>(V)) {
- return new SlotCalculator(I->getParent()->getParent(), true);
+ return new SlotCalculator(I->getParent()->getParent(), false);
} else if (const BasicBlock *BB = dyn_cast<BasicBlock>(V)) {
- return new SlotCalculator(BB->getParent(), true);
+ return new SlotCalculator(BB->getParent(), false);
} else if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V)){
- return new SlotCalculator(GV->getParent(), true);
+ return new SlotCalculator(GV->getParent(), false);
} else if (const Function *Func = dyn_cast<Function>(V)) {
- return new SlotCalculator(Func, true);
+ return new SlotCalculator(Func, false);
}
return 0;
}
@@ -1037,7 +1037,7 @@
void CachedWriter::setModule(const Module *M) {
delete SC; delete AW;
if (M) {
- SC = new SlotCalculator(M, true);
+ SC = new SlotCalculator(M, false);
AW = new AssemblyWriter(Out, *SC, M, 0);
} else {
SC = 0; AW = 0;