Next GC patch for review

This patch adds a string attribute to each function which enables GC codegen and selects the metadata format to generate. In order to avoid adding a word to each Function for programs which do not use garbage collection (e.g. llvm-gcc, clang), this value is stored in an on-the-side table.

— Gordon

gc-5a-funattr.patch (+222 -22):

docs/LangRef.html (+22 -3)
test/CodeGen/Generic/GC/alloc_loop.ll (+1 -1)
test/Assembler/2007-09-29-GC.ll (+12)
include/llvm/Function.h (+7)
lib/VMCore/Function.cpp (+33)
include/llvm/Support/ManagedStatic.h (+4)
lib/Support/ManagedStatic.cpp (+20)
include/llvm/Bitcode/LLVMBitCodes.h (+3 -1)
lib/Bitcode/Reader/BitcodeReader.cpp (+14 -1)
lib/Bitcode/Writer/BitcodeWriter.cpp (+23 -10)
lib/VMCore/AsmWriter.cpp (+2)
lib/AsmParser/llvmAsmParser.y (+13 -3)
lib/AsmParser/LLLexer.cpp (+1)
lib/Transforms/Utils/CloneModule.cpp (+2)
include/llvm-c/Core.h (+2)
lib/VMCore/Core.cpp (+13)
bindings/ocaml/llvm/llvm.ml (+2)
bindings/ocaml/llvm/llvm_ocaml.c (+23)
bindings/ocaml/llvm/llvm.mli (+9)
test/Bindings/Ocaml/vmcore.ml (+16 -3)

Adds these methods to Function and makes corresponding changes to assembly and bitcode:

bool hasCollector() const;
const char *getCollector() const;
void setCollector(const char *);
void clearCollector();

The assembly representation is as such:

define void @f() gc “shadow-stack” { …

Uses StringPool to unique collector names, which are extremely likely to be unique per process.

gc-5b-regen.patch (+1245 -1209):

lib/AsmParser/llvmAsmParser.cpp.cvs (+1221 -1197)
lib/AsmParser/llvmAsmParser.h.cvs (+11 -9)
lib/AsmParser/llvmAsmParser.y.cvs (+13 -3)

Regenerate.

gc-5b-regen.patch (196 KB)

gc-5a-funattr.patch (20.8 KB)

This patch looks great. Please simplify the managedstatic stuff as we discussed on IRC, then commit. Thanks Gordon!

-Chris