[PATCH] D21125: [llvm-objdump] Support detection of feature bits from the object and implement this for Mips.

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 07:00:23 PDT 2016

rafael added a subscriber: rafael.

Comment at: include/llvm/Object/ELFObjectFile.h:949
@@ -946,1 +948,3 @@
 template <class ELFT>
+SubtargetFeatures ELFObjectFile<ELFT>::getFeatures() const {
+  switch (EF.getHeader()->e_machine) {
I just noticed that this is entirely implemented on top of getPlatformFlags.

This means that we could 
* Move this out of lib/Object. It is only needed by code that does disassembly, no?
* Make this a non virtual function.
* At least implement it in ELFObjectFileBase so it is not templated.

Please implement one of these.

Comment at: tools/llvm-objdump/llvm-objdump.cpp:936
@@ -935,4 +935,3 @@
   if (MAttrs.size()) {
-    SubtargetFeatures Features;
     for (unsigned i = 0; i != MAttrs.size(); ++i)
Can you delete the MAttrs?


More information about the llvm-commits mailing list