#include "bolt/RuntimeLibs/HugifyRuntimeLibrary.h"
#include "bolt/Core/BinaryContext.h"
#include "bolt/Core/Linker.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/Support/CommandLine.h"
usingnamespacellvm;
usingnamespacebolt;
namespace opts {
extern cl::OptionCategory BoltOptCategory;
extern cl::opt<bool> HotText;
cl::opt<bool>
Hugify("hugify",
cl::desc("Automatically put hot code on 2MB page(s) (hugify) at "
"runtime. No manual call to hugify is needed in the binary "
"(which is what --hot-text relies on)."),
cl::cat(BoltOptCategory));
static cl::opt<std::string>
RuntimeHugifyLib("runtime-hugify-lib",
cl::desc("specify path of the runtime hugify library"),
cl::init("libbolt_rt_hugify.a"), cl::cat(BoltOptCategory));
}
void HugifyRuntimeLibrary::adjustCommandLineOptions(
const BinaryContext &BC) const { … }
void HugifyRuntimeLibrary::link(BinaryContext &BC, StringRef ToolPath,
BOLTLinker &Linker,
BOLTLinker::SectionsMapper MapSections) { … }