Browse Source

revert SVN r265702, r265640

Revert the two changes to thread CodeGenOptions into the TargetInfo allocation
and to fix the layering violation by moving CodeGenOptions into Basic.
Code Generation is arguably not particularly "basic".  This addresses Richard's
post-commit review comments.  This change purely does the mechanical revert and
will be followed up with an alternate approach to thread the desired information
into TargetInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265806 91177308-0d34-0410-b5e6-96231b3b80d8
Saleem Abdulrasool 9 years ago
parent
commit
fdc51a5580

+ 1 - 4
include/clang/Basic/TargetInfo.h

@@ -16,7 +16,6 @@
 #define LLVM_CLANG_BASIC_TARGETINFO_H
 #define LLVM_CLANG_BASIC_TARGETINFO_H
 
 
 #include "clang/Basic/AddressSpaces.h"
 #include "clang/Basic/AddressSpaces.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/Specifiers.h"
 #include "clang/Basic/Specifiers.h"
 #include "clang/Basic/TargetCXXABI.h"
 #include "clang/Basic/TargetCXXABI.h"
@@ -31,7 +30,6 @@
 #include "llvm/ADT/Triple.h"
 #include "llvm/ADT/Triple.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/DataTypes.h"
-
 #include <cassert>
 #include <cassert>
 #include <string>
 #include <string>
 #include <vector>
 #include <vector>
@@ -109,8 +107,7 @@ public:
   /// what the backend expects.
   /// what the backend expects.
   static TargetInfo *
   static TargetInfo *
   CreateTargetInfo(DiagnosticsEngine &Diags,
   CreateTargetInfo(DiagnosticsEngine &Diags,
-                   const std::shared_ptr<TargetOptions> &Opts,
-                   const CodeGenOptions &CGOpts = CodeGenOptions());
+                   const std::shared_ptr<TargetOptions> &Opts);
 
 
   virtual ~TargetInfo();
   virtual ~TargetInfo();
 
 

+ 0 - 0
include/clang/Basic/CodeGenOptions.def → include/clang/Frontend/CodeGenOptions.def


+ 5 - 6
include/clang/Basic/CodeGenOptions.h → include/clang/Frontend/CodeGenOptions.h

@@ -11,14 +11,13 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
-#ifndef LLVM_CLANG_BASIC_CODEGENOPTIONS_H
-#define LLVM_CLANG_BASIC_CODEGENOPTIONS_H
+#ifndef LLVM_CLANG_FRONTEND_CODEGENOPTIONS_H
+#define LLVM_CLANG_FRONTEND_CODEGENOPTIONS_H
 
 
 #include "clang/Basic/DebugInfoOptions.h"
 #include "clang/Basic/DebugInfoOptions.h"
 #include "clang/Basic/Sanitizers.h"
 #include "clang/Basic/Sanitizers.h"
 #include "llvm/Support/Regex.h"
 #include "llvm/Support/Regex.h"
 #include "llvm/Target/TargetOptions.h"
 #include "llvm/Target/TargetOptions.h"
-
 #include <map>
 #include <map>
 #include <memory>
 #include <memory>
 #include <string>
 #include <string>
@@ -32,12 +31,12 @@ class CodeGenOptionsBase {
 public:
 public:
 #define CODEGENOPT(Name, Bits, Default) unsigned Name : Bits;
 #define CODEGENOPT(Name, Bits, Default) unsigned Name : Bits;
 #define ENUM_CODEGENOPT(Name, Type, Bits, Default)
 #define ENUM_CODEGENOPT(Name, Type, Bits, Default)
-#include "clang/Basic/CodeGenOptions.def"
+#include "clang/Frontend/CodeGenOptions.def"
 
 
 protected:
 protected:
 #define CODEGENOPT(Name, Bits, Default)
 #define CODEGENOPT(Name, Bits, Default)
 #define ENUM_CODEGENOPT(Name, Type, Bits, Default) unsigned Name : Bits;
 #define ENUM_CODEGENOPT(Name, Type, Bits, Default) unsigned Name : Bits;
-#include "clang/Basic/CodeGenOptions.def"
+#include "clang/Frontend/CodeGenOptions.def"
 };
 };
 
 
 /// CodeGenOptions - Track various options which control how the code
 /// CodeGenOptions - Track various options which control how the code
@@ -212,7 +211,7 @@ public:
 #define ENUM_CODEGENOPT(Name, Type, Bits, Default) \
 #define ENUM_CODEGENOPT(Name, Type, Bits, Default) \
   Type get##Name() const { return static_cast<Type>(Name); } \
   Type get##Name() const { return static_cast<Type>(Name); } \
   void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
   void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
-#include "clang/Basic/CodeGenOptions.def"
+#include "clang/Frontend/CodeGenOptions.def"
 
 
   CodeGenOptions();
   CodeGenOptions();
 
 

+ 1 - 2
include/clang/Frontend/CompilerInvocation.h

@@ -10,11 +10,11 @@
 #ifndef LLVM_CLANG_FRONTEND_COMPILERINVOCATION_H_
 #ifndef LLVM_CLANG_FRONTEND_COMPILERINVOCATION_H_
 #define LLVM_CLANG_FRONTEND_COMPILERINVOCATION_H_
 #define LLVM_CLANG_FRONTEND_COMPILERINVOCATION_H_
 
 
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/DiagnosticOptions.h"
 #include "clang/Basic/DiagnosticOptions.h"
 #include "clang/Basic/FileSystemOptions.h"
 #include "clang/Basic/FileSystemOptions.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/TargetOptions.h"
 #include "clang/Basic/TargetOptions.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "clang/Frontend/DependencyOutputOptions.h"
 #include "clang/Frontend/DependencyOutputOptions.h"
 #include "clang/Frontend/FrontendOptions.h"
 #include "clang/Frontend/FrontendOptions.h"
 #include "clang/Frontend/LangStandard.h"
 #include "clang/Frontend/LangStandard.h"
@@ -26,7 +26,6 @@
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringRef.h"
-
 #include <string>
 #include <string>
 #include <vector>
 #include <vector>
 
 

+ 1 - 1
include/clang/module.modulemap

@@ -38,7 +38,6 @@ module Clang_Basic {
   textual header "Basic/BuiltinsWebAssembly.def"
   textual header "Basic/BuiltinsWebAssembly.def"
   textual header "Basic/BuiltinsX86.def"
   textual header "Basic/BuiltinsX86.def"
   textual header "Basic/BuiltinsXCore.def"
   textual header "Basic/BuiltinsXCore.def"
-  textual header "Basic/CodeGenOptions.def"
   textual header "Basic/DiagnosticOptions.def"
   textual header "Basic/DiagnosticOptions.def"
   textual header "Basic/LangOptions.def"
   textual header "Basic/LangOptions.def"
   textual header "Basic/OpenCLExtensions.def"
   textual header "Basic/OpenCLExtensions.def"
@@ -87,6 +86,7 @@ module Clang_Frontend {
   requires cplusplus
   requires cplusplus
   umbrella "Frontend"
   umbrella "Frontend"
 
 
+  textual header "Frontend/CodeGenOptions.def"
   textual header "Frontend/LangStandards.def"
   textual header "Frontend/LangStandards.def"
 
 
   module * { export * }
   module * { export * }

+ 0 - 1
lib/Basic/CMakeLists.txt

@@ -59,7 +59,6 @@ add_clang_library(clangBasic
   Attributes.cpp
   Attributes.cpp
   Builtins.cpp
   Builtins.cpp
   CharInfo.cpp
   CharInfo.cpp
-  CodeGenOptions.cpp
   Diagnostic.cpp
   Diagnostic.cpp
   DiagnosticIDs.cpp
   DiagnosticIDs.cpp
   DiagnosticOptions.cpp
   DiagnosticOptions.cpp

File diff suppressed because it is too large
+ 148 - 211
lib/Basic/Targets.cpp


+ 2 - 2
lib/CodeGen/BackendUtil.cpp

@@ -8,10 +8,10 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 #include "clang/CodeGen/BackendUtil.h"
 #include "clang/CodeGen/BackendUtil.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/TargetOptions.h"
 #include "clang/Basic/TargetOptions.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "clang/Frontend/FrontendDiagnostic.h"
 #include "clang/Frontend/FrontendDiagnostic.h"
 #include "clang/Frontend/Utils.h"
 #include "clang/Frontend/Utils.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringExtras.h"
@@ -22,10 +22,10 @@
 #include "llvm/CodeGen/RegAllocRegistry.h"
 #include "llvm/CodeGen/RegAllocRegistry.h"
 #include "llvm/CodeGen/SchedulerRegistry.h"
 #include "llvm/CodeGen/SchedulerRegistry.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DataLayout.h"
+#include "llvm/IR/ModuleSummaryIndex.h"
 #include "llvm/IR/IRPrintingPasses.h"
 #include "llvm/IR/IRPrintingPasses.h"
 #include "llvm/IR/LegacyPassManager.h"
 #include "llvm/IR/LegacyPassManager.h"
 #include "llvm/IR/Module.h"
 #include "llvm/IR/Module.h"
-#include "llvm/IR/ModuleSummaryIndex.h"
 #include "llvm/IR/Verifier.h"
 #include "llvm/IR/Verifier.h"
 #include "llvm/MC/SubtargetFeature.h"
 #include "llvm/MC/SubtargetFeature.h"
 #include "llvm/Object/ModuleSummaryIndexObjectFile.h"
 #include "llvm/Object/ModuleSummaryIndexObjectFile.h"

+ 1 - 1
lib/CodeGen/CGCXX.cpp

@@ -23,7 +23,7 @@
 #include "clang/AST/Mangle.h"
 #include "clang/AST/Mangle.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/AST/StmtCXX.h"
 #include "clang/AST/StmtCXX.h"
-#include "clang/Basic/CodeGenOptions.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringExtras.h"
 using namespace clang;
 using namespace clang;
 using namespace CodeGen;
 using namespace CodeGen;

+ 2 - 2
lib/CodeGen/CGCall.cpp

@@ -23,18 +23,18 @@
 #include "clang/AST/Decl.h"
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclObjC.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/TargetBuiltins.h"
 #include "clang/Basic/TargetBuiltins.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
 #include "clang/CodeGen/SwiftCallingConv.h"
 #include "clang/CodeGen/SwiftCallingConv.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/IR/Attributes.h"
 #include "llvm/IR/Attributes.h"
 #include "llvm/IR/CallSite.h"
 #include "llvm/IR/CallSite.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/InlineAsm.h"
 #include "llvm/IR/InlineAsm.h"
-#include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/Intrinsics.h"
+#include "llvm/IR/IntrinsicInst.h"
 #include "llvm/Transforms/Utils/Local.h"
 #include "llvm/Transforms/Utils/Local.h"
 using namespace clang;
 using namespace clang;
 using namespace CodeGen;
 using namespace CodeGen;

+ 1 - 1
lib/CodeGen/CGClass.cpp

@@ -21,9 +21,9 @@
 #include "clang/AST/EvaluatedExprVisitor.h"
 #include "clang/AST/EvaluatedExprVisitor.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/AST/StmtCXX.h"
 #include "clang/AST/StmtCXX.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/TargetBuiltins.h"
 #include "clang/Basic/TargetBuiltins.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/Metadata.h"
 #include "llvm/IR/Metadata.h"
 #include "llvm/Transforms/Utils/SanitizerStats.h"
 #include "llvm/Transforms/Utils/SanitizerStats.h"

+ 1 - 1
lib/CodeGen/CGDebugInfo.cpp

@@ -23,10 +23,10 @@
 #include "clang/AST/DeclTemplate.h"
 #include "clang/AST/DeclTemplate.h"
 #include "clang/AST/Expr.h"
 #include "clang/AST/Expr.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/AST/RecordLayout.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/Version.h"
 #include "clang/Basic/Version.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "clang/Lex/HeaderSearchOptions.h"
 #include "clang/Lex/HeaderSearchOptions.h"
 #include "clang/Lex/ModuleMap.h"
 #include "clang/Lex/ModuleMap.h"
 #include "clang/Lex/PreprocessorOptions.h"
 #include "clang/Lex/PreprocessorOptions.h"

+ 1 - 1
lib/CodeGen/CGDebugInfo.h

@@ -18,8 +18,8 @@
 #include "clang/AST/Expr.h"
 #include "clang/AST/Expr.h"
 #include "clang/AST/ExternalASTSource.h"
 #include "clang/AST/ExternalASTSource.h"
 #include "clang/AST/Type.h"
 #include "clang/AST/Type.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Basic/SourceLocation.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/IR/DIBuilder.h"
 #include "llvm/IR/DIBuilder.h"

+ 1 - 1
lib/CodeGen/CGDecl.cpp

@@ -23,10 +23,10 @@
 #include "clang/AST/Decl.h"
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclOpenMP.h"
 #include "clang/AST/DeclOpenMP.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/GlobalVariable.h"
 #include "llvm/IR/GlobalVariable.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/Intrinsics.h"

+ 1 - 1
lib/CodeGen/CGDeclCXX.cpp

@@ -15,7 +15,7 @@
 #include "CGCXXABI.h"
 #include "CGCXXABI.h"
 #include "CGObjCRuntime.h"
 #include "CGObjCRuntime.h"
 #include "CGOpenMPRuntime.h"
 #include "CGOpenMPRuntime.h"
-#include "clang/Basic/CodeGenOptions.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Path.h"

+ 1 - 1
lib/CodeGen/CGExpr.cpp

@@ -23,7 +23,7 @@
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/Attr.h"
 #include "clang/AST/Attr.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclObjC.h"
-#include "clang/Basic/CodeGenOptions.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DataLayout.h"

+ 1 - 1
lib/CodeGen/CGExprCXX.cpp

@@ -16,8 +16,8 @@
 #include "CGCXXABI.h"
 #include "CGCXXABI.h"
 #include "CGDebugInfo.h"
 #include "CGDebugInfo.h"
 #include "CGObjCRuntime.h"
 #include "CGObjCRuntime.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/IR/CallSite.h"
 #include "llvm/IR/CallSite.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/Intrinsics.h"
 
 

+ 1 - 1
lib/CodeGen/CGExprScalar.cpp

@@ -21,8 +21,8 @@
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/AST/StmtVisitor.h"
 #include "clang/AST/StmtVisitor.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/TargetInfo.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/IR/CFG.h"
 #include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DataLayout.h"

+ 1 - 1
lib/CodeGen/CGObjCMac.cpp

@@ -22,9 +22,9 @@
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/AST/StmtObjC.h"
 #include "clang/AST/StmtObjC.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallPtrSet.h"

+ 1 - 2
lib/CodeGen/CGRecordLayoutBuilder.cpp

@@ -20,14 +20,13 @@
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/Expr.h"
 #include "clang/AST/Expr.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/AST/RecordLayout.h"
-#include "clang/Basic/CodeGenOptions.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/Type.h"
 #include "llvm/IR/Type.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/raw_ostream.h"
-
 using namespace clang;
 using namespace clang;
 using namespace CodeGen;
 using namespace CodeGen;
 
 

+ 1 - 2
lib/CodeGen/CGVTables.cpp

@@ -16,14 +16,13 @@
 #include "CodeGenModule.h"
 #include "CodeGenModule.h"
 #include "clang/AST/CXXInheritance.h"
 #include "clang/AST/CXXInheritance.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/AST/RecordLayout.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/SetVector.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/Format.h"
 #include "llvm/Support/Format.h"
 #include "llvm/Transforms/Utils/Cloning.h"
 #include "llvm/Transforms/Utils/Cloning.h"
-
 #include <algorithm>
 #include <algorithm>
 #include <cstdio>
 #include <cstdio>
 
 

+ 1 - 1
lib/CodeGen/CodeGenABITypes.cpp

@@ -18,8 +18,8 @@
 
 
 #include "clang/CodeGen/CodeGenABITypes.h"
 #include "clang/CodeGen/CodeGenABITypes.h"
 #include "CodeGenModule.h"
 #include "CodeGenModule.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "clang/Lex/HeaderSearchOptions.h"
 #include "clang/Lex/HeaderSearchOptions.h"
 #include "clang/Lex/PreprocessorOptions.h"
 #include "clang/Lex/PreprocessorOptions.h"
 
 

+ 2 - 3
lib/CodeGen/CodeGenFunction.cpp

@@ -13,9 +13,9 @@
 
 
 #include "CodeGenFunction.h"
 #include "CodeGenFunction.h"
 #include "CGBlocks.h"
 #include "CGBlocks.h"
+#include "CGCleanup.h"
 #include "CGCUDARuntime.h"
 #include "CGCUDARuntime.h"
 #include "CGCXXABI.h"
 #include "CGCXXABI.h"
-#include "CGCleanup.h"
 #include "CGDebugInfo.h"
 #include "CGDebugInfo.h"
 #include "CGOpenMPRuntime.h"
 #include "CGOpenMPRuntime.h"
 #include "CodeGenModule.h"
 #include "CodeGenModule.h"
@@ -26,15 +26,14 @@
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/StmtCXX.h"
 #include "clang/AST/StmtCXX.h"
 #include "clang/Basic/Builtins.h"
 #include "clang/Basic/Builtins.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "clang/Sema/SemaDiagnostic.h"
 #include "clang/Sema/SemaDiagnostic.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/MDBuilder.h"
 #include "llvm/IR/MDBuilder.h"
 #include "llvm/IR/Operator.h"
 #include "llvm/IR/Operator.h"
-
 using namespace clang;
 using namespace clang;
 using namespace CodeGen;
 using namespace CodeGen;
 
 

+ 1 - 1
lib/CodeGen/CodeGenFunction.h

@@ -28,9 +28,9 @@
 #include "clang/AST/Type.h"
 #include "clang/AST/Type.h"
 #include "clang/Basic/ABI.h"
 #include "clang/Basic/ABI.h"
 #include "clang/Basic/CapturedStmt.h"
 #include "clang/Basic/CapturedStmt.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/OpenMPKinds.h"
 #include "clang/Basic/OpenMPKinds.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/TargetInfo.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/SmallVector.h"

+ 1 - 1
lib/CodeGen/CodeGenModule.cpp

@@ -36,12 +36,12 @@
 #include "clang/AST/RecursiveASTVisitor.h"
 #include "clang/AST/RecursiveASTVisitor.h"
 #include "clang/Basic/Builtins.h"
 #include "clang/Basic/Builtins.h"
 #include "clang/Basic/CharInfo.h"
 #include "clang/Basic/CharInfo.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/Module.h"
 #include "clang/Basic/Module.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/Version.h"
 #include "clang/Basic/Version.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "clang/Sema/SemaDiagnostic.h"
 #include "clang/Sema/SemaDiagnostic.h"
 #include "llvm/ADT/APSInt.h"
 #include "llvm/ADT/APSInt.h"
 #include "llvm/ADT/Triple.h"
 #include "llvm/ADT/Triple.h"

+ 1 - 2
lib/CodeGen/CodeGenPGO.h

@@ -17,11 +17,10 @@
 #include "CGBuilder.h"
 #include "CGBuilder.h"
 #include "CodeGenModule.h"
 #include "CodeGenModule.h"
 #include "CodeGenTypes.h"
 #include "CodeGenTypes.h"
-#include "clang/Basic/CodeGenOptions.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ProfileData/InstrProfReader.h"
 #include "llvm/ProfileData/InstrProfReader.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/MemoryBuffer.h"
-
 #include <array>
 #include <array>
 #include <memory>
 #include <memory>
 
 

+ 1 - 2
lib/CodeGen/CodeGenTBAA.cpp

@@ -20,13 +20,12 @@
 #include "clang/AST/Attr.h"
 #include "clang/AST/Attr.h"
 #include "clang/AST/Mangle.h"
 #include "clang/AST/Mangle.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/AST/RecordLayout.h"
-#include "clang/Basic/CodeGenOptions.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Metadata.h"
 #include "llvm/IR/Metadata.h"
 #include "llvm/IR/Type.h"
 #include "llvm/IR/Type.h"
-
 using namespace clang;
 using namespace clang;
 using namespace CodeGen;
 using namespace CodeGen;
 
 

+ 1 - 1
lib/CodeGen/CoverageMappingGen.h

@@ -14,9 +14,9 @@
 #ifndef LLVM_CLANG_LIB_CODEGEN_COVERAGEMAPPINGGEN_H
 #ifndef LLVM_CLANG_LIB_CODEGEN_COVERAGEMAPPINGGEN_H
 #define LLVM_CLANG_LIB_CODEGEN_COVERAGEMAPPINGGEN_H
 #define LLVM_CLANG_LIB_CODEGEN_COVERAGEMAPPINGGEN_H
 
 
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Basic/SourceLocation.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "clang/Lex/PPCallbacks.h"
 #include "clang/Lex/PPCallbacks.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringMap.h"

+ 1 - 3
lib/CodeGen/ModuleBuilder.cpp

@@ -17,16 +17,14 @@
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/Expr.h"
 #include "clang/AST/Expr.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/TargetInfo.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
 #include "llvm/IR/Module.h"
-
 #include <memory>
 #include <memory>
-
 using namespace clang;
 using namespace clang;
 
 
 namespace {
 namespace {

+ 1 - 2
lib/CodeGen/ObjectFilePCHContainerOperations.cpp

@@ -14,10 +14,10 @@
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/Expr.h"
 #include "clang/AST/Expr.h"
 #include "clang/AST/RecursiveASTVisitor.h"
 #include "clang/AST/RecursiveASTVisitor.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/CodeGen/BackendUtil.h"
 #include "clang/CodeGen/BackendUtil.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "clang/Frontend/CompilerInstance.h"
 #include "clang/Frontend/CompilerInstance.h"
 #include "clang/Lex/HeaderSearch.h"
 #include "clang/Lex/HeaderSearch.h"
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Lex/Preprocessor.h"
@@ -33,7 +33,6 @@
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/TargetRegistry.h"
 #include "llvm/Support/TargetRegistry.h"
-
 #include <memory>
 #include <memory>
 
 
 using namespace clang;
 using namespace clang;

+ 2 - 3
lib/CodeGen/TargetInfo.cpp

@@ -18,16 +18,15 @@
 #include "CGValue.h"
 #include "CGValue.h"
 #include "CodeGenFunction.h"
 #include "CodeGenFunction.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/AST/RecordLayout.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
 #include "clang/CodeGen/SwiftCallingConv.h"
 #include "clang/CodeGen/SwiftCallingConv.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/Triple.h"
 #include "llvm/ADT/Triple.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/Type.h"
 #include "llvm/IR/Type.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/raw_ostream.h"
-
-#include <algorithm> // std::sort
+#include <algorithm>    // std::sort
 
 
 using namespace clang;
 using namespace clang;
 using namespace CodeGen;
 using namespace CodeGen;

+ 4 - 8
lib/Frontend/ASTUnit.cpp

@@ -1058,8 +1058,7 @@ bool ASTUnit::Parse(std::shared_ptr<PCHContainerOperations> PCHContainerOps,
   
   
   // Create the target instance.
   // Create the target instance.
   Clang->setTarget(TargetInfo::CreateTargetInfo(
   Clang->setTarget(TargetInfo::CreateTargetInfo(
-      Clang->getDiagnostics(), Clang->getInvocation().TargetOpts,
-      Clang->getInvocation().getCodeGenOpts()));
+      Clang->getDiagnostics(), Clang->getInvocation().TargetOpts));
   if (!Clang->hasTarget())
   if (!Clang->hasTarget())
     return true;
     return true;
 
 
@@ -1519,8 +1518,7 @@ ASTUnit::getMainBufferWithPrecompiledPreamble(
   
   
   // Create the target instance.
   // Create the target instance.
   Clang->setTarget(TargetInfo::CreateTargetInfo(
   Clang->setTarget(TargetInfo::CreateTargetInfo(
-      Clang->getDiagnostics(), Clang->getInvocation().TargetOpts,
-      Clang->getInvocation().getCodeGenOpts()));
+      Clang->getDiagnostics(), Clang->getInvocation().TargetOpts));
   if (!Clang->hasTarget()) {
   if (!Clang->hasTarget()) {
     llvm::sys::fs::remove(FrontendOpts.OutputFile);
     llvm::sys::fs::remove(FrontendOpts.OutputFile);
     Preamble.clear();
     Preamble.clear();
@@ -1783,8 +1781,7 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocationAction(
   
   
   // Create the target instance.
   // Create the target instance.
   Clang->setTarget(TargetInfo::CreateTargetInfo(
   Clang->setTarget(TargetInfo::CreateTargetInfo(
-      Clang->getDiagnostics(), Clang->getInvocation().TargetOpts,
-      Clang->getInvocation().getCodeGenOpts()));
+      Clang->getDiagnostics(), Clang->getInvocation().TargetOpts));
   if (!Clang->hasTarget())
   if (!Clang->hasTarget())
     return nullptr;
     return nullptr;
 
 
@@ -2367,8 +2364,7 @@ void ASTUnit::CodeComplete(
   
   
   // Create the target instance.
   // Create the target instance.
   Clang->setTarget(TargetInfo::CreateTargetInfo(
   Clang->setTarget(TargetInfo::CreateTargetInfo(
-      Clang->getDiagnostics(), Clang->getInvocation().TargetOpts,
-      Clang->getInvocation().getCodeGenOpts()));
+      Clang->getDiagnostics(), Clang->getInvocation().TargetOpts));
   if (!Clang->hasTarget()) {
   if (!Clang->hasTarget()) {
     Clang->setInvocation(nullptr);
     Clang->setInvocation(nullptr);
     return;
     return;

+ 1 - 0
lib/Frontend/CMakeLists.txt

@@ -14,6 +14,7 @@ add_clang_library(clangFrontend
   CacheTokens.cpp
   CacheTokens.cpp
   ChainedDiagnosticConsumer.cpp
   ChainedDiagnosticConsumer.cpp
   ChainedIncludesSource.cpp
   ChainedIncludesSource.cpp
+  CodeGenOptions.cpp
   CompilerInstance.cpp
   CompilerInstance.cpp
   CompilerInvocation.cpp
   CompilerInvocation.cpp
   CreateInvocationFromCommandLine.cpp
   CreateInvocationFromCommandLine.cpp

+ 1 - 2
lib/Frontend/ChainedIncludesSource.cpp

@@ -152,8 +152,7 @@ IntrusiveRefCntPtr<ExternalSemaSource> clang::createChainedIncludesSource(
     Clang->setInvocation(CInvok.release());
     Clang->setInvocation(CInvok.release());
     Clang->setDiagnostics(Diags.get());
     Clang->setDiagnostics(Diags.get());
     Clang->setTarget(TargetInfo::CreateTargetInfo(
     Clang->setTarget(TargetInfo::CreateTargetInfo(
-        Clang->getDiagnostics(), Clang->getInvocation().TargetOpts,
-        Clang->getCodeGenOpts()));
+        Clang->getDiagnostics(), Clang->getInvocation().TargetOpts));
     Clang->createFileManager();
     Clang->createFileManager();
     Clang->createSourceManager(Clang->getFileManager());
     Clang->createSourceManager(Clang->getFileManager());
     Clang->createPreprocessor(TU_Prefix);
     Clang->createPreprocessor(TU_Prefix);

+ 2 - 3
lib/Basic/CodeGenOptions.cpp → lib/Frontend/CodeGenOptions.cpp

@@ -7,8 +7,7 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
-#include "clang/Basic/CodeGenOptions.h"
-
+#include "clang/Frontend/CodeGenOptions.h"
 #include <string.h>
 #include <string.h>
 
 
 namespace clang {
 namespace clang {
@@ -16,7 +15,7 @@ namespace clang {
 CodeGenOptions::CodeGenOptions() {
 CodeGenOptions::CodeGenOptions() {
 #define CODEGENOPT(Name, Bits, Default) Name = Default;
 #define CODEGENOPT(Name, Bits, Default) Name = Default;
 #define ENUM_CODEGENOPT(Name, Type, Bits, Default) set##Name(Default);
 #define ENUM_CODEGENOPT(Name, Type, Bits, Default) set##Name(Default);
-#include "clang/Basic/CodeGenOptions.def"
+#include "clang/Frontend/CodeGenOptions.def"
 
 
   RelocationModel = "pic";
   RelocationModel = "pic";
   memcpy(CoverageVersion, "402*", 4);
   memcpy(CoverageVersion, "402*", 4);

+ 2 - 4
lib/Frontend/CompilerInstance.cpp

@@ -830,8 +830,7 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
 
 
   // Create the target instance.
   // Create the target instance.
   setTarget(TargetInfo::CreateTargetInfo(getDiagnostics(),
   setTarget(TargetInfo::CreateTargetInfo(getDiagnostics(),
-                                         getInvocation().TargetOpts,
-                                         getInvocation().getCodeGenOpts()));
+                                         getInvocation().TargetOpts));
   if (!hasTarget())
   if (!hasTarget())
     return false;
     return false;
 
 
@@ -839,8 +838,7 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
   if (getLangOpts().CUDA && !getFrontendOpts().AuxTriple.empty()) {
   if (getLangOpts().CUDA && !getFrontendOpts().AuxTriple.empty()) {
     std::shared_ptr<TargetOptions> TO(new TargetOptions);
     std::shared_ptr<TargetOptions> TO(new TargetOptions);
     TO->Triple = getFrontendOpts().AuxTriple;
     TO->Triple = getFrontendOpts().AuxTriple;
-    setAuxTarget(TargetInfo::CreateTargetInfo(getDiagnostics(), TO,
-                                              getInvocation().getCodeGenOpts()));
+    setAuxTarget(TargetInfo::CreateTargetInfo(getDiagnostics(), TO));
   }
   }
 
 
   // Inform the target of the language options.
   // Inform the target of the language options.

Some files were not shown because too many files changed in this diff