Files
revng-revng/include/revng/Support/ProgramRunner.h
Alessandro Di Federico 441a5552b7 ProgramRunner: do not depend on main
`main` is not in all cases a dynamically exported symbol, therefore,
it's not safe to rely on it.

This commit switches to use `PathList`'s `getCurrentExecutableFullPath`,
which reads `/proc/self/exe`.
2022-01-09 19:00:57 +01:00

26 lines
492 B
C++

#pragma once
//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
#include <string>
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
class ProgramRunner {
private:
llvm::SmallVector<llvm::StringRef, 64> Paths;
public:
ProgramRunner();
/// returns the exit code of the program.
[[nodiscard]] int
run(llvm::StringRef ProgramName, llvm::ArrayRef<std::string> Args);
};
extern ProgramRunner Runner;