summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/FaultMaps.cpp36
-rw-r--r--llvm/lib/Object/CMakeLists.txt1
-rw-r--r--llvm/lib/Object/FaultMapParser.cpp61
3 files changed, 36 insertions, 62 deletions
diff --git a/llvm/lib/CodeGen/FaultMaps.cpp b/llvm/lib/CodeGen/FaultMaps.cpp
index 0512ff95d1b..2acafafdb9f 100644
--- a/llvm/lib/CodeGen/FaultMaps.cpp
+++ b/llvm/lib/CodeGen/FaultMaps.cpp
@@ -112,3 +112,39 @@ 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;
+}
diff --git a/llvm/lib/Object/CMakeLists.txt b/llvm/lib/Object/CMakeLists.txt
index 06e5b66a6ca..8f10143fccc 100644
--- a/llvm/lib/Object/CMakeLists.txt
+++ b/llvm/lib/Object/CMakeLists.txt
@@ -8,7 +8,6 @@ add_llvm_library(LLVMObject
ELFObjectFile.cpp
ELFYAML.cpp
Error.cpp
- FaultMapParser.cpp
IRObjectFile.cpp
MachOObjectFile.cpp
MachOUniversal.cpp
diff --git a/llvm/lib/Object/FaultMapParser.cpp b/llvm/lib/Object/FaultMapParser.cpp
deleted file mode 100644
index 6ce8a576115..00000000000
--- a/llvm/lib/Object/FaultMapParser.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//===----------------------- FaultMapParser.cpp ---------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Object/FaultMapParser.h"
-
-#include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/Format.h"
-
-using namespace llvm;
-
-static const char *faultKindToString(FaultMapParser::FaultKind FT) {
- switch (FT) {
- default:
- llvm_unreachable("unhandled fault type!");
-
- case FaultMapParser::FaultingLoad:
- return "FaultingLoad";
- }
-}
-
-raw_ostream &llvm::
-operator<<(raw_ostream &OS,
- const FaultMapParser::FunctionFaultInfoAccessor &FFI) {
- OS << "Fault kind: "
- << faultKindToString((FaultMapParser::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;
-}
OpenPOWER on IntegriCloud