Exemplo n.º 1
0
func NewLLVMTypeMap(target llvm.TargetData) *LLVMTypeMap {
	// spec says int is either 32-bit or 64-bit.
	var inttype llvm.Type
	if target.PointerSize() >= 8 {
		inttype = llvm.Int64Type()
	} else {
		inttype = llvm.Int32Type()
	}
	return &LLVMTypeMap{
		target:  target,
		types:   make(map[string]llvm.Type),
		inttype: inttype,
	}
}
Exemplo n.º 2
0
func NewLLVMTypeMap(target llvm.TargetData) *llvmTypeMap {
	// spec says int is either 32-bit or 64-bit.
	var inttype llvm.Type
	if target.PointerSize() >= 8 {
		inttype = llvm.Int64Type()
	} else {
		inttype = llvm.Int32Type()
	}
	return &llvmTypeMap{
		StdSizes: &types.StdSizes{
			WordSize: int64(target.PointerSize()),
			MaxAlign: 8,
		},
		target:     target,
		inttype:    inttype,
		ptrstandin: llvm.GlobalContext().StructCreateNamed(""),
	}
}