clang_global_decl.cpp 618 B

123456789101112131415161718
  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 "toolchain/lower/clang_global_decl.h"
  5. namespace Carbon::Lower {
  6. auto CreateGlobalDecl(const clang::NamedDecl* decl) -> clang::GlobalDecl {
  7. if (const auto* constructor_decl =
  8. dyn_cast<clang::CXXConstructorDecl>(decl)) {
  9. return clang::GlobalDecl(constructor_decl,
  10. clang::CXXCtorType::Ctor_Complete);
  11. }
  12. return clang::GlobalDecl(decl);
  13. }
  14. } // namespace Carbon::Lower