summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PIC16/PIC16MemSelOpt.cpp
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2009-05-11 06:01:38 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2009-05-11 06:01:38 +0000
commit9d175c15e768d5ed4cb8fb1771621a299b87a94a (patch)
treeaa2faddc22f06e3b3f43432128b886fa8672c11b /llvm/lib/Target/PIC16/PIC16MemSelOpt.cpp
parentaeec9d53cedcd096911042a902e0f70a5bb403ad (diff)
downloadbcm5719-llvm-9d175c15e768d5ed4cb8fb1771621a299b87a94a.tar.gz
bcm5719-llvm-9d175c15e768d5ed4cb8fb1771621a299b87a94a.zip
Detect calls to compiler intrinsics and emit an extern declarations
only for those. These extern declarations to intrinsics are currently being emitted at the bottom of generated .s file, which works fine with gpasm(not sure about MPSAM though). PIC16 linker generates errors for few cases (function-args/struct_args_5) if you do not include any extern declarations (even if no intrinsics are being used), but that needs to be fixed in the linker itself. llvm-svn: 71423
Diffstat (limited to 'llvm/lib/Target/PIC16/PIC16MemSelOpt.cpp')
-rw-r--r--llvm/lib/Target/PIC16/PIC16MemSelOpt.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16MemSelOpt.cpp b/llvm/lib/Target/PIC16/PIC16MemSelOpt.cpp
index 688fee2cf79..d433e31fbe7 100644
--- a/llvm/lib/Target/PIC16/PIC16MemSelOpt.cpp
+++ b/llvm/lib/Target/PIC16/PIC16MemSelOpt.cpp
@@ -137,6 +137,8 @@ bool MemSelOpt::processInstruction(MachineInstr *MI) {
}
// Get the section name(NewBank) for MemOp.
+ // This assumes that the section names for globals are laready set by
+ // AsmPrinter->doInitialization.
std::string NewBank = CurBank;
if (Op.getType() == MachineOperand::MO_GlobalAddress &&
Op.getGlobal()->getType()->getAddressSpace() == PIC16ISD::RAM_SPACE) {
OpenPOWER on IntegriCloud