mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-21 21:09:02 +00:00
compiler: comments
This commit is contained in:
@@ -213,6 +213,7 @@ func (c *Compiler) Parse(mainPath string, buildTags []string) error {
|
|||||||
worklist = worklist[1:]
|
worklist = worklist[1:]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Transform each package into LLVM IR.
|
||||||
for _, pkg := range packageList {
|
for _, pkg := range packageList {
|
||||||
err := c.parsePackage(program, pkg)
|
err := c.parsePackage(program, pkg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -1083,6 +1084,8 @@ func (c *Compiler) LinkModule(mod llvm.Module) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Compiler) ApplyFunctionSections() {
|
func (c *Compiler) ApplyFunctionSections() {
|
||||||
|
// Put every function in a separate section. This makes it possible for the
|
||||||
|
// linker to remove dead code (--gc-sections).
|
||||||
llvmFn := c.mod.FirstFunction()
|
llvmFn := c.mod.FirstFunction()
|
||||||
for !llvmFn.IsNil() {
|
for !llvmFn.IsNil() {
|
||||||
if !llvmFn.IsDeclaration() {
|
if !llvmFn.IsDeclaration() {
|
||||||
|
|||||||
Reference in New Issue
Block a user