mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-01 13:20:25 +00:00
3ee1ec0b9d
Fixes a layering violation introduced in 2ba4e3a459
.
59 lines
1.9 KiB
C++
59 lines
1.9 KiB
C++
//===- LangOptions.cpp - C Language Family Language Options ---------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines the LangOptions class.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "clang/Basic/LangOptions.h"
|
|
|
|
using namespace clang;
|
|
|
|
LangOptions::LangOptions() {
|
|
#define LANGOPT(Name, Bits, Default, Description) Name = Default;
|
|
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) set##Name(Default);
|
|
#include "clang/Basic/LangOptions.def"
|
|
}
|
|
|
|
void LangOptions::resetNonModularOptions() {
|
|
#define LANGOPT(Name, Bits, Default, Description)
|
|
#define BENIGN_LANGOPT(Name, Bits, Default, Description) Name = Default;
|
|
#define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
|
|
Name = Default;
|
|
#include "clang/Basic/LangOptions.def"
|
|
|
|
// These options do not affect AST generation.
|
|
SanitizerBlacklistFiles.clear();
|
|
XRayAlwaysInstrumentFiles.clear();
|
|
XRayNeverInstrumentFiles.clear();
|
|
|
|
CurrentModule.clear();
|
|
IsHeaderFile = false;
|
|
}
|
|
|
|
bool LangOptions::isNoBuiltinFunc(StringRef FuncName) const {
|
|
for (unsigned i = 0, e = NoBuiltinFuncs.size(); i != e; ++i)
|
|
if (FuncName.equals(NoBuiltinFuncs[i]))
|
|
return true;
|
|
return false;
|
|
}
|
|
|
|
VersionTuple LangOptions::getOpenCLVersionTuple() const {
|
|
const int Ver = OpenCLCPlusPlus ? OpenCLCPlusPlusVersion : OpenCLVersion;
|
|
return VersionTuple(Ver / 100, (Ver % 100) / 10);
|
|
}
|
|
|
|
FPOptions FPOptions::defaultWithoutTrailingStorage(const LangOptions &LO) {
|
|
FPOptions result(LO);
|
|
return result;
|
|
}
|
|
|
|
bool FPOptions::requiresTrailingStorage(const LangOptions &LO) {
|
|
return getAsOpaqueInt() != defaultWithoutTrailingStorage(LO).getAsOpaqueInt();
|
|
}
|