|
27 | 27 | #include "swift/AST/TBDGenRequests.h" |
28 | 28 | #include "swift/Basic/Defer.h" |
29 | 29 | #include "swift/Basic/Dwarf.h" |
| 30 | +#include "swift/Basic/MD5Stream.h" |
30 | 31 | #include "swift/Basic/Platform.h" |
31 | 32 | #include "swift/Basic/Statistic.h" |
32 | 33 | #include "swift/Basic/Version.h" |
|
69 | 70 | #include "llvm/Support/ErrorHandling.h" |
70 | 71 | #include "llvm/Support/FileSystem.h" |
71 | 72 | #include "llvm/Support/FormattedStream.h" |
72 | | -#include "llvm/Support/MD5.h" |
73 | 73 | #include "llvm/Support/Mutex.h" |
74 | 74 | #include "llvm/Support/Path.h" |
75 | 75 | #include "llvm/Target/TargetMachine.h" |
@@ -376,30 +376,6 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts, |
376 | 376 | } |
377 | 377 | } |
378 | 378 |
|
379 | | -namespace { |
380 | | -/// An output stream which calculates the MD5 hash of the streamed data. |
381 | | -class MD5Stream : public llvm::raw_ostream { |
382 | | -private: |
383 | | - |
384 | | - uint64_t Pos = 0; |
385 | | - llvm::MD5 Hash; |
386 | | - |
387 | | - void write_impl(const char *Ptr, size_t Size) override { |
388 | | - Hash.update(ArrayRef<uint8_t>(reinterpret_cast<const uint8_t *>(Ptr), Size)); |
389 | | - Pos += Size; |
390 | | - } |
391 | | - |
392 | | - uint64_t current_pos() const override { return Pos; } |
393 | | - |
394 | | -public: |
395 | | - |
396 | | - void final(MD5::MD5Result &Result) { |
397 | | - flush(); |
398 | | - Hash.final(Result); |
399 | | - } |
400 | | -}; |
401 | | -} // end anonymous namespace |
402 | | - |
403 | 379 | /// Computes the MD5 hash of the llvm \p Module including the compiler version |
404 | 380 | /// and options which influence the compilation. |
405 | 381 | static MD5::MD5Result getHashOfModule(const IRGenOptions &Opts, |
|
0 commit comments