all_llvm_targets.cpp 745 B

12345678910111213141516171819202122
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #include "common/init_llvm.h"
  5. #include "llvm/Support/TargetSelect.h"
  6. namespace Carbon {
  7. static auto InitLLVMTargets() -> void {
  8. llvm::InitializeAllTargetInfos();
  9. llvm::InitializeAllTargets();
  10. llvm::InitializeAllTargetMCs();
  11. llvm::InitializeAllAsmParsers();
  12. llvm::InitializeAllAsmPrinters();
  13. }
  14. // On program startup, set `InitLLVM::InitializeTargets` to be our
  15. // initialization function so that `InitLLVM` can call it at the right moment.
  16. char InitLLVM::RegisterTargets = (InitializeTargets = &InitLLVMTargets, 0);
  17. } // namespace Carbon