Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions llvm/tools/opt/opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,13 @@ static cl::list<std::string>
PassPlugins("load-pass-plugin",
cl::desc("Load passes from plugin library"));

static cl::opt<bool> TryUseNewDbgInfoFormat(
"try-experimental-debuginfo-iterators",
cl::desc("Enable debuginfo iterator positions, if they're built in"),
cl::init(false));

extern cl::opt<bool> UseNewDbgInfoFormat;

//===----------------------------------------------------------------------===//
// CodeGen-related helper functions.
//
Expand Down Expand Up @@ -452,6 +459,17 @@ int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv,
"llvm .bc -> .bc modular optimizer and analysis printer\n");

// RemoveDIs debug-info transition: tests may request that we /try/ to use the
// new debug-info format, if it's built in.
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
if (TryUseNewDbgInfoFormat) {
// If LLVM was built with support for this, turn the new debug-info format
// on.
UseNewDbgInfoFormat = true;
}
#endif
(void)TryUseNewDbgInfoFormat;

LLVMContext Context;

// TODO: remove shouldForceLegacyPM().
Expand Down