blob: 3ff27a9ae7f3ae86e7ef3926a694a1575a3d1e5d [file] [log] [blame]
Chris Lattnerf0144122009-07-28 03:13:23 +00001//===-- PIC16TargetObjectFile.cpp - PIC16 object files --------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "PIC16TargetObjectFile.h"
Chris Lattnerc0776212009-08-15 06:13:40 +000011#include "MCSectionPIC16.h"
Chris Lattnerf0144122009-07-28 03:13:23 +000012#include "PIC16ISelLowering.h"
13#include "PIC16TargetMachine.h"
14#include "llvm/DerivedTypes.h"
15#include "llvm/Module.h"
Chris Lattnera87dea42009-07-31 18:48:30 +000016#include "llvm/MC/MCSection.h"
Chris Lattnerfbf1d272009-08-08 20:14:13 +000017#include "llvm/MC/MCContext.h"
Chris Lattner93b6db32009-08-08 23:39:42 +000018#include "llvm/Support/raw_ostream.h"
Chris Lattnerf0144122009-07-28 03:13:23 +000019using namespace llvm;
20
Chris Lattner93b6db32009-08-08 23:39:42 +000021
22MCSectionPIC16 *MCSectionPIC16::Create(const StringRef &Name,
23 SectionKind K, MCContext &Ctx) {
Chris Lattner873bc4c2009-08-13 00:26:52 +000024 return new (Ctx) MCSectionPIC16(Name, K);
Chris Lattner93b6db32009-08-08 23:39:42 +000025}
26
27
28void MCSectionPIC16::PrintSwitchToSection(const TargetAsmInfo &TAI,
29 raw_ostream &OS) const {
30 OS << getName() << '\n';
31}
32
33
34
35
Daniel Dunbar967ce7f2009-08-02 01:25:15 +000036PIC16TargetObjectFile::PIC16TargetObjectFile()
Chris Lattner759b8882009-08-06 16:27:28 +000037 : ExternalVarDecls(0), ExternalVarDefs(0) {
Daniel Dunbar967ce7f2009-08-02 01:25:15 +000038}
39
Chris Lattner93b6db32009-08-08 23:39:42 +000040const MCSectionPIC16 *PIC16TargetObjectFile::
41getPIC16Section(const char *Name, SectionKind Kind) const {
Chris Lattner873bc4c2009-08-13 00:26:52 +000042 MCSectionPIC16 *&Entry = SectionsByName[Name];
43 if (Entry)
44 return Entry;
45
46 return Entry = MCSectionPIC16::Create(Name, Kind, getContext());
Chris Lattnerfbf1d272009-08-08 20:14:13 +000047}
48
49
Chris Lattnera87dea42009-07-31 18:48:30 +000050void PIC16TargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &tm){
51 TargetLoweringObjectFile::Initialize(Ctx, tm);
52 TM = &tm;
53
Chris Lattner93b6db32009-08-08 23:39:42 +000054 BSSSection = getPIC16Section("udata.# UDATA", SectionKind::getBSS());
55 ReadOnlySection = getPIC16Section("romdata.# ROMDATA",
Chris Lattner9aee1812009-08-08 20:23:47 +000056 SectionKind::getReadOnly());
Chris Lattner93b6db32009-08-08 23:39:42 +000057 DataSection = getPIC16Section("idata.# IDATA", SectionKind::getDataRel());
Chris Lattnerf0144122009-07-28 03:13:23 +000058
59 // Need because otherwise a .text symbol is emitted by DwarfWriter
60 // in BeginModule, and gpasm cribbs for that .text symbol.
Chris Lattner93b6db32009-08-08 23:39:42 +000061 TextSection = getPIC16Section("", SectionKind::getText());
Chris Lattnerf0144122009-07-28 03:13:23 +000062
Chris Lattner93b6db32009-08-08 23:39:42 +000063 ROSections.push_back(new PIC16Section((MCSectionPIC16*)ReadOnlySection));
Chris Lattnerf0144122009-07-28 03:13:23 +000064
65 // FIXME: I don't know what the classification of these sections really is.
Chris Lattner9aee1812009-08-08 20:23:47 +000066 ExternalVarDecls = new PIC16Section(getPIC16Section("ExternalVarDecls",
Chris Lattner1ef9be22009-08-02 00:02:44 +000067 SectionKind::getMetadata()));
Chris Lattner9aee1812009-08-08 20:23:47 +000068 ExternalVarDefs = new PIC16Section(getPIC16Section("ExternalVarDefs",
Chris Lattner1ef9be22009-08-02 00:02:44 +000069 SectionKind::getMetadata()));
Chris Lattnerf0144122009-07-28 03:13:23 +000070}
71
Chris Lattner759b8882009-08-06 16:27:28 +000072const MCSection *PIC16TargetObjectFile::
Sanjiv Guptaeb01aba2009-08-20 19:28:24 +000073getSectionForFunction(const std::string &FnName, bool isInterrupt) const {
74 std::string T = PAN::getCodeSectionName(FnName, isInterrupt);
Chris Lattner93b6db32009-08-08 23:39:42 +000075 return getPIC16Section(T.c_str(), SectionKind::getText());
Chris Lattner759b8882009-08-06 16:27:28 +000076}
77
78
79const MCSection *PIC16TargetObjectFile::
80getSectionForFunctionFrame(const std::string &FnName) const {
81 std::string T = PAN::getFrameSectionName(FnName);
Chris Lattner93b6db32009-08-08 23:39:42 +000082 return getPIC16Section(T.c_str(), SectionKind::getDataRel());
Chris Lattner759b8882009-08-06 16:27:28 +000083}
Chris Lattnerf0144122009-07-28 03:13:23 +000084
Chris Lattnera87dea42009-07-31 18:48:30 +000085const MCSection *
Chris Lattnerf0144122009-07-28 03:13:23 +000086PIC16TargetObjectFile::getBSSSectionForGlobal(const GlobalVariable *GV) const {
87 assert(GV->hasInitializer() && "This global doesn't need space");
88 Constant *C = GV->getInitializer();
89 assert(C->isNullValue() && "Unitialized globals has non-zero initializer");
90
91 // Find how much space this global needs.
Chris Lattnera87dea42009-07-31 18:48:30 +000092 const TargetData *TD = TM->getTargetData();
Chris Lattnerf0144122009-07-28 03:13:23 +000093 const Type *Ty = C->getType();
94 unsigned ValSize = TD->getTypeAllocSize(Ty);
95
96 // Go through all BSS Sections and assign this variable
97 // to the first available section having enough space.
98 PIC16Section *FoundBSS = NULL;
99 for (unsigned i = 0; i < BSSSections.size(); i++) {
100 if (DataBankSize - BSSSections[i]->Size >= ValSize) {
101 FoundBSS = BSSSections[i];
102 break;
103 }
104 }
105
106 // No BSS section spacious enough was found. Crate a new one.
107 if (!FoundBSS) {
108 std::string name = PAN::getUdataSectionName(BSSSections.size());
Chris Lattner93b6db32009-08-08 23:39:42 +0000109 const MCSectionPIC16 *NewSection
110 = getPIC16Section(name.c_str(), /*FIXME*/ SectionKind::getMetadata());
Chris Lattnerf0144122009-07-28 03:13:23 +0000111
112 FoundBSS = new PIC16Section(NewSection);
113
114 // Add this newly created BSS section to the list of BSSSections.
115 BSSSections.push_back(FoundBSS);
116 }
117
118 // Insert the GV into this BSS.
119 FoundBSS->Items.push_back(GV);
120 FoundBSS->Size += ValSize;
121 return FoundBSS->S_;
122}
123
Chris Lattnera87dea42009-07-31 18:48:30 +0000124const MCSection *
Chris Lattnerf0144122009-07-28 03:13:23 +0000125PIC16TargetObjectFile::getIDATASectionForGlobal(const GlobalVariable *GV) const{
126 assert(GV->hasInitializer() && "This global doesn't need space");
127 Constant *C = GV->getInitializer();
128 assert(!C->isNullValue() && "initialized globals has zero initializer");
129 assert(GV->getType()->getAddressSpace() == PIC16ISD::RAM_SPACE &&
130 "can split initialized RAM data only");
131
132 // Find how much space this global needs.
Chris Lattnera87dea42009-07-31 18:48:30 +0000133 const TargetData *TD = TM->getTargetData();
Chris Lattnerf0144122009-07-28 03:13:23 +0000134 const Type *Ty = C->getType();
135 unsigned ValSize = TD->getTypeAllocSize(Ty);
136
137 // Go through all IDATA Sections and assign this variable
138 // to the first available section having enough space.
139 PIC16Section *FoundIDATA = NULL;
140 for (unsigned i = 0; i < IDATASections.size(); i++) {
141 if (DataBankSize - IDATASections[i]->Size >= ValSize) {
142 FoundIDATA = IDATASections[i];
143 break;
144 }
145 }
146
147 // No IDATA section spacious enough was found. Crate a new one.
148 if (!FoundIDATA) {
149 std::string name = PAN::getIdataSectionName(IDATASections.size());
Chris Lattner93b6db32009-08-08 23:39:42 +0000150 const MCSectionPIC16 *NewSection =
151 getPIC16Section(name.c_str(), /*FIXME*/ SectionKind::getMetadata());
Chris Lattnerf0144122009-07-28 03:13:23 +0000152
153 FoundIDATA = new PIC16Section(NewSection);
154
155 // Add this newly created IDATA section to the list of IDATASections.
156 IDATASections.push_back(FoundIDATA);
157 }
158
159 // Insert the GV into this IDATA.
160 FoundIDATA->Items.push_back(GV);
161 FoundIDATA->Size += ValSize;
162 return FoundIDATA->S_;
163}
164
165// Get the section for an automatic variable of a function.
166// For PIC16 they are globals only with mangled names.
Chris Lattnera87dea42009-07-31 18:48:30 +0000167const MCSection *
Chris Lattnerf0144122009-07-28 03:13:23 +0000168PIC16TargetObjectFile::getSectionForAuto(const GlobalVariable *GV) const {
169
170 const std::string name = PAN::getSectionNameForSym(GV->getName());
171
172 // Go through all Auto Sections and assign this variable
173 // to the appropriate section.
174 PIC16Section *FoundAutoSec = NULL;
175 for (unsigned i = 0; i < AutosSections.size(); i++) {
176 if (AutosSections[i]->S_->getName() == name) {
177 FoundAutoSec = AutosSections[i];
178 break;
179 }
180 }
181
182 // No Auto section was found. Crate a new one.
183 if (!FoundAutoSec) {
Chris Lattner93b6db32009-08-08 23:39:42 +0000184 const MCSectionPIC16 *NewSection =
185 getPIC16Section(name.c_str(), /*FIXME*/ SectionKind::getMetadata());
Chris Lattnerf0144122009-07-28 03:13:23 +0000186
187 FoundAutoSec = new PIC16Section(NewSection);
188
189 // Add this newly created autos section to the list of AutosSections.
190 AutosSections.push_back(FoundAutoSec);
191 }
192
193 // Insert the auto into this section.
194 FoundAutoSec->Items.push_back(GV);
195
196 return FoundAutoSec->S_;
197}
198
Sanjiv Guptaeb01aba2009-08-20 19:28:24 +0000199void PIC16TargetObjectFile::createClonedSectionForAutos(const std::string &SecName) {
200
201 // If the function is cloned then it will have ".IL" in its name
202 // If this function is not cloned then return;
203 if (SecName.find(".IL") == std::string::npos)
204 return;
205
206 // Come here if the function is cloned.
207 // Get the name of the original section from which it has been cloned.
208 std::string OrigName = SecName;
209 OrigName.replace(SecName.find(".IL"),3,"");
210
211 // Find original section
212 PIC16Section *FoundAutoSec = NULL;
213 for (unsigned i = 0; i < AutosSections.size(); i++) {
214 if (AutosSections[i]->S_->getName() == OrigName) {
215 FoundAutoSec = AutosSections[i];
216 break;
217 }
218 }
219
220 // No auto section exists for the original function.
221 if (!FoundAutoSec)
222 return;
223
224 // Create new section for the cloned function
225 const MCSectionPIC16 *NewSection =
226 getPIC16Section(SecName.c_str(), SectionKind::getMetadata());
227
228 PIC16Section *NewAutoSec = new PIC16Section(NewSection);
229 // Add this newly created autos section to the list of AutosSections.
230 AutosSections.push_back(NewAutoSec);
231
232 // Add the items from the original section to the new section
233 // Donot mangle them here. Because mangling them here will distort
234 // the original names.
235 // These names will be mangled them at the time of printing only
236 const std::vector<const GlobalVariable*> &Items = FoundAutoSec->Items;
237 for (unsigned j = 0; j < Items.size(); j++) {
238 NewAutoSec->Items.push_back(Items[j]);
239 }
240}
Chris Lattnerf0144122009-07-28 03:13:23 +0000241
242// Override default implementation to put the true globals into
243// multiple data sections if required.
Chris Lattnera87dea42009-07-31 18:48:30 +0000244const MCSection *
Chris Lattnerf0144122009-07-28 03:13:23 +0000245PIC16TargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV1,
Chris Lattnerf9650c02009-08-01 21:46:23 +0000246 SectionKind Kind,
Chris Lattnere53a6002009-07-29 05:09:30 +0000247 Mangler *Mang,
Chris Lattnerf0144122009-07-28 03:13:23 +0000248 const TargetMachine &TM) const {
249 // We select the section based on the initializer here, so it really
250 // has to be a GlobalVariable.
251 const GlobalVariable *GV = dyn_cast<GlobalVariable>(GV1);
252 if (!GV)
Chris Lattnerf9650c02009-08-01 21:46:23 +0000253 return TargetLoweringObjectFile::SelectSectionForGlobal(GV1, Kind, Mang,TM);
Chris Lattnerf0144122009-07-28 03:13:23 +0000254
255 // Record External Var Decls.
256 if (GV->isDeclaration()) {
257 ExternalVarDecls->Items.push_back(GV);
258 return ExternalVarDecls->S_;
259 }
260
261 assert(GV->hasInitializer() && "A def without initializer?");
262
263 // First, if this is an automatic variable for a function, get the section
264 // name for it and return.
265 std::string name = GV->getName();
266 if (PAN::isLocalName(name))
267 return getSectionForAuto(GV);
268
269 // Record Exteranl Var Defs.
270 if (GV->hasExternalLinkage() || GV->hasCommonLinkage())
271 ExternalVarDefs->Items.push_back(GV);
272
273 // See if this is an uninitialized global.
274 const Constant *C = GV->getInitializer();
275 if (C->isNullValue())
276 return getBSSSectionForGlobal(GV);
277
278 // If this is initialized data in RAM. Put it in the correct IDATA section.
279 if (GV->getType()->getAddressSpace() == PIC16ISD::RAM_SPACE)
280 return getIDATASectionForGlobal(GV);
281
282 // This is initialized data in rom, put it in the readonly section.
283 if (GV->getType()->getAddressSpace() == PIC16ISD::ROM_SPACE)
284 return getROSectionForGlobal(GV);
285
286 // Else let the default implementation take care of it.
Chris Lattnerf9650c02009-08-01 21:46:23 +0000287 return TargetLoweringObjectFile::SelectSectionForGlobal(GV, Kind, Mang,TM);
Chris Lattnerf0144122009-07-28 03:13:23 +0000288}
289
290PIC16TargetObjectFile::~PIC16TargetObjectFile() {
291 for (unsigned i = 0; i < BSSSections.size(); i++)
292 delete BSSSections[i];
293 for (unsigned i = 0; i < IDATASections.size(); i++)
294 delete IDATASections[i];
295 for (unsigned i = 0; i < AutosSections.size(); i++)
296 delete AutosSections[i];
297 for (unsigned i = 0; i < ROSections.size(); i++)
298 delete ROSections[i];
299 delete ExternalVarDecls;
300 delete ExternalVarDefs;
301}
302
303
304/// getSpecialCasedSectionGlobals - Allow the target to completely override
305/// section assignment of a global.
Chris Lattner24f654c2009-08-06 16:39:58 +0000306const MCSection *PIC16TargetObjectFile::
307getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
308 Mangler *Mang, const TargetMachine &TM) const {
309 assert(GV->hasSection());
310
311 if (const GlobalVariable *GVar = cast<GlobalVariable>(GV)) {
312 std::string SectName = GVar->getSection();
313 // If address for a variable is specified, get the address and create
314 // section.
315 std::string AddrStr = "Address=";
316 if (SectName.compare(0, AddrStr.length(), AddrStr) == 0) {
317 std::string SectAddr = SectName.substr(AddrStr.length());
318 return CreateSectionForGlobal(GVar, Mang, SectAddr);
Chris Lattnerf0144122009-07-28 03:13:23 +0000319 }
Chris Lattner24f654c2009-08-06 16:39:58 +0000320
321 // Create the section specified with section attribute.
322 return CreateSectionForGlobal(GVar, Mang);
Chris Lattnerf0144122009-07-28 03:13:23 +0000323 }
324
Chris Lattner93b6db32009-08-08 23:39:42 +0000325 return getPIC16Section(GV->getSection().c_str(), Kind);
Chris Lattnerf0144122009-07-28 03:13:23 +0000326}
327
328// Create a new section for global variable. If Addr is given then create
329// section at that address else create by name.
Chris Lattnera87dea42009-07-31 18:48:30 +0000330const MCSection *
Chris Lattnerf0144122009-07-28 03:13:23 +0000331PIC16TargetObjectFile::CreateSectionForGlobal(const GlobalVariable *GV,
Chris Lattnere53a6002009-07-29 05:09:30 +0000332 Mangler *Mang,
Chris Lattnerf0144122009-07-28 03:13:23 +0000333 const std::string &Addr) const {
334 // See if this is an uninitialized global.
335 const Constant *C = GV->getInitializer();
336 if (C->isNullValue())
337 return CreateBSSSectionForGlobal(GV, Addr);
338
339 // If this is initialized data in RAM. Put it in the correct IDATA section.
340 if (GV->getType()->getAddressSpace() == PIC16ISD::RAM_SPACE)
341 return CreateIDATASectionForGlobal(GV, Addr);
342
343 // This is initialized data in rom, put it in the readonly section.
344 if (GV->getType()->getAddressSpace() == PIC16ISD::ROM_SPACE)
345 return CreateROSectionForGlobal(GV, Addr);
346
347 // Else let the default implementation take care of it.
Chris Lattnera87dea42009-07-31 18:48:30 +0000348 return TargetLoweringObjectFile::SectionForGlobal(GV, Mang, *TM);
Chris Lattnerf0144122009-07-28 03:13:23 +0000349}
350
351// Create uninitialized section for a variable.
Chris Lattnera87dea42009-07-31 18:48:30 +0000352const MCSection *
Chris Lattnerf0144122009-07-28 03:13:23 +0000353PIC16TargetObjectFile::CreateBSSSectionForGlobal(const GlobalVariable *GV,
354 std::string Addr) const {
355 assert(GV->hasInitializer() && "This global doesn't need space");
356 assert(GV->getInitializer()->isNullValue() &&
357 "Unitialized global has non-zero initializer");
358 std::string Name;
359 // If address is given then create a section at that address else create a
360 // section by section name specified in GV.
361 PIC16Section *FoundBSS = NULL;
362 if (Addr.empty()) {
363 Name = GV->getSection() + " UDATA";
364 for (unsigned i = 0; i < BSSSections.size(); i++) {
365 if (BSSSections[i]->S_->getName() == Name) {
366 FoundBSS = BSSSections[i];
367 break;
368 }
369 }
370 } else {
371 std::string Prefix = GV->getNameStr() + "." + Addr + ".";
372 Name = PAN::getUdataSectionName(BSSSections.size(), Prefix) + " " + Addr;
373 }
374
375 PIC16Section *NewBSS = FoundBSS;
376 if (NewBSS == NULL) {
Chris Lattner93b6db32009-08-08 23:39:42 +0000377 const MCSectionPIC16 *NewSection =
378 getPIC16Section(Name.c_str(), SectionKind::getBSS());
Chris Lattnerf0144122009-07-28 03:13:23 +0000379 NewBSS = new PIC16Section(NewSection);
380 BSSSections.push_back(NewBSS);
381 }
382
383 // Insert the GV into this BSS.
384 NewBSS->Items.push_back(GV);
385
386 // We do not want to put any GV without explicit section into this section
387 // so set its size to DatabankSize.
388 NewBSS->Size = DataBankSize;
389 return NewBSS->S_;
390}
391
392// Get rom section for a variable. Currently there can be only one rom section
393// unless a variable explicitly requests a section.
Chris Lattnera87dea42009-07-31 18:48:30 +0000394const MCSection *
Chris Lattnerf0144122009-07-28 03:13:23 +0000395PIC16TargetObjectFile::getROSectionForGlobal(const GlobalVariable *GV) const {
396 ROSections[0]->Items.push_back(GV);
397 return ROSections[0]->S_;
398}
399
400// Create initialized data section for a variable.
Chris Lattnera87dea42009-07-31 18:48:30 +0000401const MCSection *
Chris Lattnerf0144122009-07-28 03:13:23 +0000402PIC16TargetObjectFile::CreateIDATASectionForGlobal(const GlobalVariable *GV,
403 std::string Addr) const {
404 assert(GV->hasInitializer() && "This global doesn't need space");
405 assert(!GV->getInitializer()->isNullValue() &&
406 "initialized global has zero initializer");
407 assert(GV->getType()->getAddressSpace() == PIC16ISD::RAM_SPACE &&
408 "can be used for initialized RAM data only");
409
410 std::string Name;
411 // If address is given then create a section at that address else create a
412 // section by section name specified in GV.
413 PIC16Section *FoundIDATASec = NULL;
414 if (Addr.empty()) {
415 Name = GV->getSection() + " IDATA";
416 for (unsigned i = 0; i < IDATASections.size(); i++) {
417 if (IDATASections[i]->S_->getName() == Name) {
418 FoundIDATASec = IDATASections[i];
419 break;
420 }
421 }
422 } else {
423 std::string Prefix = GV->getNameStr() + "." + Addr + ".";
424 Name = PAN::getIdataSectionName(IDATASections.size(), Prefix) + " " + Addr;
425 }
426
427 PIC16Section *NewIDATASec = FoundIDATASec;
428 if (NewIDATASec == NULL) {
Chris Lattner93b6db32009-08-08 23:39:42 +0000429 const MCSectionPIC16 *NewSection =
430 getPIC16Section(Name.c_str(), /* FIXME */SectionKind::getMetadata());
Chris Lattnerf0144122009-07-28 03:13:23 +0000431 NewIDATASec = new PIC16Section(NewSection);
432 IDATASections.push_back(NewIDATASec);
433 }
434 // Insert the GV into this IDATA Section.
435 NewIDATASec->Items.push_back(GV);
436 // We do not want to put any GV without explicit section into this section
437 // so set its size to DatabankSize.
438 NewIDATASec->Size = DataBankSize;
439 return NewIDATASec->S_;
440}
441
442// Create a section in rom for a variable.
Chris Lattnera87dea42009-07-31 18:48:30 +0000443const MCSection *
Chris Lattnerf0144122009-07-28 03:13:23 +0000444PIC16TargetObjectFile::CreateROSectionForGlobal(const GlobalVariable *GV,
445 std::string Addr) const {
446 assert(GV->getType()->getAddressSpace() == PIC16ISD::ROM_SPACE &&
447 "can be used for ROM data only");
448
449 std::string Name;
450 // If address is given then create a section at that address else create a
451 // section by section name specified in GV.
452 PIC16Section *FoundROSec = NULL;
453 if (Addr.empty()) {
454 Name = GV->getSection() + " ROMDATA";
455 for (unsigned i = 1; i < ROSections.size(); i++) {
456 if (ROSections[i]->S_->getName() == Name) {
457 FoundROSec = ROSections[i];
458 break;
459 }
460 }
461 } else {
462 std::string Prefix = GV->getNameStr() + "." + Addr + ".";
463 Name = PAN::getRomdataSectionName(ROSections.size(), Prefix) + " " + Addr;
464 }
465
466 PIC16Section *NewRomSec = FoundROSec;
467 if (NewRomSec == NULL) {
Chris Lattner93b6db32009-08-08 23:39:42 +0000468 const MCSectionPIC16 *NewSection =
469 getPIC16Section(Name.c_str(), SectionKind::getReadOnly());
Chris Lattnerf0144122009-07-28 03:13:23 +0000470 NewRomSec = new PIC16Section(NewSection);
471 ROSections.push_back(NewRomSec);
472 }
473
474 // Insert the GV into this ROM Section.
475 NewRomSec->Items.push_back(GV);
476 return NewRomSec->S_;
477}
478