• Russ Cox's avatar
    in preparation for changing 6g's behavior to · 88e7fd54
    Russ Cox authored
    align the output args separately from the input args,
    change cgo2c to insert the necessary padding
    when the two arg lists are concatenated in the c
    translation.
    
    for example, there is a runtime
    
    	func indexstring(s string, i int32) (b byte)
    
    right now in 6g those arguments are aligned in one
    struct with s at offset 0, i at 16, and b at 20.
    soon the b byte will be in its own struct and structs
    are 8 aligned, so it will be b at 24.
    
    right now cgo2c generates:
    
    	void indexstring(string s, int32 i, byte b)
    
    this CL makes it generate, in --6g mode:
    
    	void indexstring(string s, int32 i, uint32, byte b)
    
    this is valid 6c input, although not valid gcc input.
    (the code is being generated for 6c only anyway.)
    
    also, allow C code to be mixed in among the Go funcs.
    every instance of the token `func' is expected to start
    a new go func.
    
    R=iant
    DELTA=145  (118 added, 0 deleted, 27 changed)
    OCL=30949
    CL=30963
    88e7fd54
Name
Last commit
Last update
..
archive/tar Loading commit data...
base64 Loading commit data...
bignum Loading commit data...
bufio Loading commit data...
bytes Loading commit data...
compress Loading commit data...
container Loading commit data...
crypto Loading commit data...
datafmt Loading commit data...
debug/macho/testdata Loading commit data...
exec Loading commit data...
exvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
gob Loading commit data...
hash Loading commit data...
http Loading commit data...
io Loading commit data...
json Loading commit data...
log Loading commit data...
malloc Loading commit data...
math Loading commit data...
net Loading commit data...
once Loading commit data...
os Loading commit data...
path Loading commit data...
rand Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
runtime Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
tabwriter Loading commit data...
template Loading commit data...
testing Loading commit data...
time Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...
utf8 Loading commit data...
xml Loading commit data...
Make.deps Loading commit data...
Makefile Loading commit data...
deps.bash Loading commit data...