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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 // When reading the module header, this list is populated with functions that | 158 // When reading the module header, this list is populated with functions that |
159 // have bodies later in the file. | 159 // have bodies later in the file. |
160 std::vector<Function*> FunctionsWithBodies; | 160 std::vector<Function*> FunctionsWithBodies; |
161 | 161 |
162 // When intrinsic functions are encountered which require upgrading they are | 162 // When intrinsic functions are encountered which require upgrading they are |
163 // stored here with their replacement function. | 163 // stored here with their replacement function. |
164 typedef std::vector<std::pair<Function*, Function*> > UpgradedIntrinsicMap; | 164 typedef std::vector<std::pair<Function*, Function*> > UpgradedIntrinsicMap; |
165 UpgradedIntrinsicMap UpgradedIntrinsics; | 165 UpgradedIntrinsicMap UpgradedIntrinsics; |
166 | 166 |
167 // Several operations happen after the module header has been read, but | 167 // Several operations happen after the module header has been read, but |
168 // before function bodies are processed. This keeps track of whether | 168 // before function bodies are processed. This keeps track of whether |
169 // we've done this yet. | 169 // we've done this yet. |
170 bool SeenFirstFunctionBody; | 170 bool SeenFirstFunctionBody; |
171 | 171 |
172 /// DeferredFunctionInfo - When function bodies are initially scanned, this | 172 /// DeferredFunctionInfo - When function bodies are initially scanned, this |
173 /// map contains info about where to find deferred function body in the | 173 /// map contains info about where to find deferred function body in the |
174 /// stream. | 174 /// stream. |
175 DenseMap<Function*, uint64_t> DeferredFunctionInfo; | 175 DenseMap<Function*, uint64_t> DeferredFunctionInfo; |
176 | 176 |
177 /// \brief True if we should only accept supported bitcode format. | 177 /// \brief True if we should only accept supported bitcode format. |
178 bool AcceptSupportedBitcodeOnly; | 178 bool AcceptSupportedBitcodeOnly; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
225 SeenFirstFunctionBody(false), | 225 SeenFirstFunctionBody(false), |
226 AcceptSupportedBitcodeOnly(AcceptSupportedOnly), | 226 AcceptSupportedBitcodeOnly(AcceptSupportedOnly), |
227 IntPtrType(IntegerType::get(C, PNaClIntPtrTypeBitSize)) { | 227 IntPtrType(IntegerType::get(C, PNaClIntPtrTypeBitSize)) { |
228 } | 228 } |
229 ~NaClBitcodeReader() override { | 229 ~NaClBitcodeReader() override { |
230 FreeState(); | 230 FreeState(); |
231 } | 231 } |
232 | 232 |
233 void FreeState(); | 233 void FreeState(); |
234 | 234 |
235 bool isMaterializable(const GlobalValue *GV) const override; | |
236 bool isDematerializable(const GlobalValue *GV) const override; | 235 bool isDematerializable(const GlobalValue *GV) const override; |
237 std::error_code Materialize(GlobalValue *GV) override; | 236 std::error_code materialize(GlobalValue *GV) override; |
238 std::error_code MaterializeModule(Module *M) override; | 237 std::error_code MaterializeModule(Module *M) override; |
239 void Dematerialize(GlobalValue *GV) override; | 238 void Dematerialize(GlobalValue *GV) override; |
240 void releaseBuffer() override; | 239 void releaseBuffer(); |
JF
2015/02/24 05:35:37
Not virtual anymore?
jvoung (off chromium)
2015/02/24 18:38:48
Yes, not virtual anymore. There's fancy new clang
| |
241 | 240 |
242 std::error_code Error(ErrorType E) const { | 241 std::error_code Error(ErrorType E) const { |
243 return std::error_code(E, BitcodeErrorCategory()); | 242 return std::error_code(E, BitcodeErrorCategory()); |
244 } | 243 } |
245 | 244 |
246 /// Generates the corresponding verbose Message, then generates error. | 245 /// Generates the corresponding verbose Message, then generates error. |
247 std::error_code Error(ErrorType E, const std::string &Message) const; | 246 std::error_code Error(ErrorType E, const std::string &Message) const; |
248 | 247 |
249 /// @brief Main interface to parsing a bitcode buffer. | 248 /// @brief Main interface to parsing a bitcode buffer. |
250 /// @returns true if an error occurred. | 249 /// @returns true if an error occurred. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
351 std::error_code InitStreamFromBuffer(); | 350 std::error_code InitStreamFromBuffer(); |
352 std::error_code InitLazyStream(); | 351 std::error_code InitLazyStream(); |
353 std::error_code FindFunctionInStream( | 352 std::error_code FindFunctionInStream( |
354 Function *F, | 353 Function *F, |
355 DenseMap<Function*, uint64_t>::iterator DeferredFunctionInfoIterator); | 354 DenseMap<Function*, uint64_t>::iterator DeferredFunctionInfoIterator); |
356 }; | 355 }; |
357 | 356 |
358 } // End llvm namespace | 357 } // End llvm namespace |
359 | 358 |
360 #endif | 359 #endif |
OLD | NEW |