Land the long talked about "type system rewrite" patch. This
commit1afcace3a3a138b1b18e5c6270caa8dae2261ae2
authorChris Lattner <sabre@nondot.org>
Sat, 9 Jul 2011 17:41:24 +0000 (9 17:41 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 9 Jul 2011 17:41:24 +0000 (9 17:41 +0000)
tree2fed26ec8965151524b81246c7fa7c3e2382fd31
parentc36ed70ec5c3c99f9559cfaa199373f60219a2be
Land the long talked about "type system rewrite" patch.  This
patch brings numerous advantages to LLVM.  One way to look at it
is through diffstat:
 109 files changed, 3005 insertions(+), 5906 deletions(-)

Removing almost 3K lines of code is a good thing.  Other advantages
include:

1. Value::getType() is a simple load that can be CSE'd, not a mutating
   union-find operation.
2. Types a uniqued and never move once created, defining away PATypeHolder.
3. Structs can be "named" now, and their name is part of the identity that
   uniques them.  This means that the compiler doesn't merge them structurally
   which makes the IR much less confusing.
4. Now that there is no way to get a cycle in a type graph without a named
   struct type, "upreferences" go away.
5. Type refinement is completely gone, which should make LTO much MUCH faster
   in some common cases with C++ code.
6. Types are now generally immutable, so we can use "Type *" instead
   "const Type *" everywhere.

Downsides of this patch are that it removes some functions from the C API,
so people using those will have to upgrade to (not yet added) new API.
"LLVM 3.0" is the right time to do this.

There are still some cleanups pending after this, this patch is large enough
as-is.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
109 files changed:
docs/LangRef.html
docs/ProgrammersManual.html
include/llvm-c/Core.h
include/llvm-c/Transforms/IPO.h
include/llvm/AbstractTypeUser.h [deleted file]
include/llvm/Bitcode/LLVMBitCodes.h
include/llvm/Constants.h
include/llvm/DefaultPasses.h
include/llvm/DerivedTypes.h
include/llvm/Function.h
include/llvm/GlobalAlias.h
include/llvm/GlobalValue.h
include/llvm/InitializePasses.h
include/llvm/Instructions.h
include/llvm/LinkAllPasses.h
include/llvm/Module.h
include/llvm/Support/PassManagerBuilder.h
include/llvm/Transforms/IPO.h
include/llvm/Transforms/Utils/ValueMapper.h
include/llvm/Type.h
include/llvm/TypeSymbolTable.h [deleted file]
include/llvm/Value.h
lib/AsmParser/LLLexer.h
lib/AsmParser/LLParser.cpp
lib/AsmParser/LLParser.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Reader/BitcodeReader.h
lib/Bitcode/Writer/BitcodeWriter.cpp
lib/Bitcode/Writer/ValueEnumerator.cpp
lib/Bitcode/Writer/ValueEnumerator.h
lib/CodeGen/ShadowStackGC.cpp
lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
lib/Linker/LinkModules.cpp
lib/Target/CBackend/CBackend.cpp
lib/Target/CppBackend/CPPBackend.cpp
lib/Target/TargetData.cpp
lib/Transforms/IPO/CMakeLists.txt
lib/Transforms/IPO/DeadTypeElimination.cpp [deleted file]
lib/Transforms/IPO/IPO.cpp
lib/Transforms/IPO/MergeFunctions.cpp
lib/Transforms/IPO/StripSymbols.cpp
lib/Transforms/Utils/CloneModule.cpp
lib/Transforms/Utils/LowerInvoke.cpp
lib/Transforms/Utils/ValueMapper.cpp
lib/VMCore/AsmWriter.cpp
lib/VMCore/CMakeLists.txt
lib/VMCore/ConstantFold.cpp
lib/VMCore/Constants.cpp
lib/VMCore/ConstantsContext.h
lib/VMCore/Core.cpp
lib/VMCore/Function.cpp
lib/VMCore/Globals.cpp
lib/VMCore/InlineAsm.cpp
lib/VMCore/Instructions.cpp
lib/VMCore/LLVMContextImpl.cpp
lib/VMCore/LLVMContextImpl.h
lib/VMCore/Metadata.cpp
lib/VMCore/Module.cpp
lib/VMCore/Type.cpp
lib/VMCore/TypeSymbolTable.cpp [deleted file]
lib/VMCore/TypesContext.h [deleted file]
lib/VMCore/Value.cpp
lib/VMCore/Verifier.cpp
test/Assembler/2002-07-25-ReturnPtrFunction.ll
test/Assembler/2002-12-15-GlobalResolve.ll
test/Assembler/2003-04-15-ConstantInitAssertion.ll
test/Assembler/2003-05-21-MalformedStructCrash.ll
test/Assembler/2004-11-28-InvalidTypeCrash.ll
test/Assembler/getelementptr.ll
test/CodeGen/Generic/crash.ll
test/CodeGen/X86/2010-02-12-CoalescerBug-Impdef.ll
test/CodeGen/X86/2010-11-09-MOVLPS.ll
test/CodeGen/X86/fp-stack-2results.ll
test/CodeGen/X86/pr3317.ll
test/Feature/globalvars.ll
test/Feature/testtype.ll
test/FrontendC/mmx-inline-asm.c
test/Linker/2003-01-30-LinkerTypeRename.ll
test/Linker/2003-08-23-GlobalVarLinking.ll
test/Linker/2003-08-23-RecursiveOpaqueTypeResolve.ll
test/Linker/2003-08-28-TypeResolvesGlobal.ll
test/Linker/testlink1.ll
test/Linker/testlink2.ll
test/Linker/unnamed-addr1-a.ll
test/Other/constant-fold-gep.ll
test/Transforms/ConstProp/extractvalue.ll
test/Transforms/ConstProp/insertvalue.ll
test/Transforms/ConstProp/overflow-ops.ll
test/Transforms/DeadArgElim/keepalive.ll
test/Transforms/GlobalOpt/2005-09-27-Crash.ll
test/Transforms/InstCombine/2007-11-07-OpaqueAlignCrash.ll
test/Transforms/InstCombine/getelementptr.ll
test/Transforms/InstCombine/phi.ll
test/Transforms/InstCombine/vec_narrow.ll
test/Transforms/InstCombine/vec_shuffle.ll
test/Transforms/LowerSetJmp/simpletest.ll
test/Transforms/MemCpyOpt/memcpy.ll
test/Transforms/Reassociate/2011-01-26-UseAfterFree.ll
test/Transforms/SCCP/ipsccp-basic.ll
test/Transforms/ScalarRepl/2003-10-29-ArrayProblem.ll
test/Transforms/ScalarRepl/copy-aggregate.ll
test/Transforms/ScalarRepl/phi-select.ll
test/Verifier/2002-04-13-RetTypes.ll
test/Verifier/2008-11-15-RetVoid.ll
tools/bugpoint/ExtractFunction.cpp
tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
tools/llvm-extract/llvm-extract.cpp
unittests/CMakeLists.txt
unittests/VMCore/DerivedTypesTest.cpp [deleted file]