all_llvm_targets.cpp 755 B

1234567891011121314151617181920212223
  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. const char InitLLVM::RegisterTargets =
  17. (InitializeTargets = &InitLLVMTargets, 0);
  18. } // namespace Carbon