From: Alexey Samsonov Date: Tue, 11 Nov 2014 00:22:12 +0000 (+0000) Subject: Move CodeGenOptions constructor out-of-line and add missing headers. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98feb8146b4077bb70ba7cfc443263a0121fdd0a;p=clang Move CodeGenOptions constructor out-of-line and add missing headers. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221646 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Frontend/CodeGenOptions.h b/include/clang/Frontend/CodeGenOptions.h index 3940384cc1..4e6171fbfe 100644 --- a/include/clang/Frontend/CodeGenOptions.h +++ b/include/clang/Frontend/CodeGenOptions.h @@ -14,6 +14,7 @@ #ifndef LLVM_CLANG_FRONTEND_CODEGENOPTIONS_H #define LLVM_CLANG_FRONTEND_CODEGENOPTIONS_H +#include #include #include #include "llvm/Support/Regex.h" @@ -183,15 +184,7 @@ public: void set##Name(Type Value) { Name = static_cast(Value); } #include "clang/Frontend/CodeGenOptions.def" - CodeGenOptions() { -#define CODEGENOPT(Name, Bits, Default) Name = Default; -#define ENUM_CODEGENOPT(Name, Type, Bits, Default) \ - set##Name(Default); -#include "clang/Frontend/CodeGenOptions.def" - - RelocationModel = "pic"; - memcpy(CoverageVersion, "402*", 4); - } + CodeGenOptions(); }; } // end namespace clang diff --git a/lib/Frontend/CMakeLists.txt b/lib/Frontend/CMakeLists.txt index 228bd8915c..7c5fca54d1 100644 --- a/lib/Frontend/CMakeLists.txt +++ b/lib/Frontend/CMakeLists.txt @@ -13,6 +13,7 @@ add_clang_library(clangFrontend CacheTokens.cpp ChainedDiagnosticConsumer.cpp ChainedIncludesSource.cpp + CodeGenOptions.cpp CompilerInstance.cpp CompilerInvocation.cpp CreateInvocationFromCommandLine.cpp diff --git a/lib/Frontend/CodeGenOptions.cpp b/lib/Frontend/CodeGenOptions.cpp new file mode 100644 index 0000000000..4fa28b4760 --- /dev/null +++ b/lib/Frontend/CodeGenOptions.cpp @@ -0,0 +1,24 @@ +//===--- CodeGenOptions.cpp -----------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include +#include "clang/Frontend/CodeGenOptions.h" + +namespace clang { + +CodeGenOptions::CodeGenOptions() { +#define CODEGENOPT(Name, Bits, Default) Name = Default; +#define ENUM_CODEGENOPT(Name, Type, Bits, Default) set##Name(Default); +#include "clang/Frontend/CodeGenOptions.def" + + RelocationModel = "pic"; + memcpy(CoverageVersion, "402*", 4); +} + +} // end namespace clang