Rename BytesDataCommand -> ByteCommand.
llvm-svn: 315431
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 222aa9a..2f48ebe 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -595,7 +595,7 @@
}
// Handle BYTE(), SHORT(), LONG(), or QUAD().
- if (auto *Cmd = dyn_cast<BytesDataCommand>(Base)) {
+ if (auto *Cmd = dyn_cast<ByteCommand>(Base)) {
Cmd->Offset = Dot - Ctx->OutSec->Addr;
Dot += Cmd->Size;
Ctx->OutSec->Size = Dot - Ctx->OutSec->Addr;
diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h
index 42273d0..291981b 100644
--- a/lld/ELF/LinkerScript.h
+++ b/lld/ELF/LinkerScript.h
@@ -75,8 +75,8 @@
AssignmentKind, // . = expr or <sym> = expr
OutputSectionKind,
InputSectionKind,
- AssertKind, // ASSERT(expr)
- BytesDataKind // BYTE(expr), SHORT(expr), LONG(expr) or QUAD(expr)
+ AssertKind, // ASSERT(expr)
+ ByteKind // BYTE(expr), SHORT(expr), LONG(expr) or QUAD(expr)
};
struct BaseCommand {
@@ -165,11 +165,11 @@
};
// Represents BYTE(), SHORT(), LONG(), or QUAD().
-struct BytesDataCommand : BaseCommand {
- BytesDataCommand(Expr E, unsigned Size)
- : BaseCommand(BytesDataKind), Expression(E), Size(Size) {}
+struct ByteCommand : BaseCommand {
+ ByteCommand(Expr E, unsigned Size)
+ : BaseCommand(ByteKind), Expression(E), Size(Size) {}
- static bool classof(const BaseCommand *C) { return C->Kind == BytesDataKind; }
+ static bool classof(const BaseCommand *C) { return C->Kind == ByteKind; }
Expr Expression;
unsigned Offset;
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 6f0c0f2..c261c83 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -412,7 +412,7 @@
// Linker scripts may have BYTE()-family commands with which you
// can write arbitrary bytes to the output. Process them if any.
for (BaseCommand *Base : SectionCommands)
- if (auto *Data = dyn_cast<BytesDataCommand>(Base))
+ if (auto *Data = dyn_cast<ByteCommand>(Base))
writeInt(Buf + Data->Offset, Data->Expression().getValue(), Data->Size);
}
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index d30538e..acbe0a9 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -74,7 +74,7 @@
void readVersionScriptCommand();
SymbolAssignment *readAssignment(StringRef Name);
- BytesDataCommand *readBytesDataCommand(StringRef Tok);
+ ByteCommand *readByteCommand(StringRef Tok);
uint32_t readFill();
uint32_t parseFill(StringRef Tok);
void readSectionAddressType(OutputSection *Cmd);
@@ -670,7 +670,7 @@
// Empty commands are allowed. Do nothing here.
} else if (SymbolAssignment *Assign = readProvideOrAssignment(Tok)) {
Cmd->SectionCommands.push_back(Assign);
- } else if (BytesDataCommand *Data = readBytesDataCommand(Tok)) {
+ } else if (ByteCommand *Data = readByteCommand(Tok)) {
Cmd->SectionCommands.push_back(Data);
} else if (Tok == "ASSERT") {
Cmd->SectionCommands.push_back(readAssert());
@@ -888,7 +888,7 @@
return Val;
}
-BytesDataCommand *ScriptParser::readBytesDataCommand(StringRef Tok) {
+ByteCommand *ScriptParser::readByteCommand(StringRef Tok) {
int Size = StringSwitch<int>(Tok)
.Case("BYTE", 1)
.Case("SHORT", 2)
@@ -897,8 +897,7 @@
.Default(-1);
if (Size == -1)
return nullptr;
-
- return make<BytesDataCommand>(readParenExpr(), Size);
+ return make<ByteCommand>(readParenExpr(), Size);
}
StringRef ScriptParser::readParenLiteral() {