diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-06-23 01:05:26 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-06-23 01:05:26 +0000 |
commit | 9d95716c159ca4a07b435ec65943fa475cacc997 (patch) | |
tree | 8b489bd3b70ebc7aecc0b821fb247e3b19cb330a /llvm/lib/CodeGen/FaultMaps.cpp | |
parent | 3eb434acf408b590f6631f87719895154cf2ff13 (diff) | |
download | bcm5719-llvm-9d95716c159ca4a07b435ec65943fa475cacc997.tar.gz bcm5719-llvm-9d95716c159ca4a07b435ec65943fa475cacc997.zip |
[FaultMaps] Move FaultMapParser to Object/
Summary:
That way llvm-objdump can rely on it without adding an extra dependency
on CodeGen.
This change duplicates the FaultKind enum and the code that serializes
it to a string. I could not figure out a way to get around this without
adding a new dependency to Object
Reviewers: rafael, ab
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10619
llvm-svn: 240364
Diffstat (limited to 'llvm/lib/CodeGen/FaultMaps.cpp')
-rw-r--r-- | llvm/lib/CodeGen/FaultMaps.cpp | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/llvm/lib/CodeGen/FaultMaps.cpp b/llvm/lib/CodeGen/FaultMaps.cpp index 2acafafdb9f..0512ff95d1b 100644 --- a/llvm/lib/CodeGen/FaultMaps.cpp +++ b/llvm/lib/CodeGen/FaultMaps.cpp @@ -112,39 +112,3 @@ const char *FaultMaps::faultTypeToString(FaultMaps::FaultKind FT) { return "FaultingLoad"; } } - -raw_ostream &llvm:: -operator<<(raw_ostream &OS, - const FaultMapParser::FunctionFaultInfoAccessor &FFI) { - OS << "Fault kind: " - << FaultMaps::faultTypeToString((FaultMaps::FaultKind)FFI.getFaultKind()) - << ", faulting PC offset: " << FFI.getFaultingPCOffset() - << ", handling PC offset: " << FFI.getHandlerPCOffset(); - return OS; -} - -raw_ostream &llvm:: -operator<<(raw_ostream &OS, const FaultMapParser::FunctionInfoAccessor &FI) { - OS << "FunctionAddress: " << format_hex(FI.getFunctionAddr(), 8) - << ", NumFaultingPCs: " << FI.getNumFaultingPCs() << "\n"; - for (unsigned i = 0, e = FI.getNumFaultingPCs(); i != e; ++i) - OS << FI.getFunctionFaultInfoAt(i) << "\n"; - return OS; -} - -raw_ostream &llvm::operator<<(raw_ostream &OS, const FaultMapParser &FMP) { - OS << "Version: " << format_hex(FMP.getFaultMapVersion(), 2) << "\n"; - OS << "NumFunctions: " << FMP.getNumFunctions() << "\n"; - - if (FMP.getNumFunctions() == 0) - return OS; - - FaultMapParser::FunctionInfoAccessor FI; - - for (unsigned i = 0, e = FMP.getNumFunctions(); i != e; ++i) { - FI = (i == 0) ? FMP.getFirstFunctionInfo() : FI.getNextFunctionInfo(); - OS << FI; - } - - return OS; -} |