Go to the documentation of this file.
94 size_t End = Buf.find(
'\n');
95 Buf = (End == Buf.npos) ?
"" : Buf.drop_front(End);
99 Buf = Buf.drop_front();
100 if (Buf.startswith(
"=")) {
101 Buf = Buf.drop_front();
106 Buf = Buf.drop_front();
110 std::tie(
S, Buf) = Buf.substr(1).split(
'"');
114 size_t End = Buf.find_first_of(
"=,;\r\n \t\v");
129 Buf = (End == Buf.npos) ?
"" : Buf.drop_front(End);
146 if (
Error Err = parseOne())
148 }
while (Tok.K !=
Eof);
164 if (Tok.K != Identifier || Tok.Value.getAsInteger(10, *
I))
176 void unget() {
Stack.push_back(Tok); }
186 if (Tok.K != Identifier) {
190 if (
Error Err = parseExport())
194 return parseNumbers(&
Info.HeapReserve, &
Info.HeapCommit);
196 return parseNumbers(&
Info.StackReserve, &
Info.StackCommit);
201 if (
Error Err = parseName(&Name, &
Info.ImageBase))
207 if (
Info.OutputFile.empty()) {
211 Info.OutputFile += IsDll ?
".dll" :
".exe";
219 return createError(
"unknown directive: " + Tok.Value);
223 Error parseExport() {
225 E.Name = std::string(Tok.Value);
227 if (Tok.K ==
Equal) {
229 if (Tok.K != Identifier)
230 return createError(
"identifier expected, but got " + Tok.Value);
232 E.Name = std::string(Tok.Value);
239 E.Name = (std::string(
"_").append(
E.Name));
241 E.ExtName = (std::string(
"_").append(
E.ExtName));
246 if (Tok.K == Identifier && Tok.Value[0] ==
'@') {
247 if (Tok.Value ==
"@") {
250 Tok.Value.getAsInteger(10,
E.Ordinal);
251 }
else if (Tok.Value.drop_front().getAsInteger(10,
E.Ordinal)) {
255 Info.Exports.push_back(
E);
281 E.AliasTarget = std::string(Tok.Value);
283 E.AliasTarget = std::string(
"_").append(
E.AliasTarget);
287 Info.Exports.push_back(
E);
294 if (
Error Err = readAsInt(Reserve))
297 if (Tok.K != Comma) {
302 if (
Error Err = readAsInt(Commit))
310 if (Tok.K == Identifier) {
311 *Out = std::string(Tok.Value);
319 if (
Error Err = expect(
Equal,
"'=' expected"))
321 if (
Error Err = readAsInt(Baseaddr))
333 if (Tok.K != Identifier)
334 return createError(
"identifier expected, but got " + Tok.Value);
336 std::tie(V1,
V2) = Tok.Value.split(
'.');
338 return createError(
"integer expected, but got " + Tok.Value);
341 else if (
V2.getAsInteger(10, *Minor))
342 return createError(
"integer expected, but got " + Tok.Value);
348 std::vector<Token>
Stack;
350 COFFModuleDefinition
Info;
StringSwitch & Case(StringLiteral S, T Value)
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
@ IMAGE_FILE_MACHINE_I386
bool startswith(StringRef Prefix) const
bool has_extension(const Twine &path, Style style=Style::native)
Has extension?
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
bool getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
static Error createError(const Twine &Err)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Analysis containing CSE Info
bar al al movzbl eax ret Missed when stored in a memory object
Token(Kind T=Unknown, StringRef S="")
static Version parseVersion(StringRef Name)
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Expected< COFFModuleDefinition > parse()
StringRef getBuffer() const
support::ulittle32_t Word
StringRef - Represent a constant reference to a string, i.e.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
const CustomOperand< const MCSubtargetInfo & > Msg[]
Parser(StringRef S, MachineTypes M, bool B)
value_type read(const void *memory, endianness endian)
Read a value of a particular endianness from memory.
Lightweight error class with error context and mandatory checking.
bool contains(StringRef Other) const
Return true if the given string is a substring of *this, and false otherwise.
COFF::MachineTypes Machine
static bool isDecorated(StringRef Sym, bool MingwDef)
A switch()-like statement whose cases are string literals.
Expected< COFFModuleDefinition > parseCOFFModuleDefinition(MemoryBufferRef MB, COFF::MachineTypes Machine, bool MingwDef=false)
LLVM Value Representation.