[llvm] f75e04b - [llvm-jitlink] Add -show-init-es option to dump initial ExecutionSession state.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 14 16:34:16 PDT 2020
Author: Lang Hames
Date: 2020-03-14T16:07:46-07:00
New Revision: f75e04bc93fb41bfe47be08a8d793066d215c944
URL: https://github.com/llvm/llvm-project/commit/f75e04bc93fb41bfe47be08a8d793066d215c944
DIFF: https://github.com/llvm/llvm-project/commit/f75e04bc93fb41bfe47be08a8d793066d215c944.diff
LOG: [llvm-jitlink] Add -show-init-es option to dump initial ExecutionSession state.
Inspecting this state can be helpful when debugging jit-linking testcases.
Added:
Modified:
llvm/tools/llvm-jitlink/llvm-jitlink.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
index 3e444e609de1..9058a7907b0f 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
@@ -86,6 +86,11 @@ static cl::list<std::string> AbsoluteDefs(
cl::desc("Inject absolute symbol definitions (syntax: <name>=<addr>)"),
cl::ZeroOrMore);
+static cl::opt<bool> ShowInitialExecutionSessionState(
+ "show-init-es",
+ cl::desc("Print ExecutionSession state before resolving entry point"),
+ cl::init(false));
+
static cl::opt<bool> ShowAddrs(
"show-addrs",
cl::desc("Print registered symbol, section, got and stub addresses"),
@@ -841,12 +846,14 @@ int main(int argc, char *argv[]) {
ExitOnErr(loadProcessSymbols(*S));
ExitOnErr(loadDylibs());
-
{
TimeRegion TR(Timers ? &Timers->LoadObjectsTimer : nullptr);
ExitOnErr(loadObjects(*S));
}
+ if (ShowInitialExecutionSessionState)
+ S->ES.dump(outs());
+
JITEvaluatedSymbol EntryPoint = 0;
{
TimeRegion TR(Timers ? &Timers->LinkTimer : nullptr);
More information about the llvm-commits
mailing list