aboutsummaryrefslogtreecommitdiff
path: root/include/clang/CodeGen/CodeGenOptions.h
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2009-11-12 17:24:48 +0000
committerChandler Carruth <chandlerc@gmail.com>2009-11-12 17:24:48 +0000
commit2811ccf48d6d898c42cc4cfad37abedb36236d20 (patch)
tree283a52cb33efc6e98cb15cacf2ecc63f3707cae7 /include/clang/CodeGen/CodeGenOptions.h
parent95c5d8ac29ba3423e735a0732713907e484b800d (diff)
Move CompileOptions -> CodeGenOptions, and sink it into the CodeGen library.
This resolves the layering violation where CodeGen depended on Frontend. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86998 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/CodeGen/CodeGenOptions.h')
-rw-r--r--include/clang/CodeGen/CodeGenOptions.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/include/clang/CodeGen/CodeGenOptions.h b/include/clang/CodeGen/CodeGenOptions.h
new file mode 100644
index 0000000000..c076ec095f
--- /dev/null
+++ b/include/clang/CodeGen/CodeGenOptions.h
@@ -0,0 +1,82 @@
+//===--- 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.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_CODEGEN_CODEGENOPTIONS_H
+#define LLVM_CLANG_CODEGEN_CODEGENOPTIONS_H
+
+#include <string>
+#include <vector>
+
+namespace clang {
+
+/// CodeGenOptions - Track various options which control how the code
+/// is optimized and passed to the backend.
+class CodeGenOptions {
+public:
+ enum InliningMethod {
+ NoInlining, // Perform no inlining whatsoever.
+ NormalInlining, // Use the standard function inlining pass.
+ OnlyAlwaysInlining // Only run the always inlining pass.
+ };
+
+ unsigned OptimizationLevel : 3; /// The -O[0-4] option specified.
+ unsigned OptimizeSize : 1; /// If -Os is specified.
+ unsigned DebugInfo : 1; /// Should generate deubg info (-g).
+ unsigned UnitAtATime : 1; /// Unused. For mirroring GCC
+ /// optimization selection.
+ unsigned SimplifyLibCalls : 1; /// Should standard library calls be
+ /// treated specially.
+ unsigned UnrollLoops : 1; /// Control whether loops are unrolled.
+ unsigned VerifyModule : 1; /// Control whether the module
+ /// should be run through the LLVM Verifier.
+ unsigned TimePasses : 1; /// Set when -ftime-report is enabled.
+ unsigned NoCommon : 1; /// Set when -fno-common or C++ is enabled.
+ unsigned DisableRedZone : 1; /// Set when -mno-red-zone is enabled.
+ unsigned NoImplicitFloat : 1; /// Set when -mno-implicit-float is enabled.
+ unsigned MergeAllConstants : 1; /// Merge identical constants.
+ unsigned DisableLLVMOpts : 1; /// Don't run any optimizations, for use in
+ /// getting .bc files that correspond to the
+ /// internal state before optimizations are
+ /// done.
+
+ /// Inlining - The kind of inlining to perform.
+ InliningMethod Inlining;
+
+ /// CPU - An optional CPU to target.
+ std::string CPU;
+
+ /// Features - A list of subtarget features to pass to the code
+ /// generator.
+ std::vector<std::string> Features;
+
+public:
+ CodeGenOptions() {
+ OptimizationLevel = 0;
+ OptimizeSize = 0;
+ DebugInfo = 0;
+ UnitAtATime = 1;
+ SimplifyLibCalls = UnrollLoops = 0;
+ VerifyModule = 1;
+ TimePasses = 0;
+ NoCommon = 0;
+ Inlining = NoInlining;
+ DisableRedZone = 0;
+ NoImplicitFloat = 0;
+ MergeAllConstants = 1;
+ DisableLLVMOpts = 0;
+ }
+};
+
+} // end namespace clang
+
+#endif