Revert "Don't assert if materializing before seeing any function bodies"
authorFilipe Cabecinhas <me@filcab.net>
Fri, 30 Oct 2015 00:00:58 +0000 (00:00 +0000)
committerFilipe Cabecinhas <me@filcab.net>
Fri, 30 Oct 2015 00:00:58 +0000 (00:00 +0000)
This reverts r251667 since it broke the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251671 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bitcode/Reader/BitcodeReader.cpp
test/Bitcode/Inputs/invalid-no-function-block.bc [deleted file]
test/Bitcode/invalid.test

index d2cbe9e85a41408243e3ddf5427f8981bf6aa1ae..e23f81763307bb8385e0e238271134c163ab2cd4 100644 (file)
@@ -3054,9 +3054,7 @@ std::error_code BitcodeReader::rememberAndSkipFunctionBodies() {
 
   if (Stream.AtEndOfStream()) return error("Could not find function in stream");
 
-  if (!SeenFirstFunctionBody)
-    return error("Trying to materialize functions before seeing function blocks");
-
+  assert(SeenFirstFunctionBody);
   // An old bitcode file with the symbol table at the end would have
   // finished the parse greedily.
   assert(SeenValueSymbolTable);
diff --git a/test/Bitcode/Inputs/invalid-no-function-block.bc b/test/Bitcode/Inputs/invalid-no-function-block.bc
deleted file mode 100644 (file)
index 52b6558..0000000
Binary files a/test/Bitcode/Inputs/invalid-no-function-block.bc and /dev/null differ
index 24ccd8bccd5bd86ec9cb2167e28b761becaba2c5..69104046df20256fa7cafdde5c1d1f3f0d75590c 100644 (file)
@@ -207,8 +207,3 @@ RUN: not llvm-dis -disable-output %p/Inputs/invalid-alias-type-mismatch.bc 2>&1
 RUN:   FileCheck --check-prefix=ALIAS-TYPE-MISMATCH %s
 
 ALIAS-TYPE-MISMATCH: Alias and aliasee types don't match
-
-RUN: not llvm-dis -disable-output %p/Inputs/invalid-no-function-block.bc 2>&1 | \
-RUN:   FileCheck --check-prefix=NO-FUNCTION-BLOCK %s
-
-NO-FUNCTION-BLOCK: Trying to materialize functions before seeing function blocks