From a4afd1f12d55427099a3364c19d9fbbde46e7bf4 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Tue, 24 Jul 2018 00:41:28 +0000 Subject: [PATCH] [Debugify] Move interface definitions to a header, NFC This is a minor cleanup in preparation for a change to export DI statistics from -check-debugify. To do that, it would be cleaner to have a dedicated header for the debugify interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337786 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/opt/Debugify.cpp | 2 +- tools/opt/Debugify.h | 39 +++++++++++++++++++++++++++++++++++++++ tools/opt/NewPMDriver.cpp | 1 + tools/opt/PassPrinters.h | 20 -------------------- tools/opt/opt.cpp | 1 + 5 files changed, 42 insertions(+), 21 deletions(-) create mode 100644 tools/opt/Debugify.h diff --git a/tools/opt/Debugify.cpp b/tools/opt/Debugify.cpp index 515f423868d..b56a94b6e5f 100644 --- a/tools/opt/Debugify.cpp +++ b/tools/opt/Debugify.cpp @@ -12,7 +12,7 @@ /// //===----------------------------------------------------------------------===// -#include "PassPrinters.h" +#include "Debugify.h" #include "llvm/ADT/BitVector.h" #include "llvm/ADT/StringExtras.h" #include "llvm/IR/BasicBlock.h" diff --git a/tools/opt/Debugify.h b/tools/opt/Debugify.h new file mode 100644 index 00000000000..14ea5d3c6eb --- /dev/null +++ b/tools/opt/Debugify.h @@ -0,0 +1,39 @@ +//===- Debugify.h - Attach synthetic debug info to everything -------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file Interface to the `debugify` synthetic debug info testing utility. +/// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_TOOLS_OPT_DEBUGIFY_H +#define LLVM_TOOLS_OPT_DEBUGIFY_H + +#include "llvm/IR/PassManager.h" + +llvm::ModulePass *createDebugifyModulePass(); +llvm::FunctionPass *createDebugifyFunctionPass(); + +struct NewPMDebugifyPass : public llvm::PassInfoMixin { + llvm::PreservedAnalyses run(llvm::Module &M, llvm::ModuleAnalysisManager &AM); +}; + +llvm::ModulePass * +createCheckDebugifyModulePass(bool Strip = false, + llvm::StringRef NameOfWrappedPass = ""); + +llvm::FunctionPass * +createCheckDebugifyFunctionPass(bool Strip = false, + llvm::StringRef NameOfWrappedPass = ""); + +struct NewPMCheckDebugifyPass + : public llvm::PassInfoMixin { + llvm::PreservedAnalyses run(llvm::Module &M, llvm::ModuleAnalysisManager &AM); +}; + +#endif // LLVM_TOOLS_OPT_DEBUGIFY_H diff --git a/tools/opt/NewPMDriver.cpp b/tools/opt/NewPMDriver.cpp index 30b0973f498..a91d4cb5f9c 100644 --- a/tools/opt/NewPMDriver.cpp +++ b/tools/opt/NewPMDriver.cpp @@ -13,6 +13,7 @@ /// //===----------------------------------------------------------------------===// +#include "Debugify.h" #include "NewPMDriver.h" #include "PassPrinters.h" #include "llvm/ADT/StringRef.h" diff --git a/tools/opt/PassPrinters.h b/tools/opt/PassPrinters.h index 96a0ef2a582..e66f3f457b7 100644 --- a/tools/opt/PassPrinters.h +++ b/tools/opt/PassPrinters.h @@ -49,24 +49,4 @@ BasicBlockPass *createBasicBlockPassPrinter(const PassInfo *PI, } // end namespace llvm -llvm::ModulePass *createDebugifyModulePass(); -llvm::FunctionPass *createDebugifyFunctionPass(); - -struct NewPMDebugifyPass : public llvm::PassInfoMixin { - llvm::PreservedAnalyses run(llvm::Module &M, llvm::ModuleAnalysisManager &AM); -}; - -llvm::ModulePass * -createCheckDebugifyModulePass(bool Strip = false, - llvm::StringRef NameOfWrappedPass = ""); - -llvm::FunctionPass * -createCheckDebugifyFunctionPass(bool Strip = false, - llvm::StringRef NameOfWrappedPass = ""); - -struct NewPMCheckDebugifyPass - : public llvm::PassInfoMixin { - llvm::PreservedAnalyses run(llvm::Module &M, llvm::ModuleAnalysisManager &AM); -}; - #endif // LLVM_TOOLS_OPT_PASSPRINTERS_H diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index 43771d5d75b..98ad700409c 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include "BreakpointPrinter.h" +#include "Debugify.h" #include "NewPMDriver.h" #include "PassPrinters.h" #include "llvm/ADT/Triple.h" -- 2.50.1