Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: src/IceELFObjectWriter.cpp

Issue 891953002: Fix subzero Windows build (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceELFObjectWriter.cpp
diff --git a/src/IceELFObjectWriter.cpp b/src/IceELFObjectWriter.cpp
index d15c735edf96c83028bb06c04f0f50c56cdb1cd8..7fcb0432eccfa37c4e5d6e444678568436f8cc24 100644
--- a/src/IceELFObjectWriter.cpp
+++ b/src/IceELFObjectWriter.cpp
@@ -282,7 +282,7 @@ void partitionGlobalsBySection(const VariableDeclarationList &Vars,
for (VariableDeclaration *Var : Vars) {
if (GlobalContext::matchSymbolName(Var->getName(), TranslateOnly)) {
size_t Section = classifyGlobalSection(Var);
- assert(Section < ELFObjectWriter::SectionType::NumSectionTypes);
+ assert(Section < ELFObjectWriter::NumSectionTypes);
VarsBySection[Section].push_back(Var);
}
}
@@ -305,7 +305,7 @@ void ELFObjectWriter::writeDataSection(const VariableDeclarationList &Vars,
}
}
-void ELFObjectWriter::writeDataOfType(SectionType SectionType,
+void ELFObjectWriter::writeDataOfType(SectionType ST,
const VariableDeclarationList &Vars,
FixupKind RelocationKind, bool IsELF64) {
ELFDataSection *Section;
@@ -319,8 +319,8 @@ void ELFObjectWriter::writeDataOfType(SectionType SectionType,
}
const Elf64_Xword ShEntsize = 0; // non-uniform data element size.
// Lift this out, so it can be re-used if we do fdata-sections?
- switch (SectionType) {
- case SectionType::ROData: {
+ switch (ST) {
+ case ROData: {
SectionName = ".rodata";
// Only expecting to write the data sections all in one shot for now.
assert(RODataSections.empty());
@@ -333,7 +333,7 @@ void ELFObjectWriter::writeDataOfType(SectionType SectionType,
RelRODataSections.push_back(RelSection);
break;
}
- case SectionType::Data: {
+ case Data: {
SectionName = ".data";
assert(DataSections.empty());
const Elf64_Xword ShFlags = SHF_ALLOC | SHF_WRITE;
@@ -345,7 +345,7 @@ void ELFObjectWriter::writeDataOfType(SectionType SectionType,
RelDataSections.push_back(RelSection);
break;
}
- case SectionType::BSS: {
+ case BSS: {
SectionName = ".bss";
assert(BSSSections.empty());
const Elf64_Xword ShFlags = SHF_ALLOC | SHF_WRITE;
@@ -355,7 +355,7 @@ void ELFObjectWriter::writeDataOfType(SectionType SectionType,
BSSSections.push_back(Section);
break;
}
- case SectionType::NumSectionTypes:
+ case NumSectionTypes:
llvm::report_fatal_error("Unknown SectionType");
break;
}
@@ -372,14 +372,13 @@ void ELFObjectWriter::writeDataOfType(SectionType SectionType,
Section->getCurrentSize(), SymbolSize);
StrTab->add(MangledName);
if (!Var->hasNonzeroInitializer()) {
- assert(SectionType == SectionType::BSS ||
- SectionType == SectionType::ROData);
- if (SectionType == SectionType::ROData)
+ assert(ST == BSS || ST == ROData);
+ if (ST == ROData)
Section->appendZeros(Str, SymbolSize);
else
Section->setSize(Section->getCurrentSize() + SymbolSize);
} else {
- assert(SectionType != SectionType::BSS);
+ assert(ST != BSS);
for (VariableDeclaration::Initializer *Init : Var->getInitializers()) {
switch (Init->getKind()) {
case VariableDeclaration::Initializer::DataInitializerKind: {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698