blob: 1754ed309576de607ba7dd86006fa159a405f1ba [file] [log] [blame]
Chris Lattnereb72dca2010-07-11 22:05:00 +00001//===-- llvm/MC/WinCOFFStreamer.cpp -----------------------------*- C++ -*-===//
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 an implementation of a Win32 COFF object file streamer.
11//
12//===----------------------------------------------------------------------===//
13
14#define DEBUG_TYPE "WinCOFFStreamer"
15
16#include "llvm/MC/MCObjectStreamer.h"
17#include "llvm/MC/MCContext.h"
18#include "llvm/MC/MCSection.h"
19#include "llvm/MC/MCSymbol.h"
20#include "llvm/MC/MCExpr.h"
Michael J. Spencer8067adc2010-07-19 06:13:10 +000021#include "llvm/MC/MCValue.h"
22#include "llvm/MC/MCAssembler.h"
23#include "llvm/MC/MCAsmLayout.h"
Chris Lattnereb72dca2010-07-11 22:05:00 +000024#include "llvm/MC/MCCodeEmitter.h"
25#include "llvm/MC/MCSectionCOFF.h"
Michael J. Spencer8067adc2010-07-19 06:13:10 +000026#include "llvm/Target/TargetRegistry.h"
Chris Lattnereb72dca2010-07-11 22:05:00 +000027#include "llvm/Target/TargetAsmBackend.h"
Michael J. Spencer8067adc2010-07-19 06:13:10 +000028#include "llvm/ADT/StringMap.h"
29
Chris Lattnereb72dca2010-07-11 22:05:00 +000030#include "llvm/Support/COFF.h"
31#include "llvm/Support/Debug.h"
32#include "llvm/Support/ErrorHandling.h"
33#include "llvm/Support/raw_ostream.h"
34using namespace llvm;
35
Chris Lattnereb72dca2010-07-11 22:05:00 +000036namespace {
37class WinCOFFStreamer : public MCObjectStreamer {
38public:
Michael J. Spencer8067adc2010-07-19 06:13:10 +000039 MCSymbol const *CurSymbol;
40
Chris Lattnereb72dca2010-07-11 22:05:00 +000041 WinCOFFStreamer(MCContext &Context,
42 TargetAsmBackend &TAB,
43 MCCodeEmitter &CE,
44 raw_ostream &OS);
45
Michael J. Spencer8067adc2010-07-19 06:13:10 +000046 void AddCommonSymbol(MCSymbol *Symbol, uint64_t Size,
47 unsigned ByteAlignment, bool External);
48
Chris Lattnereb72dca2010-07-11 22:05:00 +000049 // MCStreamer interface
50
Rafael Espindolad80781b2010-09-15 21:48:40 +000051 virtual void InitSections();
Chris Lattnereb72dca2010-07-11 22:05:00 +000052 virtual void EmitAssemblerFlag(MCAssemblerFlag Flag);
Jim Grosbachce792992010-11-05 22:08:08 +000053 virtual void EmitThumbFunc(MCSymbol *Func);
Chris Lattnereb72dca2010-07-11 22:05:00 +000054 virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value);
55 virtual void EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute);
56 virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue);
57 virtual void BeginCOFFSymbolDef(MCSymbol const *Symbol);
58 virtual void EmitCOFFSymbolStorageClass(int StorageClass);
59 virtual void EmitCOFFSymbolType(int Type);
60 virtual void EndCOFFSymbolDef();
61 virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value);
62 virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
Michael J. Spencer8067adc2010-07-19 06:13:10 +000063 unsigned ByteAlignment);
Chris Lattnereb72dca2010-07-11 22:05:00 +000064 virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size);
65 virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol,
Michael J. Spencer8067adc2010-07-19 06:13:10 +000066 unsigned Size,unsigned ByteAlignment);
Chris Lattnereb72dca2010-07-11 22:05:00 +000067 virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
Michael J. Spencer8067adc2010-07-19 06:13:10 +000068 uint64_t Size, unsigned ByteAlignment);
Chris Lattnereb72dca2010-07-11 22:05:00 +000069 virtual void EmitBytes(StringRef Data, unsigned AddrSpace);
Michael J. Spencer8067adc2010-07-19 06:13:10 +000070 virtual void EmitValue(const MCExpr *Value, unsigned Size,
Chris Lattnereb72dca2010-07-11 22:05:00 +000071 unsigned AddrSpace);
Chris Lattnereb72dca2010-07-11 22:05:00 +000072 virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value,
Michael J. Spencer8067adc2010-07-19 06:13:10 +000073 unsigned ValueSize, unsigned MaxBytesToEmit);
Chris Lattnereb72dca2010-07-11 22:05:00 +000074 virtual void EmitCodeAlignment(unsigned ByteAlignment,
75 unsigned MaxBytesToEmit);
76 virtual void EmitValueToOffset(const MCExpr *Offset, unsigned char Value);
77 virtual void EmitFileDirective(StringRef Filename);
Chris Lattnereb72dca2010-07-11 22:05:00 +000078 virtual void EmitInstruction(const MCInst &Instruction);
79 virtual void Finish();
Michael J. Spencer192d1362010-10-09 15:44:27 +000080
81private:
Rafael Espindolaf89671d2010-11-01 16:27:31 +000082 virtual void EmitInstToFragment(const MCInst &Inst) {
83 llvm_unreachable("Not used by WinCOFF.");
84 }
85 virtual void EmitInstToData(const MCInst &Inst) {
86 llvm_unreachable("Not used by WinCOFF.");
87 }
88
Michael J. Spencer192d1362010-10-09 15:44:27 +000089 void SetSection(StringRef Section,
90 unsigned Characteristics,
91 SectionKind Kind) {
92 SwitchSection(getContext().getCOFFSection(Section, Characteristics, Kind));
93 }
94
95 void SetSectionText() {
96 SetSection(".text",
97 COFF::IMAGE_SCN_CNT_CODE
98 | COFF::IMAGE_SCN_MEM_EXECUTE
99 | COFF::IMAGE_SCN_MEM_READ,
100 SectionKind::getText());
101 EmitCodeAlignment(4, 0);
102 }
103
104 void SetSectionData() {
105 SetSection(".data",
106 COFF::IMAGE_SCN_CNT_INITIALIZED_DATA
107 | COFF::IMAGE_SCN_MEM_READ
108 | COFF::IMAGE_SCN_MEM_WRITE,
109 SectionKind::getDataRel());
110 EmitCodeAlignment(4, 0);
111 }
112
113 void SetSectionBSS() {
114 SetSection(".bss",
115 COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA
116 | COFF::IMAGE_SCN_MEM_READ
117 | COFF::IMAGE_SCN_MEM_WRITE,
118 SectionKind::getBSS());
119 EmitCodeAlignment(4, 0);
120 }
121
Chris Lattnereb72dca2010-07-11 22:05:00 +0000122};
123} // end anonymous namespace.
124
125WinCOFFStreamer::WinCOFFStreamer(MCContext &Context,
126 TargetAsmBackend &TAB,
127 MCCodeEmitter &CE,
128 raw_ostream &OS)
Rafael Espindola59ff3c92010-09-22 22:27:05 +0000129 : MCObjectStreamer(Context, TAB, OS, &CE, true)
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000130 , CurSymbol(NULL) {
131}
132
133void WinCOFFStreamer::AddCommonSymbol(MCSymbol *Symbol, uint64_t Size,
134 unsigned ByteAlignment, bool External) {
135 assert(!Symbol->isInSection() && "Symbol must not already have a section!");
136
137 std::string SectionName(".bss$linkonce");
138 SectionName.append(Symbol->getName().begin(), Symbol->getName().end());
139
140 MCSymbolData &SymbolData = getAssembler().getOrCreateSymbolData(*Symbol);
141
142 unsigned Characteristics =
143 COFF::IMAGE_SCN_LNK_COMDAT |
144 COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA |
145 COFF::IMAGE_SCN_MEM_READ |
146 COFF::IMAGE_SCN_MEM_WRITE;
147
148 int Selection = COFF::IMAGE_COMDAT_SELECT_LARGEST;
149
150 const MCSection *Section = MCStreamer::getContext().getCOFFSection(
151 SectionName, Characteristics, Selection, SectionKind::getBSS());
152
153 MCSectionData &SectionData = getAssembler().getOrCreateSectionData(*Section);
154
155 if (SectionData.getAlignment() < ByteAlignment)
156 SectionData.setAlignment(ByteAlignment);
157
158 SymbolData.setExternal(External);
159
160 Symbol->setSection(*Section);
161
162 if (ByteAlignment != 1)
163 new MCAlignFragment(ByteAlignment, 0, 0, ByteAlignment, &SectionData);
164
165 SymbolData.setFragment(new MCFillFragment(0, 0, Size, &SectionData));
Chris Lattnereb72dca2010-07-11 22:05:00 +0000166}
167
168// MCStreamer interface
169
Rafael Espindolad80781b2010-09-15 21:48:40 +0000170void WinCOFFStreamer::InitSections() {
Michael J. Spencer192d1362010-10-09 15:44:27 +0000171 SetSectionText();
172 SetSectionData();
173 SetSectionBSS();
174 SetSectionText();
Rafael Espindolad80781b2010-09-15 21:48:40 +0000175}
176
Chris Lattnereb72dca2010-07-11 22:05:00 +0000177void WinCOFFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000178 llvm_unreachable("not implemented");
Chris Lattnereb72dca2010-07-11 22:05:00 +0000179}
180
Jim Grosbachce792992010-11-05 22:08:08 +0000181void WinCOFFStreamer::EmitThumbFunc(MCSymbol *Func) {
182 llvm_unreachable("not implemented");
183}
184
Chris Lattnereb72dca2010-07-11 22:05:00 +0000185void WinCOFFStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
Michael J. Spencerd47f4a92010-10-09 11:00:37 +0000186 assert((Symbol->isInSection()
187 ? Symbol->getSection().getVariant() == MCSection::SV_COFF
188 : true) && "Got non COFF section in the COFF backend!");
Michael J. Spencerb5814a32010-10-07 06:29:33 +0000189 // FIXME: This is all very ugly and depressing. What needs to happen here
190 // depends on quite a few things that are all part of relaxation, which we
191 // don't really even do.
192
193 if (Value->getKind() != MCExpr::SymbolRef) {
NAKAMURA Takumi86c36472010-10-07 07:21:04 +0000194 // TODO: This is exactly the same as MachOStreamer. Consider merging into
195 // MCObjectStreamer.
196 getAssembler().getOrCreateSymbolData(*Symbol);
197 AddValueSymbols(Value);
Michael J. Spencerb5814a32010-10-07 06:29:33 +0000198 Symbol->setVariableValue(Value);
199 } else {
200 // FIXME: This is a horrible way to do this :(. This should really be
201 // handled after we are done with the MC* objects and immediately before
202 // writing out the object file when we know exactly what the symbol should
203 // look like in the coff symbol table. I'm not doing that now because the
204 // COFF object writer doesn't have a clearly defined separation between MC
205 // data structures, the object writers data structures, and the raw, POD,
206 // data structures that get written to disk.
207
208 // Copy over the aliased data.
209 MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol);
210 const MCSymbolData &RealSD = getAssembler().getOrCreateSymbolData(
211 dyn_cast<const MCSymbolRefExpr>(Value)->getSymbol());
212
213 // FIXME: This is particularly nasty because it breaks as soon as any data
214 // members of MCSymbolData change.
215 SD.CommonAlign = RealSD.CommonAlign;
216 SD.CommonSize = RealSD.CommonSize;
217 SD.Flags = RealSD.Flags;
218 SD.Fragment = RealSD.Fragment;
219 SD.Index = RealSD.Index;
220 SD.IsExternal = RealSD.IsExternal;
221 SD.IsPrivateExtern = RealSD.IsPrivateExtern;
222 SD.Offset = RealSD.Offset;
223 SD.SymbolSize = RealSD.SymbolSize;
224 }
Chris Lattnereb72dca2010-07-11 22:05:00 +0000225}
226
227void WinCOFFStreamer::EmitSymbolAttribute(MCSymbol *Symbol,
228 MCSymbolAttr Attribute) {
Michael J. Spencerd47f4a92010-10-09 11:00:37 +0000229 assert(Symbol && "Symbol must be non-null!");
230 assert((Symbol->isInSection()
231 ? Symbol->getSection().getVariant() == MCSection::SV_COFF
232 : true) && "Got non COFF section in the COFF backend!");
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000233 switch (Attribute) {
234 case MCSA_WeakReference:
Michael J. Spencer4cee2892010-10-16 08:25:57 +0000235 case MCSA_Weak: {
236 MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol);
237 SD.modifyFlags(COFF::SF_WeakExternal, COFF::SF_WeakExternal);
238 SD.setExternal(true);
239 }
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000240 break;
241
242 case MCSA_Global:
243 getAssembler().getOrCreateSymbolData(*Symbol).setExternal(true);
244 break;
245
246 default:
247 llvm_unreachable("unsupported attribute");
248 break;
249 }
Chris Lattnereb72dca2010-07-11 22:05:00 +0000250}
251
252void WinCOFFStreamer::EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000253 llvm_unreachable("not implemented");
Chris Lattnereb72dca2010-07-11 22:05:00 +0000254}
255
256void WinCOFFStreamer::BeginCOFFSymbolDef(MCSymbol const *Symbol) {
Michael J. Spencerd47f4a92010-10-09 11:00:37 +0000257 assert((Symbol->isInSection()
258 ? Symbol->getSection().getVariant() == MCSection::SV_COFF
259 : true) && "Got non COFF section in the COFF backend!");
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000260 assert(CurSymbol == NULL && "EndCOFFSymbolDef must be called between calls "
261 "to BeginCOFFSymbolDef!");
262 CurSymbol = Symbol;
Chris Lattnereb72dca2010-07-11 22:05:00 +0000263}
264
265void WinCOFFStreamer::EmitCOFFSymbolStorageClass(int StorageClass) {
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000266 assert(CurSymbol != NULL && "BeginCOFFSymbolDef must be called first!");
267 assert((StorageClass & ~0xFF) == 0 && "StorageClass must only have data in "
268 "the first byte!");
269
270 getAssembler().getOrCreateSymbolData(*CurSymbol).modifyFlags(
271 StorageClass << COFF::SF_ClassShift,
272 COFF::SF_ClassMask);
Chris Lattnereb72dca2010-07-11 22:05:00 +0000273}
274
275void WinCOFFStreamer::EmitCOFFSymbolType(int Type) {
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000276 assert(CurSymbol != NULL && "BeginCOFFSymbolDef must be called first!");
277 assert((Type & ~0xFFFF) == 0 && "Type must only have data in the first 2 "
278 "bytes");
279
280 getAssembler().getOrCreateSymbolData(*CurSymbol).modifyFlags(
281 Type << COFF::SF_TypeShift,
282 COFF::SF_TypeMask);
Chris Lattnereb72dca2010-07-11 22:05:00 +0000283}
284
285void WinCOFFStreamer::EndCOFFSymbolDef() {
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000286 assert(CurSymbol != NULL && "BeginCOFFSymbolDef must be called first!");
287 CurSymbol = NULL;
Chris Lattnereb72dca2010-07-11 22:05:00 +0000288}
289
290void WinCOFFStreamer::EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) {
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000291 llvm_unreachable("not implemented");
Chris Lattnereb72dca2010-07-11 22:05:00 +0000292}
293
294void WinCOFFStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000295 unsigned ByteAlignment) {
Michael J. Spencerd47f4a92010-10-09 11:00:37 +0000296 assert((Symbol->isInSection()
297 ? Symbol->getSection().getVariant() == MCSection::SV_COFF
298 : true) && "Got non COFF section in the COFF backend!");
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000299 AddCommonSymbol(Symbol, Size, ByteAlignment, true);
Chris Lattnereb72dca2010-07-11 22:05:00 +0000300}
301
302void WinCOFFStreamer::EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size) {
Michael J. Spencerd47f4a92010-10-09 11:00:37 +0000303 assert((Symbol->isInSection()
304 ? Symbol->getSection().getVariant() == MCSection::SV_COFF
305 : true) && "Got non COFF section in the COFF backend!");
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000306 AddCommonSymbol(Symbol, Size, 1, false);
Chris Lattnereb72dca2010-07-11 22:05:00 +0000307}
308
309void WinCOFFStreamer::EmitZerofill(const MCSection *Section, MCSymbol *Symbol,
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000310 unsigned Size,unsigned ByteAlignment) {
311 llvm_unreachable("not implemented");
Chris Lattnereb72dca2010-07-11 22:05:00 +0000312}
313
314void WinCOFFStreamer::EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
315 uint64_t Size, unsigned ByteAlignment) {
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000316 llvm_unreachable("not implemented");
Chris Lattnereb72dca2010-07-11 22:05:00 +0000317}
318
319void WinCOFFStreamer::EmitBytes(StringRef Data, unsigned AddrSpace) {
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000320 // TODO: This is copied exactly from the MachOStreamer. Consider merging into
321 // MCObjectStreamer?
322 getOrCreateDataFragment()->getContents().append(Data.begin(), Data.end());
Chris Lattnereb72dca2010-07-11 22:05:00 +0000323}
324
325void WinCOFFStreamer::EmitValue(const MCExpr *Value, unsigned Size,
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000326 unsigned AddrSpace) {
327 assert(AddrSpace == 0 && "Address space must be 0!");
328
329 // TODO: This is copied exactly from the MachOStreamer. Consider merging into
330 // MCObjectStreamer?
331 MCDataFragment *DF = getOrCreateDataFragment();
332
333 // Avoid fixups when possible.
334 int64_t AbsValue;
335 if (AddValueSymbols(Value)->EvaluateAsAbsolute(AbsValue)) {
336 // FIXME: Endianness assumption.
337 for (unsigned i = 0; i != Size; ++i)
338 DF->getContents().push_back(uint8_t(AbsValue >> (i * 8)));
339 } else {
340 DF->addFixup(MCFixup::Create(DF->getContents().size(),
341 AddValueSymbols(Value),
Rafael Espindolae04ed7e2010-11-28 14:17:56 +0000342 MCFixup::getKindForSize(Size, false)));
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000343 DF->getContents().resize(DF->getContents().size() + Size, 0);
344 }
Chris Lattnereb72dca2010-07-11 22:05:00 +0000345}
346
Chris Lattnereb72dca2010-07-11 22:05:00 +0000347void WinCOFFStreamer::EmitValueToAlignment(unsigned ByteAlignment,
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000348 int64_t Value,
349 unsigned ValueSize,
350 unsigned MaxBytesToEmit) {
351 // TODO: This is copied exactly from the MachOStreamer. Consider merging into
352 // MCObjectStreamer?
353 if (MaxBytesToEmit == 0)
354 MaxBytesToEmit = ByteAlignment;
355 new MCAlignFragment(ByteAlignment, Value, ValueSize, MaxBytesToEmit,
356 getCurrentSectionData());
357
358 // Update the maximum alignment on the current section if necessary.
359 if (ByteAlignment > getCurrentSectionData()->getAlignment())
360 getCurrentSectionData()->setAlignment(ByteAlignment);
Chris Lattnereb72dca2010-07-11 22:05:00 +0000361}
362
363void WinCOFFStreamer::EmitCodeAlignment(unsigned ByteAlignment,
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000364 unsigned MaxBytesToEmit) {
365 // TODO: This is copied exactly from the MachOStreamer. Consider merging into
366 // MCObjectStreamer?
367 if (MaxBytesToEmit == 0)
368 MaxBytesToEmit = ByteAlignment;
369 MCAlignFragment *F = new MCAlignFragment(ByteAlignment, 0, 1, MaxBytesToEmit,
370 getCurrentSectionData());
371 F->setEmitNops(true);
372
373 // Update the maximum alignment on the current section if necessary.
374 if (ByteAlignment > getCurrentSectionData()->getAlignment())
375 getCurrentSectionData()->setAlignment(ByteAlignment);
Chris Lattnereb72dca2010-07-11 22:05:00 +0000376}
377
378void WinCOFFStreamer::EmitValueToOffset(const MCExpr *Offset,
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000379 unsigned char Value) {
380 llvm_unreachable("not implemented");
Chris Lattnereb72dca2010-07-11 22:05:00 +0000381}
382
383void WinCOFFStreamer::EmitFileDirective(StringRef Filename) {
384 // Ignore for now, linkers don't care, and proper debug
385 // info will be a much large effort.
386}
387
Chris Lattnereb72dca2010-07-11 22:05:00 +0000388void WinCOFFStreamer::EmitInstruction(const MCInst &Instruction) {
Michael J. Spencer8067adc2010-07-19 06:13:10 +0000389 for (unsigned i = 0, e = Instruction.getNumOperands(); i != e; ++i)
390 if (Instruction.getOperand(i).isExpr())
391 AddValueSymbols(Instruction.getOperand(i).getExpr());
392
393 getCurrentSectionData()->setHasInstructions(true);
394
395 MCInstFragment *Fragment =
396 new MCInstFragment(Instruction, getCurrentSectionData());
397
398 raw_svector_ostream VecOS(Fragment->getCode());
399
400 getAssembler().getEmitter().EncodeInstruction(Instruction, VecOS,
401 Fragment->getFixups());
Chris Lattnereb72dca2010-07-11 22:05:00 +0000402}
403
404void WinCOFFStreamer::Finish() {
405 MCObjectStreamer::Finish();
406}
407
408namespace llvm
409{
410 MCStreamer *createWinCOFFStreamer(MCContext &Context,
411 TargetAsmBackend &TAB,
412 MCCodeEmitter &CE,
Michael J. Spencere2195d82010-07-31 06:22:29 +0000413 raw_ostream &OS,
414 bool RelaxAll) {
415 WinCOFFStreamer *S = new WinCOFFStreamer(Context, TAB, CE, OS);
416 S->getAssembler().setRelaxAll(RelaxAll);
417 return S;
Chris Lattnereb72dca2010-07-11 22:05:00 +0000418 }
419}