Coverage Report

Created: 2022-07-16 07:03

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/Basic/Targets/VE.cpp
Line
Count
Source
1
//===--- VE.cpp - Implement VE target feature support ---------------------===//
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
//
9
// This file implements VE TargetInfo objects.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#include "VE.h"
14
#include "clang/Basic/Builtins.h"
15
#include "clang/Basic/MacroBuilder.h"
16
#include "clang/Basic/TargetBuiltins.h"
17
18
using namespace clang;
19
using namespace clang::targets;
20
21
const Builtin::Info VETargetInfo::BuiltinInfo[] = {
22
#define BUILTIN(ID, TYPE, ATTRS)                                               \
23
  {#ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr},
24
#include "clang/Basic/BuiltinsVE.def"
25
};
26
27
void VETargetInfo::getTargetDefines(const LangOptions &Opts,
28
3
                                    MacroBuilder &Builder) const {
29
3
  Builder.defineMacro("_LP64", "1");
30
3
  Builder.defineMacro("unix", "1");
31
3
  Builder.defineMacro("__unix__", "1");
32
3
  Builder.defineMacro("__linux__", "1");
33
3
  Builder.defineMacro("__ve", "1");
34
3
  Builder.defineMacro("__ve__", "1");
35
3
  Builder.defineMacro("__STDC_HOSTED__", "1");
36
3
  Builder.defineMacro("__STDC__", "1");
37
3
  Builder.defineMacro("__NEC__", "1");
38
  // FIXME: define __FAST_MATH__ 1 if -ffast-math is enabled
39
  // FIXME: define __OPTIMIZE__ n if -On is enabled
40
  // FIXME: define __VECTOR__ n 1 if automatic vectorization is enabled
41
3
}
42
43
3
ArrayRef<Builtin::Info> VETargetInfo::getTargetBuiltins() const {
44
3
  return llvm::makeArrayRef(BuiltinInfo,
45
3
                            clang::VE::LastTSBuiltin - Builtin::FirstTSBuiltin);
46
3
}