[PATCH] D27030: Define toString() as a generic function to get a string for error message.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 17:44:45 PST 2016


ruiu created this revision.
ruiu added a reviewer: evgeny777.
ruiu added a subscriber: llvm-commits.

We have different functions to stringize objects to construct
error messages. For InputFile, we have getFilename, and for
InputSection, we have getName. You had to memorize them.

I think this is the case where the function overloading comes in handy.

This patch defines toString() functions that are overloaded for all these
types, so that you just call it in error().


https://reviews.llvm.org/D27030

Files:
  ELF/GdbIndex.cpp
  ELF/InputFiles.cpp
  ELF/InputFiles.h
  ELF/InputSection.cpp
  ELF/InputSection.h
  ELF/Relocations.cpp
  ELF/SymbolTable.cpp
  ELF/Symbols.cpp
  ELF/SyntheticSections.cpp
  ELF/Target.cpp
  ELF/Target.h
  ELF/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27030.79011.patch
Type: text/x-patch
Size: 20006 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161123/070f32e8/attachment.bin>


More information about the llvm-commits mailing list