[TargetVersion] Only enable on RISC-V and AArch64 (#115991)
[llvm-project.git] / clang / tools / libclang / CXFile.h
blob888593b7bc751b46e530a41cb697c28207321eb8
1 //===- CXFile.h - Routines for manipulating CXFile --------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_TOOLS_LIBCLANG_CXFILE_H
10 #define LLVM_CLANG_TOOLS_LIBCLANG_CXFILE_H
12 #include "clang-c/CXFile.h"
13 #include "clang/Basic/FileEntry.h"
15 namespace clang {
16 namespace cxfile {
17 inline CXFile makeCXFile(OptionalFileEntryRef FE) {
18 return CXFile(FE ? const_cast<FileEntryRef::MapEntry *>(&FE->getMapEntry())
19 : nullptr);
22 inline OptionalFileEntryRef getFileEntryRef(CXFile File) {
23 if (!File)
24 return std::nullopt;
25 return FileEntryRef(*reinterpret_cast<const FileEntryRef::MapEntry *>(File));
27 } // namespace cxfile
28 } // namespace clang
30 #endif