1 //===- bolt/RuntimeLibs/HugifyRuntimeLibrary.h - Hugify Lib -----*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file contains the declaration of the HugifyRuntimeLibrary class. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #ifndef BOLT_RUNTIMELIBS_HUGIFY_RUNTIME_LIBRARY_H 14 #define BOLT_RUNTIMELIBS_HUGIFY_RUNTIME_LIBRARY_H 15 16 #include "bolt/RuntimeLibs/RuntimeLibrary.h" 17 18 namespace llvm { 19 namespace bolt { 20 21 class HugifyRuntimeLibrary : public RuntimeLibrary { 22 public: 23 /// Add custom section names generated by the runtime libraries to \p 24 /// SecNames. addRuntimeLibSections(std::vector<std::string> & SecNames)25 void addRuntimeLibSections(std::vector<std::string> &SecNames) const final { 26 SecNames.push_back(".bolt.hugify.entries"); 27 } 28 29 void adjustCommandLineOptions(const BinaryContext &BC) const final; 30 31 void emitBinary(BinaryContext &BC, MCStreamer &Streamer) final; 32 33 void link(BinaryContext &BC, StringRef ToolPath, RuntimeDyld &RTDyld, 34 std::function<void(RuntimeDyld &)> OnLoad) final; 35 }; 36 37 } // namespace bolt 38 } // namespace llvm 39 40 #endif 41