Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:48

0001 //===--- CFProtectionOptions.h ----------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 //  This file defines constants for -fcf-protection and other related flags.
0010 //
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef LLVM_CLANG_BASIC_CFPROTECTIONOPTIONS_H
0014 #define LLVM_CLANG_BASIC_CFPROTECTIONOPTIONS_H
0015 
0016 #include "llvm/Support/ErrorHandling.h"
0017 
0018 namespace clang {
0019 
0020 enum class CFBranchLabelSchemeKind {
0021   Default,
0022 #define CF_BRANCH_LABEL_SCHEME(Kind, FlagVal) Kind,
0023 #include "clang/Basic/CFProtectionOptions.def"
0024 };
0025 
0026 static inline const char *
0027 getCFBranchLabelSchemeFlagVal(const CFBranchLabelSchemeKind Scheme) {
0028 #define CF_BRANCH_LABEL_SCHEME(Kind, FlagVal)                                  \
0029   if (Scheme == CFBranchLabelSchemeKind::Kind)                                 \
0030     return #FlagVal;
0031 #include "clang/Basic/CFProtectionOptions.def"
0032 
0033   llvm::report_fatal_error("invalid scheme");
0034 }
0035 
0036 } // namespace clang
0037 
0038 #endif // #ifndef LLVM_CLANG_BASIC_CFPROTECTIONOPTIONS_H