summaryrefslogtreecommitdiff
path: root/lib/Bytecode/Writer
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-09 07:53:20 +0000
committerChris Lattner <sabre@nondot.org>2007-02-09 07:53:20 +0000
commit8dcd81cc0eb1b177e2024b93fd04548c91dbc6f1 (patch)
tree791b10576b109fe5e55471dd21c9fd8b3fc0723c /lib/Bytecode/Writer
parentba6de4b1cf6057f9b62d785b2e8e70a469ce25d7 (diff)
downloadllvm-8dcd81cc0eb1b177e2024b93fd04548c91dbc6f1.tar.gz
llvm-8dcd81cc0eb1b177e2024b93fd04548c91dbc6f1.tar.bz2
llvm-8dcd81cc0eb1b177e2024b93fd04548c91dbc6f1.tar.xz
remove dead code, the outputConstants function is now only called at module scope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34085 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Writer')
-rw-r--r--lib/Bytecode/Writer/Writer.cpp18
-rw-r--r--lib/Bytecode/Writer/WriterInternals.h2
2 files changed, 6 insertions, 14 deletions
diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp
index a7d4b005ab..aa9952badb 100644
--- a/lib/Bytecode/Writer/Writer.cpp
+++ b/lib/Bytecode/Writer/Writer.cpp
@@ -826,7 +826,7 @@ BytecodeWriter::BytecodeWriter(std::vector<unsigned char> &o, const Module *M)
outputModuleInfoBlock(M);
// Output module level constants, used for global variable initializers
- outputConstants(false);
+ outputConstants();
// Do the whole module now! Process each function at a time...
for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I)
@@ -904,30 +904,22 @@ static inline bool hasNullValue(const Type *Ty) {
return Ty != Type::LabelTy && Ty != Type::VoidTy && !isa<OpaqueType>(Ty);
}
-void BytecodeWriter::outputConstants(bool isFunction) {
+void BytecodeWriter::outputConstants() {
BytecodeBlock CPool(BytecodeFormat::ConstantPoolBlockID, *this,
true /* Elide block if empty */);
unsigned NumPlanes = Table.getNumPlanes();
- if (isFunction)
- // Output the type plane before any constants!
- outputTypes(Table.getModuleTypeLevel());
- else
- // Output module-level string constants before any other constants.
- outputConstantStrings();
+ // Output module-level string constants before any other constants.
+ outputConstantStrings();
for (unsigned pno = 0; pno != NumPlanes; pno++) {
const std::vector<const Value*> &Plane = Table.getPlane(pno);
if (!Plane.empty()) { // Skip empty type planes...
unsigned ValNo = 0;
- if (isFunction) // Don't re-emit module constants
- ValNo += Table.getModuleLevel(pno);
-
if (hasNullValue(Plane[0]->getType())) {
// Skip zero initializer
- if (ValNo == 0)
- ValNo = 1;
+ ValNo = 1;
}
// Write out constants in the plane
diff --git a/lib/Bytecode/Writer/WriterInternals.h b/lib/Bytecode/Writer/WriterInternals.h
index f3c59f3288..36c6229b21 100644
--- a/lib/Bytecode/Writer/WriterInternals.h
+++ b/lib/Bytecode/Writer/WriterInternals.h
@@ -35,7 +35,7 @@ public:
BytecodeWriter(std::vector<unsigned char> &o, const Module *M);
private:
- void outputConstants(bool isFunction);
+ void outputConstants();
void outputConstantStrings();
void outputFunction(const Function *F);
void outputCompactionTable();