Deleting -emitbitcode option which did nothing.
[oota-llvm.git] / lib / Bitcode / Writer / BitcodeWriterPass.cpp
1 //===--- Bitcode/Writer/BitcodeWriterPass.cpp - Bitcode Writer ------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by Chris Lattner and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // BitcodeWriterPass implementation.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "llvm/Bitcode/ReaderWriter.h"
15 #include "llvm/Pass.h"
16 using namespace llvm;
17
18 namespace {
19   class WriteBitcodePass : public ModulePass {
20     std::ostream &Out;                 // ostream to print on
21   public:
22     static char ID; // Pass identifcation, replacement for typeid
23     WriteBitcodePass(std::ostream &o) : ModulePass((intptr_t) &ID), Out(o) {}
24     
25     const char *getPassName() const { return "Bitcode Writer"; }
26     
27     bool runOnModule(Module &M) {
28       WriteBitcodeToFile(&M, Out);
29       return false;
30     }
31   };
32 }
33
34 char WriteBitcodePass::ID = 0;
35
36 /// CreateBitcodeWriterPass - Create and return a pass that writes the module
37 /// to the specified ostream.
38 ModulePass *llvm::CreateBitcodeWriterPass(std::ostream &Str) {
39   return new WriteBitcodePass(Str);
40 }
41
42