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. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20071209/55693572/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: gc-5b-regen.patch Type: application/octet-stream Size: 200733 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20071209/55693572/attachment.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: gc-5a-funattr.patch Type: application/octet-stream Size: 21333 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20071209/55693572/attachment-0001.obj> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20071209/55693572/attachment-0001.html>
On Dec 9, 2007, at 7:40 AM, Gordon Henriksen wrote:> 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.This patch looks great. Please simplify the managedstatic stuff as we discussed on IRC, then commit. Thanks Gordon! -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20071209/7d975534/attachment.html>
Possibly Parallel Threads
- [LLVMdev] Re: [llvm-commits] CVS: llvm/lib/AsmParser/Lexer.cpp Lexer.l
- [LLVMdev] Re: [llvm-commits] CVS: llvm/lib/AsmParser/Lexer.cpp Lexer.l
- [LLVMdev] Re: [llvm-commits] CVS: llvm/lib/AsmParser/Lexer.cpp Lexer.l
- [LLVMdev] Re: [llvm-commits] CVS: llvm/lib/AsmParser/Lexer.cpp Lexer.l
- [LLVMdev] Build failure on x86_64