UpdateCompilerUsed.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //==------ UpdateCompilerUsed.h - LLVM Link Time Optimizer Utility --------===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file declares a helper class to update llvm.compiler_used metadata.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_LTO_LEGACY_UPDATECOMPILERUSED_H
  18. #define LLVM_LTO_LEGACY_UPDATECOMPILERUSED_H
  19. #include "llvm/ADT/StringSet.h"
  20. #include "llvm/IR/GlobalValue.h"
  21. namespace llvm {
  22. class Module;
  23. class TargetMachine;
  24. /// Find all globals in \p TheModule that are referenced in
  25. /// \p AsmUndefinedRefs, as well as the user-supplied functions definitions that
  26. /// are also libcalls, and create or update the magic "llvm.compiler_used"
  27. /// global in \p TheModule.
  28. void updateCompilerUsed(Module &TheModule, const TargetMachine &TM,
  29. const StringSet<> &AsmUndefinedRefs);
  30. }
  31. #endif // LLVM_LTO_LEGACY_UPDATECOMPILERUSED_H
  32. #ifdef __GNUC__
  33. #pragma GCC diagnostic pop
  34. #endif