GlobalSplit.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- GlobalSplit.h - global variable splitter -----------------*- C++ -*-===//
  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 pass uses inrange annotations on GEP indices to split globals where
  15. // beneficial. Clang currently attaches these annotations to references to
  16. // virtual table globals under the Itanium ABI for the benefit of the
  17. // whole-program virtual call optimization and control flow integrity passes.
  18. //
  19. //===----------------------------------------------------------------------===//
  20. #ifndef LLVM_TRANSFORMS_IPO_GLOBALSPLIT_H
  21. #define LLVM_TRANSFORMS_IPO_GLOBALSPLIT_H
  22. #include "llvm/IR/PassManager.h"
  23. namespace llvm {
  24. class Module;
  25. /// Pass to perform split of global variables.
  26. class GlobalSplitPass : public PassInfoMixin<GlobalSplitPass> {
  27. public:
  28. PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
  29. };
  30. } // end namespace llvm
  31. #endif // LLVM_TRANSFORMS_IPO_GLOBALSPLIT_H
  32. #ifdef __GNUC__
  33. #pragma GCC diagnostic pop
  34. #endif