From 2741c8bf7b34a8987bb7fd2ba5a77b56ed440bd9 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 31 Jul 2012 16:22:18 -0700 Subject: Materialize functions with forward-referenced blocks in streamed modules This fixes the assertion in the GlobalMerge pass which was seeing GVs representing the unresolved forward references. materializeForwardReferencedFunctions materializes these functions and removes the special GVs from the global list. If there is a function with forward referenced blocks near the end of the bitcode file, then streaming could be ineffective for that file. This CL should also be committed upstream, but will go in here so we can fix the build before the next merge. BUG= http://code.google.com/p/nativeclient/issues/detail?id=2882 TEST=computed_goto_test Review URL: http://chromiumcodereview.appspot.com/10700165/ --- lib/Bitcode/Reader/BitcodeReader.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index f25a6809e4..60866ab832 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -2922,6 +2922,9 @@ Module *llvm::getStreamedBitcodeModule(const std::string &name, return 0; } R->setBufferOwned(false); // no buffer to delete + + R->materializeForwardReferencedFunctions(); + return M; } -- cgit v1.2.3-18-g5258