From 466a64e2987cdab261f0c9bf25f0ddddc37f716f Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sat, 13 Aug 2016 23:39:14 +0000 Subject: [PATCH] Revert "Fix bitcode auto-upgrade when using bitcode lazy loading" This reverts commit r278610. Tests are broken llvm-svn: 278613 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 18 +++++++++--------- llvm/test/ThinLTO/X86/Inputs/autoupgrade.bc | Bin 1024 -> 0 bytes llvm/test/ThinLTO/X86/autoupgrade.ll | 23 ----------------------- 3 files changed, 9 insertions(+), 32 deletions(-) delete mode 100644 llvm/test/ThinLTO/X86/Inputs/autoupgrade.bc delete mode 100644 llvm/test/ThinLTO/X86/autoupgrade.ll diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index a93c4ed..9bb8b2f 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -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 index 578b33796fa39f6f845ce95fed57e0ef00ef1572..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmX|APiWg#7=Nm4JvDY@xfYwV%0{+RmP25kvo`h=4_oSjOEPe}P|7Z~LmIL}hvFE= zaeI&>HP2mqa7!6xlwq@Ou))A%JM7Ryngk{~w|HTc973pxTgu3SDIN4s*q)MXAH47P zz4!h9_}K)n!{<2(00e-L?`|JR`z-U_%z%h(2d|)wf zGj3SUQEVu3i_q<-taP8(vNENzA0Cr#*(99}abem$))SISi3%skqor>^Ur6dCn2OWC zk&I6i%WduH=N8{6HQ@%piesKE#lRQ6%iVu4ku6HK;J0&FN0>SF7`Pz-(2M1epFS>3 zU$?mYcXiBm^?HRnFKac-7pU(8JdOR|yS7S-udHHCJ43^~ z3UdSK%q&veXrT(PmB_H7g-hhHs`Xw@GFMtmq03yUFu52kq+qs1JyW4lgL4ARx2Sy; z7Fd|8!Fl0G`x6T@DwMy%wf#rSBWBe{WM5w%ee zvPnh_Ia(&8&3rklz^gP|Odv&p1%=Gzks_eJrjyyLFzuk@v!G+Q%XE{>5WC^o@$p+e z&sy3$6TBhb)5Mk>`I#KKr;X^O*z9t-6udeMhi6d+a}_BSq@?iZVD6O_hh0$7B^u4S zQKpI(tHr_nF0=oH`FoYw3zAbto$u87<^kVM^ACLdM$z*iO+Bv25krnt5BM+Z;oCAE zym)*49h~&_lK2NHHrDOGeu|WfD5GfES(s0utQ%!(sPECoj(y;Gkz_g*W;f<&3(Oww zLKyID-}kP?y_-IMyXf71!gt!9KMC)Qdm`MB-@l`Y&1C;kBPq0yhj~2b@9)>z~p)oN#uTbq4yM0$*q} zVUW@^?F87)da(Tf%wgHA<2=Lqr