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