Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: lib/Bitcode/NaCl/Writer/NaClBitcodeWriterPass.cpp

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 //===- BitcodeWriterPass.cpp - Bitcode writing pass -----------------------===// 1 //===- NaClBitcodeWriterPass.cpp - Bitcode writing pass -------------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // BitcodeWriterPass implementation. 10 // NaClBitcodeWriterPass implementation.
11 // 11 //
12 //===----------------------------------------------------------------------===// 12 //===----------------------------------------------------------------------===//
13 13
14 #include "llvm/Bitcode/BitcodeWriterPass.h" 14 #include "llvm/Bitcode/NaCl/NaClBitcodeWriterPass.h"
15 #include "llvm/Bitcode/ReaderWriter.h" 15 #include "llvm/Bitcode/NaCl/NaClReaderWriter.h"
16 #include "llvm/IR/Module.h" 16 #include "llvm/IR/Module.h"
17 #include "llvm/IR/PassManager.h" 17 #include "llvm/IR/PassManager.h"
18 #include "llvm/Pass.h" 18 #include "llvm/Pass.h"
19 using namespace llvm; 19 using namespace llvm;
20 20
21 PreservedAnalyses BitcodeWriterPass::run(Module *M) { 21 PreservedAnalyses NaClBitcodeWriterPass::run(Module *M) {
22 WriteBitcodeToFile(M, OS); 22 NaClWriteBitcodeToFile(M, OS);
23 return PreservedAnalyses::all(); 23 return PreservedAnalyses::all();
24 } 24 }
25 25
26 namespace { 26 namespace {
27 class WriteBitcodePass : public ModulePass { 27 class NaClWriteBitcodePass : public ModulePass {
28 raw_ostream &OS; // raw_ostream to print on 28 raw_ostream &OS; // raw_ostream to print on
29 public: 29 public:
30 static char ID; // Pass identification, replacement for typeid 30 static char ID; // Pass identification, replacement for typeid
31 explicit WriteBitcodePass(raw_ostream &o) 31 explicit NaClWriteBitcodePass(raw_ostream &o)
32 : ModulePass(ID), OS(o) {} 32 : ModulePass(ID), OS(o) {}
33 33
34 const char *getPassName() const override { return "Bitcode Writer"; } 34 const char *getPassName() const override { return "NaCl Bitcode Writer"; }
35 35
36 bool runOnModule(Module &M) override { 36 bool runOnModule(Module &M) override {
37 WriteBitcodeToFile(&M, OS); 37 NaClWriteBitcodeToFile(&M, OS);
38 return false; 38 return false;
39 } 39 }
40 }; 40 };
41 } 41 }
42 42
43 char WriteBitcodePass::ID = 0; 43 char NaClWriteBitcodePass::ID = 0;
44 44
45 ModulePass *llvm::createBitcodeWriterPass(raw_ostream &Str) { 45 ModulePass *llvm::createNaClBitcodeWriterPass(raw_ostream &Str) {
46 return new WriteBitcodePass(Str); 46 return new NaClWriteBitcodePass(Str);
47 } 47 }
OLDNEW
« no previous file with comments | « lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp ('k') | lib/Bitcode/NaCl/Writer/NaClValueEnumerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698