Coverage Report

Created: 2023-05-31 04:38

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/AST/Interp/InterpBuiltin.cpp
Line
Count
Source (jump to first uncovered line)
1
//===--- InterpBuiltin.cpp - Interpreter for the constexpr VM ---*- 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
//===----------------------------------------------------------------------===//
8
#include "Boolean.h"
9
#include "Interp.h"
10
#include "PrimType.h"
11
#include "clang/Basic/Builtins.h"
12
13
namespace clang {
14
namespace interp {
15
16
16
bool InterpretBuiltin(InterpState &S, CodePtr &PC, unsigned BuiltinID) {
17
16
  APValue Dummy;
18
19
16
  switch (BuiltinID) {
20
8
  case Builtin::BI__builtin_is_constant_evaluated:
21
8
    S.Stk.push<Boolean>(Boolean::from(S.inConstantContext()));
22
8
    return Ret<PT_Bool, true>(S, PC, Dummy);
23
8
  case Builtin::BI__builtin_assume:
24
8
    return RetVoid<true>(S, PC, Dummy);
25
0
  default:
26
0
    return false;
27
16
  }
28
29
0
  return false;
30
16
}
31
32
} // namespace interp
33
} // namespace clang