diff options
Diffstat (limited to 'llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp')
-rw-r--r-- | llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp index cb7bf82d86f..a61ab7d3aff 100644 --- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp @@ -1,4 +1,4 @@ -//===- llvm/unittest/DebugInfo/DWARFFormValueTest.cpp ---------------------===// +//===- llvm/unittest/DebugInfo/DWARFDebugInfoTest.cpp ---------------------===// // // The LLVM Compiler Infrastructure // @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "DwarfGenerator.h" +#include "DwarfUtils.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/SmallString.h" @@ -36,36 +37,10 @@ using namespace llvm; using namespace dwarf; +using namespace utils; namespace { -void initLLVMIfNeeded() { - static bool gInitialized = false; - if (!gInitialized) { - gInitialized = true; - InitializeAllTargets(); - InitializeAllTargetMCs(); - InitializeAllAsmPrinters(); - InitializeAllAsmParsers(); - } -} - -Triple getHostTripleForAddrSize(uint8_t AddrSize) { - Triple PT(Triple::normalize(LLVM_HOST_TRIPLE)); - - if (AddrSize == 8 && PT.isArch32Bit()) - return PT.get64BitArchVariant(); - if (AddrSize == 4 && PT.isArch64Bit()) - return PT.get32BitArchVariant(); - return PT; -} - -static bool isConfigurationSupported(Triple &T) { - initLLVMIfNeeded(); - std::string Err; - return TargetRegistry::lookupTarget(T.getTriple(), Err); -} - template <uint16_t Version, class AddrType, class RefAddrType> void TestAllForms() { Triple Triple = getHostTripleForAddrSize(sizeof(AddrType)); |