comparison docs/GarbageCollection.rst @ 120:1172e4bd9c6f

update 4.0.0
author mir3636
date Fri, 25 Nov 2016 19:14:25 +0900
parents afa8332a0e37
children c2174574ed3a
comparison
equal deleted inserted replaced
101:34baf5011add 120:1172e4bd9c6f
202 <plugin>`. 202 <plugin>`.
203 203
204 Specifying GC code generation: ``gc "..."`` 204 Specifying GC code generation: ``gc "..."``
205 ------------------------------------------- 205 -------------------------------------------
206 206
207 .. code-block:: llvm 207 .. code-block:: text
208 208
209 define <returntype> @name(...) gc "name" { ... } 209 define <returntype> @name(...) gc "name" { ... }
210 210
211 The ``gc`` function attribute is used to specify the desired GC strategy to the 211 The ``gc`` function attribute is used to specify the desired GC strategy to the
212 compiler. Its programmatic equivalent is the ``setGC`` method of ``Function``. 212 compiler. Its programmatic equivalent is the ``setGC`` method of ``Function``.
1005 // Nothing to do. 1005 // Nothing to do.
1006 } 1006 }
1007 1007
1008 void MyGCPrinter::finishAssembly(AsmPrinter &AP) { 1008 void MyGCPrinter::finishAssembly(AsmPrinter &AP) {
1009 MCStreamer &OS = AP.OutStreamer; 1009 MCStreamer &OS = AP.OutStreamer;
1010 unsigned IntPtrSize = AP.TM.getSubtargetImpl()->getDataLayout()->getPointerSize(); 1010 unsigned IntPtrSize = AP.getPointerSize();
1011 1011
1012 // Put this in the data section. 1012 // Put this in the data section.
1013 OS.SwitchSection(AP.getObjFileLowering().getDataSection()); 1013 OS.SwitchSection(AP.getObjFileLowering().getDataSection());
1014 1014
1015 // For each function... 1015 // For each function...