llvm-6502/lib/IR
Duncan P. N. Exon Smith 49135bb76c Don't upgrade global constructors when reading bitcode
An optional third field was added to `llvm.global_ctors` (and
`llvm.global_dtors`) in r209015.  Most of the code has been changed to
deal with both versions of the variables.  Users of the C API might
create either version, the helper functions in LLVM create the two-field
version, and clang now creates the three-field version.

However, the BitcodeReader was changed to always upgrade to the
three-field version.  This created an unnecessary inconsistency in the
IR before/after serializing to bitcode.

This commit resolves the inconsistency by making the third field truly
optional (and not upgrading in the bitcode reader).  Since `llvm-link`
was relying on this upgrade code, rather than deleting it I've moved it
into `ModuleLinker`, where it upgrades these arrays as necessary to
resolve inconsistencies between modules.

The ideal resolution would be to remove the 2-field version and make the
third field required.  I filed PR20506 to track that.

I changed `test/Bitcode/upgrade-global-ctors.ll` to a negative test and
duplicated the `llvm-link` check in `test/Linker/global_ctors.ll` to
check both upgrade directions.

Since I came across this as part of PR5680 (serializing use-list order),
I've also added the missing `verify-uselistorder` RUN line to
`test/Bitcode/metadata-2.ll`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215457 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12 16:46:37 +00:00
..
AsmWriter.cpp IR: Print a newline when dumping Types 2014-08-12 03:24:59 +00:00
AsmWriter.h
AttributeImpl.h Add a dereferenceable attribute 2014-07-18 15:51:28 +00:00
Attributes.cpp Add a dereferenceable attribute 2014-07-18 15:51:28 +00:00
AutoUpgrade.cpp Don't upgrade global constructors when reading bitcode 2014-08-12 16:46:37 +00:00
BasicBlock.cpp Move helper for getting a terminating musttail call to BasicBlock 2014-08-12 00:05:15 +00:00
CMakeLists.txt IPO: Add use-list-order verifier 2014-07-25 14:49:26 +00:00
Comdat.cpp
ConstantFold.cpp
ConstantFold.h
ConstantRange.cpp
Constants.cpp
ConstantsContext.h
Core.cpp [LLVM-C] Expose User::getOperandUse as LLVMGetOperandUse. 2014-08-12 02:55:40 +00:00
DataLayout.cpp
DebugInfo.cpp Revert "Reapply "DebugInfo: Ensure that all debug location scope chains from instructions within a function, lead to the function itself."" 2014-08-06 22:30:12 +00:00
DebugLoc.cpp
DiagnosticInfo.cpp Rename DiagnosticInfoOptimizationWarning to DiagnosticInfoOptimizationFailure 2014-07-18 19:36:04 +00:00
DiagnosticPrinter.cpp
DIBuilder.cpp Debug info: Infrastructure to support debug locations for fragmented 2014-08-01 22:11:58 +00:00
Dominators.cpp Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges." 2014-07-21 17:06:51 +00:00
Function.cpp Provide convenient access to the zext/sext attributes of function arguments. NFC. 2014-08-05 05:43:41 +00:00
GCOV.cpp Update the MemoryBuffer API to use ErrorOr. 2014-07-06 17:43:13 +00:00
Globals.cpp
GVMaterializer.cpp
InlineAsm.cpp
Instruction.cpp
Instructions.cpp Add CreatePointerBitCastOrAddrSpaceCast to IRBuilder and co. 2014-07-14 17:24:35 +00:00
IntrinsicInst.cpp
IRBuilder.cpp Add scoped-noalias metadata 2014-07-24 14:25:39 +00:00
IRPrintingPasses.cpp
LeakDetector.cpp
LeaksContext.h
LegacyPassManager.cpp Fix typos: 2014-08-11 18:04:46 +00:00
LLVMBuild.txt
LLVMContext.cpp Add scoped-noalias metadata 2014-07-24 14:25:39 +00:00
LLVMContextImpl.cpp
LLVMContextImpl.h
Makefile
Mangler.cpp Don't count inreg params when mangling fastcall functions 2014-08-06 18:09:04 +00:00
MDBuilder.cpp Simplify and improve scoped-noalias metadata semantics 2014-07-25 15:50:02 +00:00
Metadata.cpp Add scoped-noalias metadata 2014-07-24 14:25:39 +00:00
Module.cpp
module.modulemap
Pass.cpp
PassManager.cpp Remove unnecessary/redundant std::move 2014-07-16 17:09:21 +00:00
PassRegistry.cpp
SymbolTableListTraitsImpl.h
Type.cpp pr20588: add missing calls to va_end. 2014-08-08 15:57:37 +00:00
TypeFinder.cpp
Use.cpp
UseListOrder.cpp verify-uselistorder: Move shuffleUseLists() out of lib/IR 2014-08-01 23:03:36 +00:00
User.cpp
Value.cpp IR: Add Value::reverseUseList() 2014-08-01 23:28:49 +00:00
ValueSymbolTable.cpp
ValueTypes.cpp
Verifier.cpp Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges." 2014-07-21 17:06:51 +00:00