[PATCH] D32587: Add llvm::object::getELFSectionTypeName()

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 04:14:11 PDT 2017


grimar added inline comments.


================
Comment at: lib/Object/ELF.cpp:149
+    switch (Type) {
+    case ELF::SHT_ARM_EXIDX:
+      return "SHT_ARM_EXIDX";
----------------
I would use some macro here. Like in original code and
above in this file used for relocations:

```
#define ELF_RELOC(name, value)                              \
  case ELF::name:                                                       \
    return #name;                                                       \
```

It should do code shorter and be less errorprone.
May be worth to rename ELF_RELOC to something more generic and reuse,
or introduce new one. Not sure here.


Repository:
  rL LLVM

https://reviews.llvm.org/D32587





More information about the llvm-commits mailing list