Revert "Fix bitcode auto-upgrade when using bitcode lazy loading"
authorMehdi Amini <mehdi.amini@apple.com>
Sat, 13 Aug 2016 23:39:14 +0000 (23:39 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Sat, 13 Aug 2016 23:39:14 +0000 (23:39 +0000)
This reverts commit r278610. Tests are broken

llvm-svn: 278613

llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/test/ThinLTO/X86/Inputs/autoupgrade.bc [deleted file]
llvm/test/ThinLTO/X86/autoupgrade.ll [deleted file]

index a93c4ed..9bb8b2f 100644 (file)
@@ -3634,6 +3634,15 @@ std::error_code BitcodeReader::parseModule(uint64_t ResumeBit,
           return EC;
         break;
       case bitc::FUNCTION_BLOCK_ID:
+        // If this is the first function body we've seen, reverse the
+        // FunctionsWithBodies list.
+        if (!SeenFirstFunctionBody) {
+          std::reverse(FunctionsWithBodies.begin(), FunctionsWithBodies.end());
+          if (std::error_code EC = globalCleanup())
+            return EC;
+          SeenFirstFunctionBody = true;
+        }
+
         if (VSTOffset > 0) {
           // If we have a VST forward declaration record, make sure we
           // parse the VST now if we haven't already. It is needed to
@@ -3660,15 +3669,6 @@ std::error_code BitcodeReader::parseModule(uint64_t ResumeBit,
           }
         }
 
-        // If this is the first function body we've seen, reverse the
-        // FunctionsWithBodies list.
-        if (!SeenFirstFunctionBody) {
-          std::reverse(FunctionsWithBodies.begin(), FunctionsWithBodies.end());
-          if (std::error_code EC = globalCleanup())
-            return EC;
-          SeenFirstFunctionBody = true;
-        }
-
         // Support older bitcode files that did not have the function
         // index in the VST, nor a VST forward declaration record, as
         // well as anonymous functions that do not have VST entries.
diff --git a/llvm/test/ThinLTO/X86/Inputs/autoupgrade.bc b/llvm/test/ThinLTO/X86/Inputs/autoupgrade.bc
deleted file mode 100644 (file)
index 578b337..0000000
Binary files a/llvm/test/ThinLTO/X86/Inputs/autoupgrade.bc and /dev/null differ
diff --git a/llvm/test/ThinLTO/X86/autoupgrade.ll b/llvm/test/ThinLTO/X86/autoupgrade.ll
deleted file mode 100644 (file)
index fd71114..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-; Verify that auto-upgrading intrinsics works with Lazy loaded bitcode
-; Do setup work for all below tests: generate bitcode and combined index
-; RUN: opt -module-summary %s -o %t.bc
-; RUN: llvm-lto -thinlto-action=thinlink -o %t3.bc %t.bc %p/Inputs/autoupgrade.bc
-
-; RUN: llvm-lto -thinlto-action=import %t.bc -thinlto-index=%t3.bc -o - | llvm-bcanalyzer -dump | FileCheck %s
-
-; We can't use llvm-dis here, because it would do the autoupgrade itself.
-
-; CHECK-NOT: 'llvm.invariant.start'
-; CHECK: record string = 'llvm.invariant.start.p0i8'
-; CHECK-NOT: 'llvm.invariant.start'
-
-target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-apple-macosx10.11.0"
-
-define i32 @main() #0 {
-entry:
-  call void (...) @globalfunc1()
-  ret i32 0
-}
-
-declare void @globalfunc1(...) #1