[llvm] 07ecb98 - [Hexagon] Use map from HexagonDepArch instead of local one, NFC
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 7 13:03:08 PST 2022
Author: Krzysztof Parzyszek
Date: 2022-01-07T13:02:57-08:00
New Revision: 07ecb987987b2b099d656ccac3da922bd7321a83
URL: https://github.com/llvm/llvm-project/commit/07ecb987987b2b099d656ccac3da922bd7321a83
DIFF: https://github.com/llvm/llvm-project/commit/07ecb987987b2b099d656ccac3da922bd7321a83.diff
LOG: [Hexagon] Use map from HexagonDepArch instead of local one, NFC
Co-authored-by: Brian Cain <bcain at quicinc.com>
Added:
Modified:
llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
index fd85e1efef36..6a08d7503bac 100644
--- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
+++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
@@ -559,21 +559,11 @@ void Hexagon_MC::addArchSubtarget(MCSubtargetInfo const *STI,
}
unsigned Hexagon_MC::GetELFFlags(const MCSubtargetInfo &STI) {
- static std::map<StringRef,unsigned> ElfFlags = {
- {"hexagonv5", ELF::EF_HEXAGON_MACH_V5},
- {"hexagonv55", ELF::EF_HEXAGON_MACH_V55},
- {"hexagonv60", ELF::EF_HEXAGON_MACH_V60},
- {"hexagonv62", ELF::EF_HEXAGON_MACH_V62},
- {"hexagonv65", ELF::EF_HEXAGON_MACH_V65},
- {"hexagonv66", ELF::EF_HEXAGON_MACH_V66},
- {"hexagonv67", ELF::EF_HEXAGON_MACH_V67},
- {"hexagonv67t", ELF::EF_HEXAGON_MACH_V67T},
- {"hexagonv68", ELF::EF_HEXAGON_MACH_V68},
- {"hexagonv69", ELF::EF_HEXAGON_MACH_V69},
- };
+ using llvm::Hexagon::ElfFlagsByCpuStr;
- auto F = ElfFlags.find(STI.getCPU());
- assert(F != ElfFlags.end() && "Unrecognized Architecture");
+ const std::string CPU(STI.getCPU().str());
+ auto F = ElfFlagsByCpuStr.find(CPU);
+ assert(F != ElfFlagsByCpuStr.end() && "Unrecognized Architecture");
return F->second;
}
More information about the llvm-commits
mailing list