mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 22:13:39 +00:00
compiler: move NonConstGlobals pass to transform package
This commit is contained in:
committed by
Ron Evans
parent
b6314fa6ab
commit
c5cb2cec9b
@@ -2585,17 +2585,6 @@ func (c *Compiler) Verify() error {
|
||||
return llvm.VerifyModule(c.mod, llvm.PrintMessageAction)
|
||||
}
|
||||
|
||||
// Turn all global constants into global variables. This works around a
|
||||
// limitation on Harvard architectures (e.g. AVR), where constant and
|
||||
// non-constant pointers point to a different address space.
|
||||
func (c *Compiler) NonConstGlobals() {
|
||||
global := c.mod.FirstGlobal()
|
||||
for !global.IsNil() {
|
||||
global.SetGlobalConstant(false)
|
||||
global = llvm.NextGlobal(global)
|
||||
}
|
||||
}
|
||||
|
||||
// Emit object file (.o).
|
||||
func (c *Compiler) EmitObject(path string) error {
|
||||
llvmBuf, err := c.machine.EmitToMemoryBuffer(c.mod, llvm.ObjectFile)
|
||||
|
||||
Reference in New Issue
Block a user