diff options
| author | Renato Golin <renato.golin@linaro.org> | 2014-09-24 17:00:42 +0000 |
|---|---|---|
| committer | Renato Golin <renato.golin@linaro.org> | 2014-09-24 17:00:42 +0000 |
| commit | 53f6034f8e74217203da93f6d97067525f0dfdb9 (patch) | |
| tree | fda96d51af1b7286b2c700f8207597ef52a62515 /llvm/lib/DebugInfo/DWARFContext.cpp | |
| parent | 0d4d5e64ece0bbcf44766186b80bff7ccbcc89f8 (diff) | |
| download | bcm5719-llvm-53f6034f8e74217203da93f6d97067525f0dfdb9.tar.gz bcm5719-llvm-53f6034f8e74217203da93f6d97067525f0dfdb9.zip | |
Refactor the RelocVisitor::visit method
This change replaces the brittle if/else chain of string comparisons
with a switch statement on the detected target triple, removing the
need for testing arbitrary architecture names returned from
getFileFormatName, whose primary purpose seems to be for display
(user-interface) purposes. The visitor now takes a reference to the
object file, rather than its arbitrary file format name to figure out
whether the file is a 32 or 64-bit object file and what the detected
target triple is.
A set of tests have been added to help show that the refactoring processes
relocations for the same targets as the original code.
Patch by Charlie Turner.
llvm-svn: 218388
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFContext.cpp')
| -rw-r--r-- | llvm/lib/DebugInfo/DWARFContext.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARFContext.cpp index 1be0691a1d9..39e6f4665b2 100644 --- a/llvm/lib/DebugInfo/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARFContext.cpp @@ -667,7 +667,7 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile &Obj) Sym->getAddress(SymAddr); } - object::RelocVisitor V(Obj.getFileFormatName()); + object::RelocVisitor V(Obj); // The section address is always 0 for debug sections. object::RelocToApply R(V.visit(Type, Reloc, 0, SymAddr)); if (V.error()) { |

