Move verification of Sema::MaximumAlignment to a .cpp file
authorReid Kleckner <rnk@google.com>
Thu, 30 Jan 2020 21:33:38 +0000 (13:33 -0800)
committerReid Kleckner <rnk@google.com>
Thu, 30 Jan 2020 21:37:52 +0000 (13:37 -0800)
Saves these transitive includes:

clang/include/clang/Sema/Sema.h
clang/lib/CodeGen/CGDecl.cpp
clang/lib/CodeGen/CGValue.h

index a6234f7..2b82256 100644 (file)
@@ -377,7 +377,7 @@ public:
   /// The maximum alignment, same as in llvm::Value. We duplicate them here
   /// because that allows us not to duplicate the constants in clang code,
   /// which we must to since we can't directly use the llvm constants.
-  /// The value is verified against llvm here: lib/CodeGen/CGValue.h
+  /// The value is verified against llvm here: lib/CodeGen/CGDecl.cpp
   ///
   /// This is the greatest alignment value supported by load, store, and alloca
   /// instructions, and global values.
index 589bd20..2946259 100644 (file)
@@ -31,6 +31,7 @@
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
+#include "clang/Sema/Sema.h"
 #include "llvm/Analysis/ValueTracking.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/GlobalVariable.h"
@@ -40,6 +41,9 @@
 using namespace clang;
 using namespace CodeGen;
 
+static_assert(clang::Sema::MaximumAlignment <= llvm::Value::MaximumAlignment,
+              "Clang max alignment greater than what LLVM supports?");
+
 void CodeGenFunction::EmitDecl(const Decl &D) {
   switch (D.getKind()) {
   case Decl::BuiltinTemplate:
index 4d6c395..9fd07bd 100644 (file)
 #define LLVM_CLANG_LIB_CODEGEN_CGVALUE_H
 
 #include "clang/AST/ASTContext.h"
-#include "clang/Sema/Sema.h"
 #include "clang/AST/Type.h"
 #include "llvm/IR/Value.h"
 #include "llvm/IR/Type.h"
 #include "Address.h"
 #include "CodeGenTBAA.h"
 
-static_assert(clang::Sema::MaximumAlignment <= llvm::Value::MaximumAlignment,
-              "Clang max alignment greater than what LLVM supports?");
-
 namespace llvm {
   class Constant;
   class MDNode;