mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-21 16:25:23 +00:00
Add support for referencing global variables/functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4907 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -133,8 +133,14 @@ namespace {
|
||||
// If this operand is a constant, emit the code to copy the constant into
|
||||
// the register here...
|
||||
//
|
||||
if (Constant *C = dyn_cast<Constant>(V))
|
||||
if (Constant *C = dyn_cast<Constant>(V)) {
|
||||
copyConstantToRegister(C, Reg);
|
||||
} else if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
|
||||
// Move the address of the global into the register
|
||||
BuildMI(BB, X86::MOVir32, 1, Reg).addReg(GV);
|
||||
} else {
|
||||
assert(0 && "Don't know how to handle a value of this type!");
|
||||
}
|
||||
|
||||
return Reg;
|
||||
}
|
||||
|
Reference in New Issue
Block a user