opnsense-src/include/clang/Frontend/CodeGenOptions.h

130 lines
4 KiB
C
Raw Normal View History

2009-11-18 09:59:57 -05:00
//===--- CodeGenOptions.h ---------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the CodeGenOptions interface.
//
//===----------------------------------------------------------------------===//
2010-07-13 13:21:42 -04:00
#ifndef LLVM_CLANG_FRONTEND_CODEGENOPTIONS_H
#define LLVM_CLANG_FRONTEND_CODEGENOPTIONS_H
2009-11-18 09:59:57 -05:00
#include <string>
#include <vector>
2009-11-18 09:59:57 -05:00
namespace clang {
/// \brief Bitfields of CodeGenOptions, split out from CodeGenOptions to ensure
/// that this large collection of bitfields is a trivial class type.
class CodeGenOptionsBase {
public:
#define CODEGENOPT(Name, Bits, Default) unsigned Name : Bits;
#define ENUM_CODEGENOPT(Name, Type, Bits, Default)
#include "clang/Frontend/CodeGenOptions.def"
protected:
#define CODEGENOPT(Name, Bits, Default)
#define ENUM_CODEGENOPT(Name, Type, Bits, Default) unsigned Name : Bits;
#include "clang/Frontend/CodeGenOptions.def"
};
2009-11-18 09:59:57 -05:00
/// CodeGenOptions - Track various options which control how the code
/// is optimized and passed to the backend.
class CodeGenOptions : public CodeGenOptionsBase {
2009-11-18 09:59:57 -05:00
public:
enum InliningMethod {
NoInlining, // Perform no inlining whatsoever.
NormalInlining, // Use the standard function inlining pass.
OnlyAlwaysInlining // Only run the always inlining pass.
};
2010-05-04 12:12:48 -04:00
enum ObjCDispatchMethodKind {
Legacy = 0,
NonLegacy = 1,
Mixed = 2
};
enum DebugInfoKind {
NoDebugInfo, // Don't generate debug info.
DebugLineTablesOnly, // Emit only debug info necessary for generating
// line number tables (-gline-tables-only).
LimitedDebugInfo, // Limit generated debug info to reduce size
// (-flimit-debug-info).
FullDebugInfo // Generate complete debug info.
};
enum TLSModel {
GeneralDynamicTLSModel,
LocalDynamicTLSModel,
InitialExecTLSModel,
LocalExecTLSModel
};
2009-12-01 06:08:04 -05:00
/// The code model to use (-mcmodel).
std::string CodeModel;
/// The filename with path we use for coverage files. The extension will be
/// replaced.
std::string CoverageFile;
2009-12-01 06:08:04 -05:00
/// Enable additional debugging information.
std::string DebugPass;
/// The string to embed in debug information as the current working directory.
std::string DebugCompilationDir;
2010-01-01 05:34:51 -05:00
/// The string to embed in the debug information for the compile unit, if
/// non-empty.
std::string DwarfDebugFlags;
2009-12-01 06:08:04 -05:00
/// The ABI to use for passing floating point arguments.
std::string FloatABI;
/// The float precision limit to use, if non-empty.
std::string LimitFloatPrecision;
/// The name of the bitcode file to link before optzns.
std::string LinkBitcodeFile;
2009-12-01 06:08:04 -05:00
/// The user provided name for the "main file", if non-empty. This is useful
/// in situations where the input file name does not match the original input
/// file, for example with -save-temps.
std::string MainFileName;
/// The name of the relocation model to use.
std::string RelocationModel;
/// If not an empty string, trap intrinsics are lowered to calls to this
/// function instead of to trap instructions.
std::string TrapFuncName;
/// A list of command-line options to forward to the LLVM backend.
std::vector<std::string> BackendOptions;
2009-11-18 09:59:57 -05:00
public:
// Define accessors/mutators for code generation options of enumeration type.
#define CODEGENOPT(Name, Bits, Default)
#define ENUM_CODEGENOPT(Name, Type, Bits, Default) \
Type get##Name() const { return static_cast<Type>(Name); } \
void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
#include "clang/Frontend/CodeGenOptions.def"
2009-11-18 09:59:57 -05:00
CodeGenOptions() {
#define CODEGENOPT(Name, Bits, Default) Name = Default;
#define ENUM_CODEGENOPT(Name, Type, Bits, Default) \
set##Name(Default);
#include "clang/Frontend/CodeGenOptions.def"
2009-12-01 06:08:04 -05:00
RelocationModel = "pic";
2010-05-04 12:12:48 -04:00
}
2009-11-18 09:59:57 -05:00
};
} // end namespace clang
#endif