Author: Reid Kleckner Date: 2020-01-30T13:37:52-08:00 New Revision: 01943a59f51d8b5ede062305941c1f864b8a6a13
URL: https://github.com/llvm/llvm-project/commit/01943a59f51d8b5ede062305941c1f864b8a6a13 DIFF: https://github.com/llvm/llvm-project/commit/01943a59f51d8b5ede062305941c1f864b8a6a13.diff LOG: Move verification of Sema::MaximumAlignment to a .cpp file Saves these transitive includes: Added: Modified: clang/include/clang/Sema/Sema.h clang/lib/CodeGen/CGDecl.cpp clang/lib/CodeGen/CGValue.h Removed: ################################################################################ diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h index a6234f73d095..2b8225611491 100644 --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -377,7 +377,7 @@ class Sema final { /// 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. diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 589bd2039ebb..29462592887a 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -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: diff --git a/clang/lib/CodeGen/CGValue.h b/clang/lib/CodeGen/CGValue.h index 4d6c3950e5e4..9fd07bdb187d 100644 --- a/clang/lib/CodeGen/CGValue.h +++ b/clang/lib/CodeGen/CGValue.h @@ -15,16 +15,12 @@ #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; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits