LCOV - code coverage report
Current view: top level - build-llvm/tools/clang/include/clang/Basic - AttrHasAttributeImpl.inc (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 500 519 96.3 %
Date: 2017-09-14 15:23:50 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
       2             : |*                                                                            *|
       3             : |* Code to implement the __has_attribute logic                                *|
       4             : |*                                                                            *|
       5             : |* Automatically generated file, do not edit!                                 *|
       6             : |*                                                                            *|
       7             : \*===----------------------------------------------------------------------===*/
       8             : 
       9         634 : const llvm::Triple &T = Target.getTriple();
      10         634 : switch (Syntax) {
      11         133 : case AttrSyntax::GNU:
      12         133 :   return llvm::StringSwitch<int>(Name)
      13         399 :     .Case("amdgpu_flat_work_group_size", 1)
      14         399 :     .Case("amdgpu_num_sgpr", 1)
      15         399 :     .Case("amdgpu_num_vgpr", 1)
      16         399 :     .Case("amdgpu_waves_per_eu", 1)
      17         399 :     .Case("interrupt", (T.getArch() == llvm::Triple::arm || T.getArch() == llvm::Triple::thumb || T.getArch() == llvm::Triple::armeb || T.getArch() == llvm::Triple::thumbeb) ? 1 : 0)
      18         399 :     .Case("interrupt", (T.getArch() == llvm::Triple::avr) ? 1 : 0)
      19         399 :     .Case("signal", (T.getArch() == llvm::Triple::avr) ? 1 : 0)
      20         399 :     .Case("abi_tag", 1)
      21         399 :     .Case("acquire_capability", 1)
      22         399 :     .Case("acquire_shared_capability", 1)
      23         399 :     .Case("exclusive_lock_function", 1)
      24         399 :     .Case("shared_lock_function", 1)
      25         399 :     .Case("acquire_capability", 1)
      26         399 :     .Case("acquire_shared_capability", 1)
      27         399 :     .Case("exclusive_lock_function", 1)
      28         399 :     .Case("shared_lock_function", 1)
      29         399 :     .Case("acquire_capability", 1)
      30         399 :     .Case("acquire_shared_capability", 1)
      31         399 :     .Case("exclusive_lock_function", 1)
      32         399 :     .Case("shared_lock_function", 1)
      33         399 :     .Case("acquire_capability", 1)
      34         399 :     .Case("acquire_shared_capability", 1)
      35         399 :     .Case("exclusive_lock_function", 1)
      36         399 :     .Case("shared_lock_function", 1)
      37         399 :     .Case("acquired_after", 1)
      38         399 :     .Case("acquired_before", 1)
      39         399 :     .Case("address_space", 1)
      40         399 :     .Case("alias", 1)
      41         399 :     .Case("align_value", 1)
      42         399 :     .Case("aligned", 1)
      43         399 :     .Case("alloc_align", 1)
      44         399 :     .Case("alloc_size", 1)
      45         399 :     .Case("always_inline", 1)
      46         399 :     .Case("analyzer_noreturn", 1)
      47         399 :     .Case("annotate", 1)
      48         399 :     .Case("interrupt", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64) ? 1 : 0)
      49         399 :     .Case("no_caller_saved_registers", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64) ? 1 : 0)
      50         399 :     .Case("objc_arc_weak_reference_unavailable", 1)
      51         399 :     .Case("argument_with_type_tag", 1)
      52         399 :     .Case("pointer_with_type_tag", 1)
      53         399 :     .Case("argument_with_type_tag", 1)
      54         399 :     .Case("pointer_with_type_tag", 1)
      55         399 :     .Case("assert_capability", 1)
      56         399 :     .Case("assert_shared_capability", 1)
      57         399 :     .Case("assert_capability", 1)
      58         399 :     .Case("assert_shared_capability", 1)
      59         399 :     .Case("assert_exclusive_lock", 1)
      60         399 :     .Case("assert_shared_lock", 1)
      61         399 :     .Case("assume_aligned", 1)
      62         399 :     .Case("availability", 1)
      63         399 :     .Case("blocks", 1)
      64         399 :     .Case("bounded", 1)
      65         399 :     .Case("cdecl", 1)
      66         399 :     .Case("cf_audited_transfer", 1)
      67         399 :     .Case("cf_consumed", 1)
      68         399 :     .Case("cf_returns_not_retained", 1)
      69         399 :     .Case("cf_returns_retained", 1)
      70         399 :     .Case("cf_unknown_transfer", 1)
      71         399 :     .Case("constant", 1)
      72         399 :     .Case("cudart_builtin", 1)
      73         399 :     .Case("device", 1)
      74         399 :     .Case("device_builtin", 1)
      75         399 :     .Case("device_builtin_surface_type", 1)
      76         399 :     .Case("device_builtin_texture_type", 1)
      77         399 :     .Case("global", 1)
      78         399 :     .Case("host", 1)
      79         399 :     .Case("launch_bounds", 1)
      80         399 :     .Case("shared", 1)
      81         399 :     .Case("callable_when", 1)
      82         399 :     .Case("capability", 1)
      83         399 :     .Case("shared_capability", 1)
      84         399 :     .Case("capability", 1)
      85         399 :     .Case("shared_capability", 1)
      86         399 :     .Case("carries_dependency", 1)
      87         399 :     .Case("cleanup", 1)
      88         399 :     .Case("cold", 1)
      89         399 :     .Case("common", 1)
      90         399 :     .Case("const", 1)
      91         399 :     .Case("__const", 1)
      92         399 :     .Case("const", 1)
      93         399 :     .Case("__const", 1)
      94         399 :     .Case("constructor", 1)
      95         399 :     .Case("consumable", 1)
      96         399 :     .Case("consumable_auto_cast_state", 1)
      97         399 :     .Case("consumable_set_state_on_read", 1)
      98         399 :     .Case("convergent", 1)
      99         399 :     .Case("dllexport", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64 || T.getArch() == llvm::Triple::arm || T.getArch() == llvm::Triple::thumb || T.getArch() == llvm::Triple::aarch64) && (T.getOS() == llvm::Triple::Win32) ? 1 : 0)
     100         399 :     .Case("dllimport", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64 || T.getArch() == llvm::Triple::arm || T.getArch() == llvm::Triple::thumb || T.getArch() == llvm::Triple::aarch64) && (T.getOS() == llvm::Triple::Win32) ? 1 : 0)
     101         399 :     .Case("deprecated", 1)
     102         399 :     .Case("destructor", 1)
     103         399 :     .Case("diagnose_if", 1)
     104         399 :     .Case("disable_tail_calls", 1)
     105         399 :     .Case("enable_if", 1)
     106         399 :     .Case("enum_extensibility", 1)
     107         399 :     .Case("exclusive_trylock_function", 1)
     108         399 :     .Case("ext_vector_type", 1)
     109         399 :     .Case("external_source_symbol", 1)
     110         399 :     .Case("fastcall", 1)
     111         399 :     .Case("flag_enum", 1)
     112         399 :     .Case("flatten", 1)
     113         399 :     .Case("format", 1)
     114         399 :     .Case("format_arg", 1)
     115         399 :     .Case("gnu_inline", 1)
     116         399 :     .Case("guarded_by", 1)
     117         399 :     .Case("guarded_var", 1)
     118         399 :     .Case("hot", 1)
     119         399 :     .Case("ibaction", 1)
     120         399 :     .Case("iboutlet", 1)
     121         399 :     .Case("iboutletcollection", 1)
     122         399 :     .Case("ifunc", 1)
     123         399 :     .Case("init_priority", 1)
     124         399 :     .Case("intel_ocl_bicc", 1)
     125         399 :     .Case("internal_linkage", 1)
     126         399 :     .Case("lock_returned", 1)
     127         399 :     .Case("lockable", 1)
     128         399 :     .Case("locks_excluded", 1)
     129         399 :     .Case("ms_abi", 1)
     130         399 :     .Case("interrupt", (T.getArch() == llvm::Triple::msp430) ? 1 : 0)
     131         399 :     .Case("ms_struct", 1)
     132         399 :     .Case("may_alias", 1)
     133         399 :     .Case("micromips", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel) ? 1 : 0)
     134         399 :     .Case("minsize", 1)
     135         399 :     .Case("mips16", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel) ? 1 : 0)
     136         399 :     .Case("interrupt", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel) ? 1 : 0)
     137         399 :     .Case("long_call", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) ? 1 : 0)
     138         399 :     .Case("far", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) ? 1 : 0)
     139         399 :     .Case("long_call", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) ? 1 : 0)
     140         399 :     .Case("far", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) ? 1 : 0)
     141         399 :     .Case("short_call", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) ? 1 : 0)
     142         399 :     .Case("near", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) ? 1 : 0)
     143         399 :     .Case("short_call", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) ? 1 : 0)
     144         399 :     .Case("near", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) ? 1 : 0)
     145         399 :     .Case("mode", 1)
     146         399 :     .Case("ns_consumed", 1)
     147         399 :     .Case("ns_consumes_self", 1)
     148         399 :     .Case("ns_returns_autoreleased", 1)
     149         399 :     .Case("ns_returns_not_retained", 1)
     150         399 :     .Case("ns_returns_retained", 1)
     151         399 :     .Case("naked", 1)
     152         399 :     .Case("neon_polyvector_type", 1)
     153         399 :     .Case("neon_vector_type", 1)
     154         399 :     .Case("nocommon", 1)
     155         399 :     .Case("nodebug", 1)
     156         399 :     .Case("noduplicate", 1)
     157         399 :     .Case("noinline", 1)
     158         399 :     .Case("no_instrument_function", 1)
     159         399 :     .Case("nomicromips", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel) ? 1 : 0)
     160         399 :     .Case("nomips16", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel) ? 1 : 0)
     161         399 :     .Case("noreturn", 1)
     162         399 :     .Case("no_sanitize", 1)
     163         399 :     .Case("no_address_safety_analysis", 1)
     164         399 :     .Case("no_sanitize_address", 1)
     165         399 :     .Case("no_sanitize_thread", 1)
     166         399 :     .Case("no_sanitize_memory", 1)
     167         399 :     .Case("no_address_safety_analysis", 1)
     168         399 :     .Case("no_sanitize_address", 1)
     169         399 :     .Case("no_sanitize_thread", 1)
     170         399 :     .Case("no_sanitize_memory", 1)
     171         399 :     .Case("no_address_safety_analysis", 1)
     172         399 :     .Case("no_sanitize_address", 1)
     173         399 :     .Case("no_sanitize_thread", 1)
     174         399 :     .Case("no_sanitize_memory", 1)
     175         399 :     .Case("no_address_safety_analysis", 1)
     176         399 :     .Case("no_sanitize_address", 1)
     177         399 :     .Case("no_sanitize_thread", 1)
     178         399 :     .Case("no_sanitize_memory", 1)
     179         399 :     .Case("no_split_stack", 1)
     180         399 :     .Case("no_thread_safety_analysis", 1)
     181         399 :     .Case("nothrow", 1)
     182         399 :     .Case("nonnull", 1)
     183         399 :     .Case("not_tail_called", 1)
     184         399 :     .Case("nv_weak", 1)
     185         399 :     .Case("objc_boxable", 1)
     186         399 :     .Case("objc_bridge", 1)
     187         399 :     .Case("objc_bridge_mutable", 1)
     188         399 :     .Case("objc_bridge_related", 1)
     189         399 :     .Case("objc_designated_initializer", 1)
     190         399 :     .Case("objc_exception", 1)
     191         399 :     .Case("objc_protocol_requires_explicit_implementation", 1)
     192         399 :     .Case("objc_gc", 1)
     193         399 :     .Case("objc_independent_class", 1)
     194         399 :     .Case("objc_method_family", 1)
     195         399 :     .Case("NSObject", 1)
     196         399 :     .Case("objc_ownership", 1)
     197         399 :     .Case("objc_precise_lifetime", 1)
     198         399 :     .Case("objc_requires_property_definitions", 1)
     199         399 :     .Case("objc_requires_super", 1)
     200         399 :     .Case("objc_returns_inner_pointer", 1)
     201         399 :     .Case("objc_root_class", 1)
     202         399 :     .Case("objc_runtime_name", 1)
     203         399 :     .Case("objc_runtime_visible", 1)
     204         399 :     .Case("objc_subclassing_restricted", 1)
     205         399 :     .Case("intel_reqd_sub_group_size", 1)
     206         399 :     .Case("nosvm", 1)
     207         399 :     .Case("opencl_unroll_hint", 1)
     208         399 :     .Case("optnone", 1)
     209         399 :     .Case("overloadable", 1)
     210         399 :     .Case("ownership_holds", 1)
     211         399 :     .Case("ownership_returns", 1)
     212         399 :     .Case("ownership_takes", 1)
     213         399 :     .Case("ownership_holds", 1)
     214         399 :     .Case("ownership_returns", 1)
     215         399 :     .Case("ownership_takes", 1)
     216         399 :     .Case("ownership_holds", 1)
     217         399 :     .Case("ownership_returns", 1)
     218         399 :     .Case("ownership_takes", 1)
     219         399 :     .Case("packed", 1)
     220         399 :     .Case("param_typestate", 1)
     221         399 :     .Case("pascal", 1)
     222         399 :     .Case("pass_object_size", 1)
     223         399 :     .Case("pcs", 1)
     224         399 :     .Case("preserve_all", 1)
     225         399 :     .Case("preserve_most", 1)
     226         399 :     .Case("pt_guarded_by", 1)
     227         399 :     .Case("pt_guarded_var", 1)
     228         399 :     .Case("pure", 1)
     229         399 :     .Case("regcall", 1)
     230         399 :     .Case("regparm", 1)
     231         399 :     .Case("release_capability", 1)
     232         399 :     .Case("release_shared_capability", 1)
     233         399 :     .Case("release_generic_capability", 1)
     234         399 :     .Case("unlock_function", 1)
     235         399 :     .Case("release_capability", 1)
     236         399 :     .Case("release_shared_capability", 1)
     237         399 :     .Case("release_generic_capability", 1)
     238         399 :     .Case("unlock_function", 1)
     239         399 :     .Case("release_capability", 1)
     240         399 :     .Case("release_shared_capability", 1)
     241         399 :     .Case("release_generic_capability", 1)
     242         399 :     .Case("unlock_function", 1)
     243         399 :     .Case("release_capability", 1)
     244         399 :     .Case("release_shared_capability", 1)
     245         399 :     .Case("release_generic_capability", 1)
     246         399 :     .Case("unlock_function", 1)
     247         399 :     .Case("kernel", 1)
     248         399 :     .Case("reqd_work_group_size", 1)
     249         399 :     .Case("require_constant_initialization", 1)
     250         399 :     .Case("requires_capability", 1)
     251         399 :     .Case("exclusive_locks_required", 1)
     252         399 :     .Case("requires_shared_capability", 1)
     253         399 :     .Case("shared_locks_required", 1)
     254         399 :     .Case("requires_capability", 1)
     255         399 :     .Case("exclusive_locks_required", 1)
     256         399 :     .Case("requires_shared_capability", 1)
     257         399 :     .Case("shared_locks_required", 1)
     258         399 :     .Case("requires_capability", 1)
     259         399 :     .Case("exclusive_locks_required", 1)
     260         399 :     .Case("requires_shared_capability", 1)
     261         399 :     .Case("shared_locks_required", 1)
     262         399 :     .Case("requires_capability", 1)
     263         399 :     .Case("exclusive_locks_required", 1)
     264         399 :     .Case("requires_shared_capability", 1)
     265         399 :     .Case("shared_locks_required", 1)
     266         399 :     .Case("malloc", 1)
     267         399 :     .Case("return_typestate", 1)
     268         399 :     .Case("returns_nonnull", 1)
     269         399 :     .Case("returns_twice", 1)
     270         399 :     .Case("scoped_lockable", 1)
     271         399 :     .Case("section", 1)
     272         399 :     .Case("selectany", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64 || T.getArch() == llvm::Triple::arm || T.getArch() == llvm::Triple::thumb || T.getArch() == llvm::Triple::aarch64) && (T.getOS() == llvm::Triple::Win32) ? 1 : 0)
     273         399 :     .Case("sentinel", 1)
     274         399 :     .Case("set_typestate", 1)
     275         399 :     .Case("shared_trylock_function", 1)
     276         399 :     .Case("stdcall", 1)
     277         399 :     .Case("swiftcall", 1)
     278         399 :     .Case("swift_context", 1)
     279         399 :     .Case("swift_error_result", 1)
     280         399 :     .Case("swift_indirect_result", 1)
     281         399 :     .Case("sysv_abi", 1)
     282         399 :     .Case("tls_model", 1)
     283         399 :     .Case("target", 1)
     284         399 :     .Case("test_typestate", 1)
     285         399 :     .Case("thiscall", 1)
     286         399 :     .Case("transparent_union", 1)
     287         399 :     .Case("try_acquire_capability", 1)
     288         399 :     .Case("try_acquire_shared_capability", 1)
     289         399 :     .Case("try_acquire_capability", 1)
     290         399 :     .Case("try_acquire_shared_capability", 1)
     291         399 :     .Case("type_tag_for_datatype", 1)
     292         399 :     .Case("type_visibility", 1)
     293         399 :     .Case("unavailable", 1)
     294         399 :     .Case("unused", 1)
     295         399 :     .Case("used", 1)
     296         399 :     .Case("vecreturn", 1)
     297         399 :     .Case("vec_type_hint", 1)
     298         399 :     .Case("vectorcall", 1)
     299         399 :     .Case("vector_size", 1)
     300         399 :     .Case("visibility", 1)
     301         399 :     .Case("warn_unused", 1)
     302         399 :     .Case("warn_unused_result", 1)
     303         399 :     .Case("weak", 1)
     304         399 :     .Case("weak_import", 1)
     305         399 :     .Case("weakref", 1)
     306         399 :     .Case("work_group_size_hint", 1)
     307         399 :     .Case("force_align_arg_pointer", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64) ? 1 : 0)
     308         399 :     .Case("xray_always_instrument", 1)
     309         399 :     .Case("xray_never_instrument", 1)
     310         399 :     .Case("xray_always_instrument", 1)
     311         399 :     .Case("xray_never_instrument", 1)
     312         399 :     .Case("xray_log_args", 1)
     313         266 :     .Default(0);
     314         403 : case AttrSyntax::Declspec:
     315         403 :   return llvm::StringSwitch<int>(Name)
     316        1209 :     .Case("align", 1)
     317        1209 :     .Case("__constant__", 1)
     318        1209 :     .Case("__cudart_builtin__", 1)
     319        1209 :     .Case("__device__", 1)
     320        1209 :     .Case("__device_builtin__", 1)
     321        1209 :     .Case("__device_builtin_surface_type__", 1)
     322        1209 :     .Case("__device_builtin_texture_type__", 1)
     323        1209 :     .Case("__global__", 1)
     324        1209 :     .Case("__host__", 1)
     325        1209 :     .Case("__launch_bounds__", 1)
     326        1209 :     .Case("__shared__", 1)
     327        1209 :     .Case("dllexport", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64 || T.getArch() == llvm::Triple::arm || T.getArch() == llvm::Triple::thumb || T.getArch() == llvm::Triple::aarch64) && (T.getOS() == llvm::Triple::Win32) ? 1 : 0)
     328        1209 :     .Case("dllimport", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64 || T.getArch() == llvm::Triple::arm || T.getArch() == llvm::Triple::thumb || T.getArch() == llvm::Triple::aarch64) && (T.getOS() == llvm::Triple::Win32) ? 1 : 0)
     329        1209 :     .Case("deprecated", 1)
     330        1209 :     .Case("empty_bases", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64 || T.getArch() == llvm::Triple::arm || T.getArch() == llvm::Triple::thumb || T.getArch() == llvm::Triple::aarch64) && (Target.getCXXABI().getKind() == TargetCXXABI::Microsoft) ? 1 : 0)
     331        1209 :     .Case("layout_version", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64 || T.getArch() == llvm::Triple::arm || T.getArch() == llvm::Triple::thumb || T.getArch() == llvm::Triple::aarch64) && (Target.getCXXABI().getKind() == TargetCXXABI::Microsoft) ? 1 : 0)
     332        1209 :     .Case("novtable", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64 || T.getArch() == llvm::Triple::arm || T.getArch() == llvm::Triple::thumb || T.getArch() == llvm::Triple::aarch64) && (Target.getCXXABI().getKind() == TargetCXXABI::Microsoft) ? 1 : 0)
     333        1209 :     .Case("naked", 1)
     334        1209 :     .Case("noalias", 1)
     335        1209 :     .Case("noinline", 1)
     336        1209 :     .Case("noreturn", 1)
     337        1209 :     .Case("nothrow", 1)
     338        1209 :     .Case("restrict", 1)
     339        1209 :     .Case("allocate", 1)
     340        1209 :     .Case("selectany", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64 || T.getArch() == llvm::Triple::arm || T.getArch() == llvm::Triple::thumb || T.getArch() == llvm::Triple::aarch64) && (T.getOS() == llvm::Triple::Win32) ? 1 : 0)
     341        1209 :     .Case("thread", 1)
     342        1209 :     .Case("uuid", 1)
     343        1209 :     .Case("property", 1)
     344         806 :     .Default(0);
     345           0 : case AttrSyntax::Microsoft:
     346           0 :   return llvm::StringSwitch<int>(Name)
     347           0 :     .Case("uuid", 1)
     348           0 :     .Default(0);
     349           0 : case AttrSyntax::Pragma:
     350           0 :   return llvm::StringSwitch<int>(Name)
     351           0 :     .Case("init_seg", 1)
     352           0 :     .Case("loop", 1)
     353           0 :     .Case("unroll", 1)
     354           0 :     .Case("nounroll", 1)
     355           0 :     .Case("loop", 1)
     356           0 :     .Case("unroll", 1)
     357           0 :     .Case("nounroll", 1)
     358           0 :     .Case("loop", 1)
     359           0 :     .Case("unroll", 1)
     360           0 :     .Case("nounroll", 1)
     361           0 :     .Case("declare simd", 1)
     362           0 :     .Case("declare target", 1)
     363           0 :     .Default(0);
     364          98 : case AttrSyntax::CXX: {
     365         224 : if (!Scope || Scope->getName() == "") {
     366          35 :   return llvm::StringSwitch<int>(Name)
     367         105 :     .Case("noreturn", LangOpts.CPlusPlus11 ? 200809 : 0)
     368         105 :     .Case("carries_dependency", LangOpts.CPlusPlus11 ? 200809 : 0)
     369         105 :     .Case("deprecated", LangOpts.CPlusPlus11 ? 201309 : 0)
     370         105 :     .Case("deprecated", LangOpts.CPlusPlus11 ? 201309 : 0)
     371         105 :     .Case("fallthrough", LangOpts.CPlusPlus11 ? 201603 : 0)
     372         105 :     .Case("fallthrough", LangOpts.CPlusPlus11 ? 201603 : 0)
     373         105 :     .Case("maybe_unused", LangOpts.CPlusPlus11 ? 201603 : 0)
     374         105 :     .Case("unused", LangOpts.CPlusPlus11 ? 201603 : 0)
     375         105 :     .Case("nodiscard", LangOpts.CPlusPlus11 ? 201603 : 0)
     376         105 :     .Case("warn_unused_result", LangOpts.CPlusPlus11 ? 201603 : 0)
     377         105 :     .Case("warn_unused_result", LangOpts.CPlusPlus11 ? 201603 : 0)
     378          70 :     .Default(0);
     379         145 : } else if (Scope->getName() == "clang") {
     380          19 :   return llvm::StringSwitch<int>(Name)
     381          57 :     .Case("acquire_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     382          57 :     .Case("acquire_shared_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     383          57 :     .Case("acquire_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     384          57 :     .Case("acquire_shared_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     385          57 :     .Case("assert_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     386          57 :     .Case("assert_shared_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     387          57 :     .Case("assert_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     388          57 :     .Case("assert_shared_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     389          57 :     .Case("capability", LangOpts.CPlusPlus11 ? 1 : 0)
     390          57 :     .Case("shared_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     391          57 :     .Case("capability", LangOpts.CPlusPlus11 ? 1 : 0)
     392          57 :     .Case("shared_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     393          57 :     .Case("convergent", LangOpts.CPlusPlus11 ? 1 : 0)
     394          57 :     .Case("disable_tail_calls", LangOpts.CPlusPlus11 ? 1 : 0)
     395          57 :     .Case("enum_extensibility", LangOpts.CPlusPlus11 ? 1 : 0)
     396          57 :     .Case("external_source_symbol", LangOpts.CPlusPlus11 ? 1 : 0)
     397          57 :     .Case("fallthrough", LangOpts.CPlusPlus11 ? 201603 : 0)
     398          57 :     .Case("internal_linkage", LangOpts.CPlusPlus11 ? 1 : 0)
     399          57 :     .Case("lto_visibility_public", LangOpts.CPlusPlus11 ? 1 : 0)
     400          57 :     .Case("noduplicate", LangOpts.CPlusPlus11 ? 1 : 0)
     401          57 :     .Case("no_sanitize", LangOpts.CPlusPlus11 ? 1 : 0)
     402          57 :     .Case("not_tail_called", LangOpts.CPlusPlus11 ? 1 : 0)
     403          57 :     .Case("optnone", LangOpts.CPlusPlus11 ? 1 : 0)
     404          57 :     .Case("release_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     405          57 :     .Case("release_shared_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     406          57 :     .Case("release_generic_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     407          57 :     .Case("release_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     408          57 :     .Case("release_shared_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     409          57 :     .Case("release_generic_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     410          57 :     .Case("release_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     411          57 :     .Case("release_shared_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     412          57 :     .Case("release_generic_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     413          57 :     .Case("require_constant_initialization", LangOpts.CPlusPlus11 ? 1 : 0)
     414          57 :     .Case("requires_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     415          57 :     .Case("requires_shared_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     416          57 :     .Case("requires_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     417          57 :     .Case("requires_shared_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     418          57 :     .Case("try_acquire_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     419          57 :     .Case("try_acquire_shared_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     420          57 :     .Case("try_acquire_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     421          57 :     .Case("try_acquire_shared_capability", LangOpts.CPlusPlus11 ? 1 : 0)
     422          57 :     .Case("type_visibility", LangOpts.CPlusPlus11 ? 1 : 0)
     423          57 :     .Case("warn_unused_result", LangOpts.CPlusPlus11 ? 201603 : 0)
     424          57 :     .Case("xray_always_instrument", LangOpts.CPlusPlus11 ? 1 : 0)
     425          57 :     .Case("xray_never_instrument", LangOpts.CPlusPlus11 ? 1 : 0)
     426          57 :     .Case("xray_always_instrument", LangOpts.CPlusPlus11 ? 1 : 0)
     427          57 :     .Case("xray_never_instrument", LangOpts.CPlusPlus11 ? 1 : 0)
     428          57 :     .Case("xray_log_args", LangOpts.CPlusPlus11 ? 1 : 0)
     429          38 :     .Default(0);
     430         116 : } else if (Scope->getName() == "gnu") {
     431          28 :   return llvm::StringSwitch<int>(Name)
     432          84 :     .Case("abi_tag", LangOpts.CPlusPlus11 ? 1 : 0)
     433          84 :     .Case("alias", LangOpts.CPlusPlus11 ? 1 : 0)
     434          84 :     .Case("aligned", LangOpts.CPlusPlus11 ? 1 : 0)
     435          84 :     .Case("alloc_align", LangOpts.CPlusPlus11 ? 1 : 0)
     436          84 :     .Case("alloc_size", LangOpts.CPlusPlus11 ? 1 : 0)
     437          84 :     .Case("always_inline", LangOpts.CPlusPlus11 ? 1 : 0)
     438          84 :     .Case("no_caller_saved_registers", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64) && LangOpts.CPlusPlus11 ? 1 : 0)
     439          84 :     .Case("assume_aligned", LangOpts.CPlusPlus11 ? 1 : 0)
     440          84 :     .Case("cdecl", LangOpts.CPlusPlus11 ? 1 : 0)
     441          84 :     .Case("cleanup", LangOpts.CPlusPlus11 ? 1 : 0)
     442          84 :     .Case("cold", LangOpts.CPlusPlus11 ? 1 : 0)
     443          84 :     .Case("common", LangOpts.CPlusPlus11 ? 1 : 0)
     444          84 :     .Case("const", LangOpts.CPlusPlus11 ? 1 : 0)
     445          84 :     .Case("__const", LangOpts.CPlusPlus11 ? 1 : 0)
     446          84 :     .Case("const", LangOpts.CPlusPlus11 ? 1 : 0)
     447          84 :     .Case("__const", LangOpts.CPlusPlus11 ? 1 : 0)
     448          84 :     .Case("constructor", LangOpts.CPlusPlus11 ? 1 : 0)
     449          84 :     .Case("dllexport", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64 || T.getArch() == llvm::Triple::arm || T.getArch() == llvm::Triple::thumb || T.getArch() == llvm::Triple::aarch64) && (T.getOS() == llvm::Triple::Win32) && LangOpts.CPlusPlus11 ? 1 : 0)
     450          84 :     .Case("dllimport", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64 || T.getArch() == llvm::Triple::arm || T.getArch() == llvm::Triple::thumb || T.getArch() == llvm::Triple::aarch64) && (T.getOS() == llvm::Triple::Win32) && LangOpts.CPlusPlus11 ? 1 : 0)
     451          84 :     .Case("deprecated", LangOpts.CPlusPlus11 ? 201309 : 0)
     452          84 :     .Case("destructor", LangOpts.CPlusPlus11 ? 1 : 0)
     453          84 :     .Case("fastcall", LangOpts.CPlusPlus11 ? 1 : 0)
     454          84 :     .Case("flatten", LangOpts.CPlusPlus11 ? 1 : 0)
     455          84 :     .Case("format", LangOpts.CPlusPlus11 ? 1 : 0)
     456          84 :     .Case("format_arg", LangOpts.CPlusPlus11 ? 1 : 0)
     457          84 :     .Case("gnu_inline", LangOpts.CPlusPlus11 ? 1 : 0)
     458          84 :     .Case("hot", LangOpts.CPlusPlus11 ? 1 : 0)
     459          84 :     .Case("ifunc", LangOpts.CPlusPlus11 ? 1 : 0)
     460          84 :     .Case("ms_abi", LangOpts.CPlusPlus11 ? 1 : 0)
     461          84 :     .Case("ms_struct", LangOpts.CPlusPlus11 ? 1 : 0)
     462          84 :     .Case("may_alias", LangOpts.CPlusPlus11 ? 1 : 0)
     463          84 :     .Case("micromips", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel) && LangOpts.CPlusPlus11 ? 1 : 0)
     464          84 :     .Case("mips16", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel) && LangOpts.CPlusPlus11 ? 1 : 0)
     465          84 :     .Case("long_call", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) && LangOpts.CPlusPlus11 ? 1 : 0)
     466          84 :     .Case("far", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) && LangOpts.CPlusPlus11 ? 1 : 0)
     467          84 :     .Case("long_call", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) && LangOpts.CPlusPlus11 ? 1 : 0)
     468          84 :     .Case("far", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) && LangOpts.CPlusPlus11 ? 1 : 0)
     469          84 :     .Case("short_call", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) && LangOpts.CPlusPlus11 ? 1 : 0)
     470          84 :     .Case("near", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) && LangOpts.CPlusPlus11 ? 1 : 0)
     471          84 :     .Case("short_call", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) && LangOpts.CPlusPlus11 ? 1 : 0)
     472          84 :     .Case("near", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel || T.getArch() == llvm::Triple::mips64 || T.getArch() == llvm::Triple::mips64el) && LangOpts.CPlusPlus11 ? 1 : 0)
     473          84 :     .Case("mode", LangOpts.CPlusPlus11 ? 1 : 0)
     474          84 :     .Case("naked", LangOpts.CPlusPlus11 ? 1 : 0)
     475          84 :     .Case("nocommon", LangOpts.CPlusPlus11 ? 1 : 0)
     476          84 :     .Case("nodebug", LangOpts.CPlusPlus11 ? 1 : 0)
     477          84 :     .Case("noinline", LangOpts.CPlusPlus11 ? 1 : 0)
     478          84 :     .Case("no_instrument_function", LangOpts.CPlusPlus11 ? 1 : 0)
     479          84 :     .Case("nomicromips", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel) && LangOpts.CPlusPlus11 ? 1 : 0)
     480          84 :     .Case("nomips16", (T.getArch() == llvm::Triple::mips || T.getArch() == llvm::Triple::mipsel) && LangOpts.CPlusPlus11 ? 1 : 0)
     481          84 :     .Case("noreturn", LangOpts.CPlusPlus11 ? 1 : 0)
     482          84 :     .Case("no_address_safety_analysis", LangOpts.CPlusPlus11 ? 1 : 0)
     483          84 :     .Case("no_sanitize_address", LangOpts.CPlusPlus11 ? 1 : 0)
     484          84 :     .Case("no_sanitize_thread", LangOpts.CPlusPlus11 ? 1 : 0)
     485          84 :     .Case("no_address_safety_analysis", LangOpts.CPlusPlus11 ? 1 : 0)
     486          84 :     .Case("no_sanitize_address", LangOpts.CPlusPlus11 ? 1 : 0)
     487          84 :     .Case("no_sanitize_thread", LangOpts.CPlusPlus11 ? 1 : 0)
     488          84 :     .Case("no_address_safety_analysis", LangOpts.CPlusPlus11 ? 1 : 0)
     489          84 :     .Case("no_sanitize_address", LangOpts.CPlusPlus11 ? 1 : 0)
     490          84 :     .Case("no_sanitize_thread", LangOpts.CPlusPlus11 ? 1 : 0)
     491          84 :     .Case("no_split_stack", LangOpts.CPlusPlus11 ? 1 : 0)
     492          84 :     .Case("nothrow", LangOpts.CPlusPlus11 ? 1 : 0)
     493          84 :     .Case("nonnull", LangOpts.CPlusPlus11 ? 1 : 0)
     494          84 :     .Case("packed", LangOpts.CPlusPlus11 ? 1 : 0)
     495          84 :     .Case("pcs", LangOpts.CPlusPlus11 ? 1 : 0)
     496          84 :     .Case("pure", LangOpts.CPlusPlus11 ? 1 : 0)
     497          84 :     .Case("regcall", LangOpts.CPlusPlus11 ? 1 : 0)
     498          84 :     .Case("regparm", LangOpts.CPlusPlus11 ? 1 : 0)
     499          84 :     .Case("malloc", LangOpts.CPlusPlus11 ? 1 : 0)
     500          84 :     .Case("returns_nonnull", LangOpts.CPlusPlus11 ? 1 : 0)
     501          84 :     .Case("returns_twice", LangOpts.CPlusPlus11 ? 1 : 0)
     502          84 :     .Case("section", LangOpts.CPlusPlus11 ? 1 : 0)
     503          84 :     .Case("selectany", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64 || T.getArch() == llvm::Triple::arm || T.getArch() == llvm::Triple::thumb || T.getArch() == llvm::Triple::aarch64) && (T.getOS() == llvm::Triple::Win32) && LangOpts.CPlusPlus11 ? 1 : 0)
     504          84 :     .Case("sentinel", LangOpts.CPlusPlus11 ? 1 : 0)
     505          84 :     .Case("stdcall", LangOpts.CPlusPlus11 ? 1 : 0)
     506          84 :     .Case("swiftcall", LangOpts.CPlusPlus11 ? 1 : 0)
     507          84 :     .Case("swift_context", LangOpts.CPlusPlus11 ? 1 : 0)
     508          84 :     .Case("swift_error_result", LangOpts.CPlusPlus11 ? 1 : 0)
     509          84 :     .Case("swift_indirect_result", LangOpts.CPlusPlus11 ? 1 : 0)
     510          84 :     .Case("sysv_abi", LangOpts.CPlusPlus11 ? 1 : 0)
     511          84 :     .Case("tls_model", LangOpts.CPlusPlus11 ? 1 : 0)
     512          84 :     .Case("target", LangOpts.CPlusPlus11 ? 1 : 0)
     513          84 :     .Case("thiscall", LangOpts.CPlusPlus11 ? 1 : 0)
     514          84 :     .Case("transparent_union", LangOpts.CPlusPlus11 ? 1 : 0)
     515          84 :     .Case("unused", LangOpts.CPlusPlus11 ? 201603 : 0)
     516          84 :     .Case("used", LangOpts.CPlusPlus11 ? 1 : 0)
     517          84 :     .Case("vector_size", LangOpts.CPlusPlus11 ? 1 : 0)
     518          84 :     .Case("visibility", LangOpts.CPlusPlus11 ? 1 : 0)
     519          84 :     .Case("warn_unused_result", LangOpts.CPlusPlus11 ? 201603 : 0)
     520          84 :     .Case("weak", LangOpts.CPlusPlus11 ? 1 : 0)
     521          84 :     .Case("weakref", LangOpts.CPlusPlus11 ? 1 : 0)
     522          84 :     .Case("force_align_arg_pointer", (T.getArch() == llvm::Triple::x86 || T.getArch() == llvm::Triple::x86_64) && LangOpts.CPlusPlus11 ? 1 : 0)
     523          56 :     .Default(0);
     524          43 : } else if (Scope->getName() == "gsl") {
     525          11 :   return llvm::StringSwitch<int>(Name)
     526          33 :     .Case("suppress", LangOpts.CPlusPlus11 ? 1 : 0)
     527          22 :     .Default(0);
     528             : }
     529             : }
     530             : }

Generated by: LCOV version 1.13