[PATCH] D37747: [MIPS] Fix PLT entries generation in case of linking regular and microMIPS code
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 15 16:48:13 PDT 2017
ruiu added inline comments.
================
Comment at: ELF/Arch/Mips.cpp:219-220
+static bool isMicroMips() {
+ uint32_t Ase = getMipsEFlags() & EF_MIPS_ARCH_ASE;
+ return Ase == EF_MIPS_MICROMIPS;
}
----------------
I'd remove the temporary variable.
return (getMipsEFlags() & EF_MIPS_ARCH_ASE) == EF_MIPS_MICROMIPS;
================
Comment at: ELF/Arch/MipsArchTree.cpp:284
-template <class ELFT> uint32_t elf::getMipsEFlags() {
+static uint32_t MipsEFlags = 0;
+
----------------
We do use global variables, but I'd like to reduce usage of it to make it more friendly with embedding, so I wouldn't add a new global variable just for caching. If you do need this, I'd probably add a new member to Config. I don't like to add yet another MIPS-specific member to Config, but that is perhaps still better than adding a new global variable.
Repository:
rL LLVM
https://reviews.llvm.org/D37747
More information about the llvm-commits
mailing list