blob: fedb0b82ca3a290e186d77d8dc9e9f5cf3a14182 [file] [log] [blame]
Sanjiv Gupta09bb4202008-05-13 09:02:57 +00001//===-- PIC16TargetAsmInfo.cpp - PIC16 asm properties ---------------------===//
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// This file contains the declarations of the PIC16TargetAsmInfo properties.
11//
12//===----------------------------------------------------------------------===//
13
14#include "PIC16TargetAsmInfo.h"
Dan Gohmana004d7b2008-11-03 18:22:42 +000015#include "PIC16TargetMachine.h"
Sanjiv Gupta4affaea2009-01-13 19:18:47 +000016#include "llvm/GlobalValue.h"
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +000017#include "llvm/GlobalVariable.h"
18#include "llvm/DerivedTypes.h"
Sanjiv Gupta09bb4202008-05-13 09:02:57 +000019
20using namespace llvm;
21
22PIC16TargetAsmInfo::
Sanjiv Gupta085ae4f2008-11-19 11:00:54 +000023PIC16TargetAsmInfo(const PIC16TargetMachine &TM)
Dan Gohmana004d7b2008-11-03 18:22:42 +000024 : TargetAsmInfo(TM) {
Sanjiv Gupta09bb4202008-05-13 09:02:57 +000025 CommentString = ";";
Sanjiv Guptaca549b72009-05-10 05:23:47 +000026 GlobalPrefix = PAN::getTagName(PAN::PREFIX_SYMBOL);
27 GlobalDirective = "\tglobal\t";
28 ExternDirective = "\textern\t";
29
Sanjiv Gupta085ae4f2008-11-19 11:00:54 +000030 Data8bitsDirective = " db ";
Sanjiv Guptadc2943d2009-01-30 04:25:10 +000031 Data16bitsDirective = " dw ";
32 Data32bitsDirective = " dl ";
Sanjiv Gupta9197df22009-07-06 18:09:11 +000033 Data64bitsDirective = NULL;
Sanjiv Guptadc2943d2009-01-30 04:25:10 +000034 RomData8bitsDirective = " dw ";
35 RomData16bitsDirective = " rom_di ";
Sanjiv Gupta46fc9fe2009-02-02 16:53:06 +000036 RomData32bitsDirective = " rom_dl ";
Sanjiv Gupta085ae4f2008-11-19 11:00:54 +000037 ZeroDirective = NULL;
Sanjiv Gupta4affaea2009-01-13 19:18:47 +000038 AsciiDirective = " dt ";
39 AscizDirective = NULL;
40 BSSSection_ = getNamedSection("udata.# UDATA",
41 SectionFlags::Writeable | SectionFlags::BSS);
42 ReadOnlySection = getNamedSection("romdata.# ROMDATA", SectionFlags::None);
43 DataSection = getNamedSection("idata.# IDATA", SectionFlags::Writeable);
44 SwitchToSectionDirective = "";
Sanjiv Gupta1a94cdc2009-04-08 06:24:04 +000045 // Need because otherwise a .text symbol is emitted by DwarfWriter
46 // in BeginModule, and gpasm cribbs for that .text symbol.
47 TextSection = getUnnamedSection("", SectionFlags::Code);
Sanjiv Guptabb399cf2009-07-06 10:18:37 +000048 PIC16Section *ROSection = new PIC16Section(getReadOnlySection());
49 ROSections.push_back(ROSection);
Sanjiv Gupta5ade9e82009-05-13 15:13:17 +000050 ExternalVarDecls = new PIC16Section(getNamedSection("ExternalVarDecls"));
51 ExternalVarDefs = new PIC16Section(getNamedSection("ExternalVarDefs"));
Sanjiv Gupta14eba042009-05-28 18:24:11 +000052 // Set it to false because we weed to generate c file name and not bc file
53 // name.
54 HasSingleParameterDotFile = false;
Sanjiv Gupta09bb4202008-05-13 09:02:57 +000055}
Sanjiv Guptadc2943d2009-01-30 04:25:10 +000056
Chris Lattnerc8859c52009-07-20 17:12:46 +000057const char *PIC16TargetAsmInfo::getRomDirective(unsigned Size) const {
58 switch (Size) {
59 case 8: return RomData8bitsDirective;
60 case 16: return RomData16bitsDirective;
61 case 32: return RomData32bitsDirective;
62 default: return NULL;
63 }
Sanjiv Gupta46fc9fe2009-02-02 16:53:06 +000064}
Sanjiv Guptadc2943d2009-01-30 04:25:10 +000065
Sanjiv Guptadc2943d2009-01-30 04:25:10 +000066
Chris Lattnerc8859c52009-07-20 17:12:46 +000067const char *PIC16TargetAsmInfo::
68getDataASDirective(unsigned Size, unsigned AS) const {
Sanjiv Gupta46fc9fe2009-02-02 16:53:06 +000069 if (AS == PIC16ISD::ROM_SPACE)
Chris Lattnerc8859c52009-07-20 17:12:46 +000070 return getRomDirective(Size);
71 return NULL;
Sanjiv Gupta46fc9fe2009-02-02 16:53:06 +000072}
Sanjiv Guptadc2943d2009-01-30 04:25:10 +000073
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +000074const Section *
75PIC16TargetAsmInfo::getBSSSectionForGlobal(const GlobalVariable *GV) const {
Chris Lattner4b4c52d2009-07-21 17:20:18 +000076 assert(GV->hasInitializer() && "This global doesn't need space");
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +000077 Constant *C = GV->getInitializer();
Chris Lattner4b4c52d2009-07-21 17:20:18 +000078 assert(C->isNullValue() && "Unitialized globals has non-zero initializer");
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +000079
80 // Find how much space this global needs.
81 const TargetData *TD = TM.getTargetData();
82 const Type *Ty = C->getType();
Duncan Sandsec4f97d2009-05-09 07:06:46 +000083 unsigned ValSize = TD->getTypeAllocSize(Ty);
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +000084
85 // Go through all BSS Sections and assign this variable
86 // to the first available section having enough space.
87 PIC16Section *FoundBSS = NULL;
88 for (unsigned i = 0; i < BSSSections.size(); i++) {
89 if (DataBankSize - BSSSections[i]->Size >= ValSize) {
90 FoundBSS = BSSSections[i];
91 break;
92 }
93 }
94
95 // No BSS section spacious enough was found. Crate a new one.
Chris Lattner4b4c52d2009-07-21 17:20:18 +000096 if (!FoundBSS) {
Sanjiv Guptaca549b72009-05-10 05:23:47 +000097 std::string name = PAN::getUdataSectionName(BSSSections.size());
Chris Lattner4b4c52d2009-07-21 17:20:18 +000098 const Section *NewSection = getNamedSection(name.c_str());
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +000099
100 FoundBSS = new PIC16Section(NewSection);
101
102 // Add this newly created BSS section to the list of BSSSections.
103 BSSSections.push_back(FoundBSS);
104 }
105
106 // Insert the GV into this BSS.
107 FoundBSS->Items.push_back(GV);
108 FoundBSS->Size += ValSize;
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000109 return FoundBSS->S_;
110}
111
112const Section *
113PIC16TargetAsmInfo::getIDATASectionForGlobal(const GlobalVariable *GV) const {
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000114 assert(GV->hasInitializer() && "This global doesn't need space");
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000115 Constant *C = GV->getInitializer();
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000116 assert(!C->isNullValue() && "initialized globals has zero initializer");
117 assert(GV->getType()->getAddressSpace() == PIC16ISD::RAM_SPACE &&
118 "can split initialized RAM data only");
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000119
120 // Find how much space this global needs.
121 const TargetData *TD = TM.getTargetData();
122 const Type *Ty = C->getType();
Duncan Sandsec4f97d2009-05-09 07:06:46 +0000123 unsigned ValSize = TD->getTypeAllocSize(Ty);
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000124
125 // Go through all IDATA Sections and assign this variable
126 // to the first available section having enough space.
127 PIC16Section *FoundIDATA = NULL;
128 for (unsigned i = 0; i < IDATASections.size(); i++) {
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000129 if (DataBankSize - IDATASections[i]->Size >= ValSize) {
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000130 FoundIDATA = IDATASections[i];
131 break;
132 }
133 }
134
135 // No IDATA section spacious enough was found. Crate a new one.
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000136 if (!FoundIDATA) {
Sanjiv Guptaca549b72009-05-10 05:23:47 +0000137 std::string name = PAN::getIdataSectionName(IDATASections.size());
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000138 const Section *NewSection = getNamedSection(name.c_str());
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000139
140 FoundIDATA = new PIC16Section(NewSection);
141
142 // Add this newly created IDATA section to the list of IDATASections.
143 IDATASections.push_back(FoundIDATA);
144 }
145
146 // Insert the GV into this IDATA.
147 FoundIDATA->Items.push_back(GV);
148 FoundIDATA->Size += ValSize;
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000149 return FoundIDATA->S_;
150}
151
Sanjiv Guptadbe79112009-05-12 17:07:27 +0000152// Get the section for an automatic variable of a function.
153// For PIC16 they are globals only with mangled names.
154const Section *
155PIC16TargetAsmInfo::getSectionForAuto(const GlobalVariable *GV) const {
156
157 const std::string name = PAN::getSectionNameForSym(GV->getName());
158
159 // Go through all Auto Sections and assign this variable
160 // to the appropriate section.
161 PIC16Section *FoundAutoSec = NULL;
162 for (unsigned i = 0; i < AutosSections.size(); i++) {
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000163 if (AutosSections[i]->S_->getName() == name) {
Sanjiv Guptadbe79112009-05-12 17:07:27 +0000164 FoundAutoSec = AutosSections[i];
165 break;
166 }
167 }
168
169 // No Auto section was found. Crate a new one.
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000170 if (!FoundAutoSec) {
171 const Section *NewSection = getNamedSection(name.c_str());
Sanjiv Guptadbe79112009-05-12 17:07:27 +0000172
173 FoundAutoSec = new PIC16Section(NewSection);
174
175 // Add this newly created autos section to the list of AutosSections.
176 AutosSections.push_back(FoundAutoSec);
177 }
178
179 // Insert the auto into this section.
180 FoundAutoSec->Items.push_back(GV);
181
182 return FoundAutoSec->S_;
183}
184
185
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000186// Override default implementation to put the true globals into
187// multiple data sections if required.
188const Section*
189PIC16TargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV1) const {
190 // We select the section based on the initializer here, so it really
191 // has to be a GlobalVariable.
Sanjiv Guptaca549b72009-05-10 05:23:47 +0000192 const GlobalVariable *GV = dyn_cast<GlobalVariable>(GV1);
Sanjiv Gupta5ade9e82009-05-13 15:13:17 +0000193 if (!GV)
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000194 return TargetAsmInfo::SelectSectionForGlobal(GV1);
195
Sanjiv Gupta5ade9e82009-05-13 15:13:17 +0000196 // Record Exteranl Var Decls.
197 if (GV->isDeclaration()) {
198 ExternalVarDecls->Items.push_back(GV);
199 return ExternalVarDecls->S_;
200 }
201
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000202 assert(GV->hasInitializer() && "A def without initializer?");
Sanjiv Gupta5ade9e82009-05-13 15:13:17 +0000203
Sanjiv Guptaca549b72009-05-10 05:23:47 +0000204 // First, if this is an automatic variable for a function, get the section
205 // name for it and return.
Chris Lattner0ad34562009-07-24 18:34:27 +0000206 std::string name = GV->getName();
207 if (PAN::isLocalName(name))
Sanjiv Guptadbe79112009-05-12 17:07:27 +0000208 return getSectionForAuto(GV);
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000209
Sanjiv Gupta5ade9e82009-05-13 15:13:17 +0000210 // Record Exteranl Var Defs.
Chris Lattner0ad34562009-07-24 18:34:27 +0000211 if (GV->hasExternalLinkage() || GV->hasCommonLinkage())
Sanjiv Gupta5ade9e82009-05-13 15:13:17 +0000212 ExternalVarDefs->Items.push_back(GV);
Sanjiv Gupta5ade9e82009-05-13 15:13:17 +0000213
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000214 // See if this is an uninitialized global.
Sanjiv Guptaca549b72009-05-10 05:23:47 +0000215 const Constant *C = GV->getInitializer();
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000216 if (C->isNullValue())
217 return getBSSSectionForGlobal(GV);
218
Sanjiv Guptadbe79112009-05-12 17:07:27 +0000219 // If this is initialized data in RAM. Put it in the correct IDATA section.
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000220 if (GV->getType()->getAddressSpace() == PIC16ISD::RAM_SPACE)
221 return getIDATASectionForGlobal(GV);
222
Sanjiv Guptadbe79112009-05-12 17:07:27 +0000223 // This is initialized data in rom, put it in the readonly section.
Sanjiv Guptabb399cf2009-07-06 10:18:37 +0000224 if (GV->getType()->getAddressSpace() == PIC16ISD::ROM_SPACE)
225 return getROSectionForGlobal(GV);
Sanjiv Guptadbe79112009-05-12 17:07:27 +0000226
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000227 // Else let the default implementation take care of it.
228 return TargetAsmInfo::SelectSectionForGlobal(GV);
229}
230
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000231PIC16TargetAsmInfo::~PIC16TargetAsmInfo() {
Chris Lattner523f3bc2009-07-20 22:23:48 +0000232 for (unsigned i = 0; i < BSSSections.size(); i++)
233 delete BSSSections[i];
234 for (unsigned i = 0; i < IDATASections.size(); i++)
235 delete IDATASections[i];
236 for (unsigned i = 0; i < AutosSections.size(); i++)
237 delete AutosSections[i];
238 for (unsigned i = 0; i < ROSections.size(); i++)
239 delete ROSections[i];
Sanjiv Gupta5ade9e82009-05-13 15:13:17 +0000240 delete ExternalVarDecls;
241 delete ExternalVarDefs;
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +0000242}
Sanjiv Guptabb399cf2009-07-06 10:18:37 +0000243
Chris Lattner0ad34562009-07-24 18:34:27 +0000244
245/// getSpecialCasedSectionGlobals - Allow the target to completely override
246/// section assignment of a global.
247const Section *
248PIC16TargetAsmInfo::getSpecialCasedSectionGlobals(const GlobalValue *GV,
249 SectionKind::Kind Kind) const{
Sanjiv Guptabb399cf2009-07-06 10:18:37 +0000250 // If GV has a sectin name or section address create that section now.
251 if (GV->hasSection()) {
Chris Lattnerb3889492009-07-24 17:13:27 +0000252 if (const GlobalVariable *GVar = cast<GlobalVariable>(GV)) {
253 std::string SectName = GVar->getSection();
254 // If address for a variable is specified, get the address and create
255 // section.
256 std::string AddrStr = "Address=";
257 if (SectName.compare(0, AddrStr.length(), AddrStr) == 0) {
258 std::string SectAddr = SectName.substr(AddrStr.length());
259 return CreateSectionForGlobal(GVar, SectAddr);
260 }
Chris Lattner4fe5e142009-07-24 04:59:43 +0000261 }
Sanjiv Guptabb399cf2009-07-06 10:18:37 +0000262 }
Chris Lattner0ad34562009-07-24 18:34:27 +0000263
264 return 0;
Sanjiv Guptabb399cf2009-07-06 10:18:37 +0000265}
266
267// Create a new section for global variable. If Addr is given then create
268// section at that address else create by name.
269const Section *
Chris Lattnerb3889492009-07-24 17:13:27 +0000270PIC16TargetAsmInfo::CreateSectionForGlobal(const GlobalVariable *GV,
271 const std::string &Addr) const {
Sanjiv Guptabb399cf2009-07-06 10:18:37 +0000272 // See if this is an uninitialized global.
273 const Constant *C = GV->getInitializer();
274 if (C->isNullValue())
275 return CreateBSSSectionForGlobal(GV, Addr);
276
277 // If this is initialized data in RAM. Put it in the correct IDATA section.
278 if (GV->getType()->getAddressSpace() == PIC16ISD::RAM_SPACE)
279 return CreateIDATASectionForGlobal(GV, Addr);
280
281 // This is initialized data in rom, put it in the readonly section.
282 if (GV->getType()->getAddressSpace() == PIC16ISD::ROM_SPACE)
283 return CreateROSectionForGlobal(GV, Addr);
284
285 // Else let the default implementation take care of it.
286 return TargetAsmInfo::SectionForGlobal(GV);
287}
288
289// Create uninitialized section for a variable.
290const Section *
291PIC16TargetAsmInfo::CreateBSSSectionForGlobal(const GlobalVariable *GV,
292 std::string Addr) const {
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000293 assert(GV->hasInitializer() && "This global doesn't need space");
294 assert(GV->getInitializer()->isNullValue() &&
295 "Unitialized global has non-zero initializer");
Sanjiv Guptabb399cf2009-07-06 10:18:37 +0000296 std::string Name;
297 // If address is given then create a section at that address else create a
298 // section by section name specified in GV.
299 PIC16Section *FoundBSS = NULL;
300 if (Addr.empty()) {
301 Name = GV->getSection() + " UDATA";
302 for (unsigned i = 0; i < BSSSections.size(); i++) {
303 if (BSSSections[i]->S_->getName() == Name) {
304 FoundBSS = BSSSections[i];
305 break;
306 }
307 }
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000308 } else {
Daniel Dunbar1e13b972009-07-24 08:24:36 +0000309 std::string Prefix = GV->getNameStr() + "." + Addr + ".";
Sanjiv Guptabb399cf2009-07-06 10:18:37 +0000310 Name = PAN::getUdataSectionName(BSSSections.size(), Prefix) + " " + Addr;
311 }
312
313 PIC16Section *NewBSS = FoundBSS;
314 if (NewBSS == NULL) {
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000315 const Section *NewSection = getNamedSection(Name.c_str());
Sanjiv Guptabb399cf2009-07-06 10:18:37 +0000316 NewBSS = new PIC16Section(NewSection);
317 BSSSections.push_back(NewBSS);
318 }
319
320 // Insert the GV into this BSS.
321 NewBSS->Items.push_back(GV);
322
323 // We do not want to put any GV without explicit section into this section
324 // so set its size to DatabankSize.
325 NewBSS->Size = DataBankSize;
326 return NewBSS->S_;
327}
328
329// Get rom section for a variable. Currently there can be only one rom section
330// unless a variable explicitly requests a section.
331const Section *
332PIC16TargetAsmInfo::getROSectionForGlobal(const GlobalVariable *GV) const {
333 ROSections[0]->Items.push_back(GV);
334 return ROSections[0]->S_;
335}
336
337// Create initialized data section for a variable.
338const Section *
339PIC16TargetAsmInfo::CreateIDATASectionForGlobal(const GlobalVariable *GV,
340 std::string Addr) const {
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000341 assert(GV->hasInitializer() && "This global doesn't need space");
342 assert(!GV->getInitializer()->isNullValue() &&
343 "initialized global has zero initializer");
344 assert(GV->getType()->getAddressSpace() == PIC16ISD::RAM_SPACE &&
345 "can be used for initialized RAM data only");
Sanjiv Guptabb399cf2009-07-06 10:18:37 +0000346
347 std::string Name;
348 // If address is given then create a section at that address else create a
349 // section by section name specified in GV.
350 PIC16Section *FoundIDATASec = NULL;
351 if (Addr.empty()) {
352 Name = GV->getSection() + " IDATA";
353 for (unsigned i = 0; i < IDATASections.size(); i++) {
354 if (IDATASections[i]->S_->getName() == Name) {
355 FoundIDATASec = IDATASections[i];
356 break;
357 }
358 }
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000359 } else {
Daniel Dunbar1e13b972009-07-24 08:24:36 +0000360 std::string Prefix = GV->getNameStr() + "." + Addr + ".";
Sanjiv Guptabb399cf2009-07-06 10:18:37 +0000361 Name = PAN::getIdataSectionName(IDATASections.size(), Prefix) + " " + Addr;
362 }
363
364 PIC16Section *NewIDATASec = FoundIDATASec;
365 if (NewIDATASec == NULL) {
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000366 const Section *NewSection = getNamedSection(Name.c_str());
Sanjiv Guptabb399cf2009-07-06 10:18:37 +0000367 NewIDATASec = new PIC16Section(NewSection);
368 IDATASections.push_back(NewIDATASec);
369 }
370 // Insert the GV into this IDATA Section.
371 NewIDATASec->Items.push_back(GV);
372 // We do not want to put any GV without explicit section into this section
373 // so set its size to DatabankSize.
374 NewIDATASec->Size = DataBankSize;
375 return NewIDATASec->S_;
376}
377
378// Create a section in rom for a variable.
379const Section *
380PIC16TargetAsmInfo::CreateROSectionForGlobal(const GlobalVariable *GV,
381 std::string Addr) const {
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000382 assert(GV->getType()->getAddressSpace() == PIC16ISD::ROM_SPACE &&
383 "can be used for ROM data only");
Sanjiv Guptabb399cf2009-07-06 10:18:37 +0000384
385 std::string Name;
386 // If address is given then create a section at that address else create a
387 // section by section name specified in GV.
388 PIC16Section *FoundROSec = NULL;
389 if (Addr.empty()) {
390 Name = GV->getSection() + " ROMDATA";
391 for (unsigned i = 1; i < ROSections.size(); i++) {
392 if (ROSections[i]->S_->getName() == Name) {
393 FoundROSec = ROSections[i];
394 break;
395 }
396 }
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000397 } else {
Daniel Dunbar1e13b972009-07-24 08:24:36 +0000398 std::string Prefix = GV->getNameStr() + "." + Addr + ".";
Sanjiv Guptabb399cf2009-07-06 10:18:37 +0000399 Name = PAN::getRomdataSectionName(ROSections.size(), Prefix) + " " + Addr;
400 }
401
402 PIC16Section *NewRomSec = FoundROSec;
403 if (NewRomSec == NULL) {
Chris Lattner4b4c52d2009-07-21 17:20:18 +0000404 const Section *NewSection = getNamedSection(Name.c_str());
Sanjiv Guptabb399cf2009-07-06 10:18:37 +0000405 NewRomSec = new PIC16Section(NewSection);
406 ROSections.push_back(NewRomSec);
407 }
408
409 // Insert the GV into this ROM Section.
410 NewRomSec->Items.push_back(GV);
411 return NewRomSec->S_;
412}
413