OLD | NEW |
1 //===- subzero/src/PNaClTranslator.h - ICE from bitcode ---------*- C++ -*-===// | 1 //===- subzero/src/PNaClTranslator.h - ICE from bitcode ---------*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
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 // This file declares the PNaCl bitcode file to ICE, to machine code | 10 // This file declares the PNaCl bitcode file to ICE, to machine code |
11 // translator. | 11 // translator. |
12 // | 12 // |
13 //===----------------------------------------------------------------------===// | 13 //===----------------------------------------------------------------------===// |
14 | 14 |
15 #ifndef SUBZERO_SRC_PNACLTRANSLATOR_H | 15 #ifndef SUBZERO_SRC_PNACLTRANSLATOR_H |
16 #define SUBZERO_SRC_PNACLTRANSLATOR_H | 16 #define SUBZERO_SRC_PNACLTRANSLATOR_H |
17 | 17 |
18 #include <string> | 18 #include <string> |
19 | 19 |
20 #include "IceTranslator.h" | 20 #include "IceTranslator.h" |
21 | 21 |
| 22 namespace llvm { |
| 23 class MemoryBuffer; |
| 24 } // end of namespace llvm |
| 25 |
22 namespace Ice { | 26 namespace Ice { |
23 | 27 |
24 class PNaClTranslator : public Translator { | 28 class PNaClTranslator : public Translator { |
25 PNaClTranslator(const PNaClTranslator &) = delete; | 29 PNaClTranslator(const PNaClTranslator &) = delete; |
26 PNaClTranslator &operator=(const PNaClTranslator &) = delete; | 30 PNaClTranslator &operator=(const PNaClTranslator &) = delete; |
27 | 31 |
28 public: | 32 public: |
29 PNaClTranslator(GlobalContext *Ctx, const ClFlags &Flags) | 33 PNaClTranslator(GlobalContext *Ctx, const ClFlags &Flags) |
30 : Translator(Ctx, Flags) {} | 34 : Translator(Ctx, Flags) {} |
| 35 |
31 // Reads the PNaCl bitcode file and translates to ICE, which is then | 36 // Reads the PNaCl bitcode file and translates to ICE, which is then |
32 // converted to machine code. Sets ErrorStatus to true if any | 37 // converted to machine code. Sets ErrorStatus to true if any |
33 // errors occurred. | 38 // errors occurred. |
34 void translate(const std::string &IRFilename); | 39 void translate(const std::string &IRFilename); |
| 40 |
| 41 // Reads MemBuf, assuming it is the PNaCl bitcode contents of IRFilename. |
| 42 void translateBuffer(const std::string &IRFilename, |
| 43 llvm::MemoryBuffer *MemBuf); |
35 }; | 44 }; |
36 | 45 |
37 } // end of namespace Ice | 46 } // end of namespace Ice |
38 | 47 |
39 #endif // SUBZERO_SRC_PNACLTRANSLATOR_H | 48 #endif // SUBZERO_SRC_PNACLTRANSLATOR_H |
OLD | NEW |