summaryrefslogtreecommitdiffstats
path: root/lib/Bitcode/Writer/BitcodeWriterPass.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2014-11-24 09:08:18 +0000
committerdim <dim@FreeBSD.org>2014-11-24 09:08:18 +0000
commite27feadae0885aa074df58ebfda2e7a7f7a7d590 (patch)
treef5944309621cee4fe0976be6f9ac619b7ebfc4c2 /lib/Bitcode/Writer/BitcodeWriterPass.cpp
parent87ba4fbed530c9d0dff7505d121035f5ed09c9f3 (diff)
downloadFreeBSD-src-e27feadae0885aa074df58ebfda2e7a7f7a7d590.zip
FreeBSD-src-e27feadae0885aa074df58ebfda2e7a7f7a7d590.tar.gz
Vendor import of llvm RELEASE_350/final tag r216957 (effectively, 3.5.0 release):
https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_350/final@216957
Diffstat (limited to 'lib/Bitcode/Writer/BitcodeWriterPass.cpp')
-rw-r--r--lib/Bitcode/Writer/BitcodeWriterPass.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/Bitcode/Writer/BitcodeWriterPass.cpp b/lib/Bitcode/Writer/BitcodeWriterPass.cpp
index e5e76e2..4167f6d 100644
--- a/lib/Bitcode/Writer/BitcodeWriterPass.cpp
+++ b/lib/Bitcode/Writer/BitcodeWriterPass.cpp
@@ -1,4 +1,4 @@
-//===--- Bitcode/Writer/BitcodeWriterPass.cpp - Bitcode Writer ------------===//
+//===- BitcodeWriterPass.cpp - Bitcode writing pass -----------------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -11,10 +11,18 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/Bitcode/BitcodeWriterPass.h"
#include "llvm/Bitcode/ReaderWriter.h"
+#include "llvm/IR/Module.h"
+#include "llvm/IR/PassManager.h"
#include "llvm/Pass.h"
using namespace llvm;
+PreservedAnalyses BitcodeWriterPass::run(Module *M) {
+ WriteBitcodeToFile(M, OS);
+ return PreservedAnalyses::all();
+}
+
namespace {
class WriteBitcodePass : public ModulePass {
raw_ostream &OS; // raw_ostream to print on
@@ -23,9 +31,9 @@ namespace {
explicit WriteBitcodePass(raw_ostream &o)
: ModulePass(ID), OS(o) {}
- const char *getPassName() const { return "Bitcode Writer"; }
+ const char *getPassName() const override { return "Bitcode Writer"; }
- bool runOnModule(Module &M) {
+ bool runOnModule(Module &M) override {
WriteBitcodeToFile(&M, OS);
return false;
}
@@ -34,8 +42,6 @@ namespace {
char WriteBitcodePass::ID = 0;
-/// createBitcodeWriterPass - Create and return a pass that writes the module
-/// to the specified ostream.
ModulePass *llvm::createBitcodeWriterPass(raw_ostream &Str) {
return new WriteBitcodePass(Str);
}
OpenPOWER on IntegriCloud