From 29ff50454cbca7f6637e86e22c9f31b24c1a4af6 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 24 Apr 2018 01:57:02 +0000 Subject: [PATCH] Change if-conditionals to else-if as they should all be mutually exclusive. No functional change intended. llvm-svn: 330675 --- llvm/lib/MC/MCParser/ELFAsmParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/MC/MCParser/ELFAsmParser.cpp b/llvm/lib/MC/MCParser/ELFAsmParser.cpp index b9fa49e131bd..1e69c3846083 100644 --- a/llvm/lib/MC/MCParser/ELFAsmParser.cpp +++ b/llvm/lib/MC/MCParser/ELFAsmParser.cpp @@ -498,16 +498,16 @@ bool ELFAsmParser::ParseSectionArguments(bool IsPush, SMLoc loc) { // Set the defaults first. if (hasPrefix(SectionName, ".rodata.") || SectionName == ".rodata1") Flags |= ELF::SHF_ALLOC; - if (SectionName == ".fini" || SectionName == ".init" || + else if (SectionName == ".fini" || SectionName == ".init" || hasPrefix(SectionName, ".text.")) Flags |= ELF::SHF_ALLOC | ELF::SHF_EXECINSTR; - if (hasPrefix(SectionName, ".data.") || SectionName == ".data1" || + else if (hasPrefix(SectionName, ".data.") || SectionName == ".data1" || hasPrefix(SectionName, ".bss.") || hasPrefix(SectionName, ".init_array.") || hasPrefix(SectionName, ".fini_array.") || hasPrefix(SectionName, ".preinit_array.")) Flags |= ELF::SHF_ALLOC | ELF::SHF_WRITE; - if (hasPrefix(SectionName, ".tdata.") || + else if (hasPrefix(SectionName, ".tdata.") || hasPrefix(SectionName, ".tbss.")) Flags |= ELF::SHF_ALLOC | ELF::SHF_WRITE | ELF::SHF_TLS;