tinygo/compiler
Ayke van Laethem 2bb70812a8 compiler: add function and global section pragmas
This patch adds a new pragma for functions and globals to set the
section name. This can be useful to place a function or global in a
special device specific section, for example:

  * Functions may be placed in RAM to make them run faster, or in flash
    (if RAM is the default) to not let them take up RAM.
  * DMA memory may only be placed in a special memory area.
  * Some RAM may be faster than other RAM, and some globals may be
    performance critical thus placing them in this special RAM area can
    help.
  * Some (large) global variables may need to be placed in external RAM,
    which can be done by placing them in a special section.

To use it, you have to place a function or global in a special section,
for example:

    //go:section .externalram
    var externalRAMBuffer [1024]byte

This can then be placed in a special section of the linker script, for
example something like this:

    .bss.extram (NOLOAD) : {
        *(.externalram)
    } > ERAM
2021-06-24 15:00:30 +02:00
..
ircheck compiler: move IR checker to separate package 2020-03-21 15:45:25 +01:00
llvmutil compiler: move settings to a separate Config struct 2021-01-29 14:49:58 +01:00
testdata compiler: add function and global section pragmas 2021-06-24 15:00:30 +02:00
asserts.go compiler: do not emit nil checks for loading closure variables 2021-05-26 20:21:08 +02:00
atomic.go compiler: work around an ARM backend bug in LLVM 2021-02-03 14:49:41 +01:00
calls.go compiler: fix "fragment covers entire variable" bug 2021-03-29 10:16:59 +02:00
channel.go compiler: support all kinds of deferred builtins 2021-01-24 09:28:09 +01:00
compiler.go compiler: add function and global section pragmas 2021-06-24 15:00:30 +02:00
compiler_test.go compiler: add tests for pragmas 2021-06-24 15:00:30 +02:00
defer.go builder, compiler: compile and cache packages in parallel 2021-03-21 11:51:35 +01:00
errors.go compiler: remove ir package 2021-01-24 15:39:15 +01:00
func.go compiler: decouple func lowering from interface type codes 2021-04-12 12:07:42 +02:00
gc.go compiler: track the result of string concatenation 2020-04-02 14:04:25 +02:00
goroutine.go compiler: skip context parameter when starting regular goroutine 2021-05-26 20:21:08 +02:00
inlineasm.go arm64: Add support for system calls (SVC) 2020-10-03 20:07:51 +02:00
interface.go compiler: refactor method names 2021-06-17 12:17:32 +02:00
interrupt.go Support chained interrupt handlers 2021-05-25 20:44:49 +02:00
intrinsics.go compiler,runtime: translate memzero calls to LLVM memset intrinsics 2020-03-27 21:01:59 +01:00
llvm.go compiler: move settings to a separate Config struct 2021-01-29 14:49:58 +01:00
map.go compiler: refactor map operations to use the builder object 2020-03-25 20:17:46 +01:00
sizes.go reflect: implement Sizeof and Alignof for func values 2021-03-29 01:04:11 +02:00
symbol.go compiler: add function and global section pragmas 2021-06-24 15:00:30 +02:00
syscall.go compiler: move settings to a separate Config struct 2021-01-29 14:49:58 +01:00
volatile.go compiler: do not perform nil checking when indexing slices 2020-03-27 07:38:16 +01:00