OLD | NEW |
1 //===- NaClBitcodeReader.h ------------------------------------*- C++ -*-===// | 1 //===- NaClBitcodeReader.h ------------------------------------*- C++ -*-===// |
2 // Internal NaClBitcodeReader implementation | 2 // Internal NaClBitcodeReader implementation |
3 // | 3 // |
4 // The LLVM Compiler Infrastructure | 4 // The LLVM Compiler Infrastructure |
5 // | 5 // |
6 // This file is distributed under the University of Illinois Open Source | 6 // This file is distributed under the University of Illinois Open Source |
7 // License. See LICENSE.TXT for details. | 7 // License. See LICENSE.TXT for details. |
8 // | 8 // |
9 //===----------------------------------------------------------------------===// | 9 //===----------------------------------------------------------------------===// |
10 // | 10 // |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 return std::error_code(E, BitcodeErrorCategory()); | 241 return std::error_code(E, BitcodeErrorCategory()); |
242 } | 242 } |
243 | 243 |
244 /// Generates the corresponding verbose Message, then generates error. | 244 /// Generates the corresponding verbose Message, then generates error. |
245 std::error_code Error(ErrorType E, const std::string &Message) const; | 245 std::error_code Error(ErrorType E, const std::string &Message) const; |
246 | 246 |
247 /// @brief Main interface to parsing a bitcode buffer. | 247 /// @brief Main interface to parsing a bitcode buffer. |
248 /// @returns true if an error occurred. | 248 /// @returns true if an error occurred. |
249 std::error_code ParseBitcodeInto(Module *M); | 249 std::error_code ParseBitcodeInto(Module *M); |
250 | 250 |
| 251 /// Convert alignment exponent (i.e. power of two (or zero)) to the |
| 252 /// corresponding alignment to use. If alignment is too large, it generates |
| 253 /// an error message and returns corresponding error code. |
| 254 std::error_code getAlignmentValue(uint64_t Exponent, unsigned &Alignment); |
| 255 |
251 private: | 256 private: |
252 // Returns false if Header is acceptable. | 257 // Returns false if Header is acceptable. |
253 bool AcceptHeader() const { | 258 bool AcceptHeader() const { |
254 return !(Header.IsSupported() || | 259 return !(Header.IsSupported() || |
255 (!AcceptSupportedBitcodeOnly && Header.IsReadable())); | 260 (!AcceptSupportedBitcodeOnly && Header.IsReadable())); |
256 } | 261 } |
257 uint32_t GetPNaClVersion() const { | 262 uint32_t GetPNaClVersion() const { |
258 return Header.GetPNaClVersion(); | 263 return Header.GetPNaClVersion(); |
259 } | 264 } |
260 Type *getTypeByID(unsigned ID); | 265 Type *getTypeByID(unsigned ID); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 std::error_code InitStreamFromBuffer(); | 349 std::error_code InitStreamFromBuffer(); |
345 std::error_code InitLazyStream(); | 350 std::error_code InitLazyStream(); |
346 std::error_code FindFunctionInStream( | 351 std::error_code FindFunctionInStream( |
347 Function *F, | 352 Function *F, |
348 DenseMap<Function*, uint64_t>::iterator DeferredFunctionInfoIterator); | 353 DenseMap<Function*, uint64_t>::iterator DeferredFunctionInfoIterator); |
349 }; | 354 }; |
350 | 355 |
351 } // End llvm namespace | 356 } // End llvm namespace |
352 | 357 |
353 #endif | 358 #endif |
OLD | NEW |