From: Richard Trieu Date: Thu, 6 Dec 2018 06:12:20 +0000 (+0000) Subject: Remove CodeGen dependencies on Sema. X-Git-Tag: llvmorg-8.0.0-rc1~2749 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5337c7482566198c21eccbf9bd178ba1387b7ebc;p=platform%2Fupstream%2Fllvm.git Remove CodeGen dependencies on Sema. Move diagnostics from Sema to Frontend (or Common) so that CodeGen no longer needs to include the Sema diagnostic IDs. llvm-svn: 348458 --- diff --git a/clang/include/clang/Basic/DiagnosticCommonKinds.td b/clang/include/clang/Basic/DiagnosticCommonKinds.td index f0aff9a1..d1e7c57 100644 --- a/clang/include/clang/Basic/DiagnosticCommonKinds.td +++ b/clang/include/clang/Basic/DiagnosticCommonKinds.td @@ -189,6 +189,12 @@ def err_seh___finally_block : Error< def note_invalid_subexpr_in_const_expr : Note< "subexpression not valid in a constant expression">; +// Sema && Frontend +let CategoryName = "Inline Assembly Issue" in { + def err_asm_invalid_type_in_input : Error< + "invalid type %0 in asm input for constraint '%1'">; +} + // Targets def err_target_unknown_triple : Error< diff --git a/clang/include/clang/Basic/DiagnosticFrontendKinds.td b/clang/include/clang/Basic/DiagnosticFrontendKinds.td index df62f6b..1186844 100644 --- a/clang/include/clang/Basic/DiagnosticFrontendKinds.td +++ b/clang/include/clang/Basic/DiagnosticFrontendKinds.td @@ -245,4 +245,49 @@ def warn_stdlibcxx_not_found : Warning< "include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the " "command line to use the libc++ standard library instead">, InGroup>; + +def err_builtin_needs_feature : Error<"%0 needs target feature %1">; +def err_function_needs_feature : Error< + "always_inline function %1 requires target feature '%2', but would " + "be inlined into function %0 that is compiled without support for '%2'">; + +def err_alias_to_undefined : Error< + "%select{alias|ifunc}0 must point to a defined " + "%select{variable or |}1function">; +def warn_alias_to_weak_alias : Warning< + "%select{alias|ifunc}2 will always resolve to %0 even if weak definition of " + "%1 is overridden">, + InGroup; +def err_duplicate_mangled_name : Error< + "definition with same mangled name '%0' as another definition">; +def err_cyclic_alias : Error< + "%select{alias|ifunc}0 definition is part of a cycle">; +def err_ifunc_resolver_return : Error< + "ifunc resolver function must return a pointer">; + +def warn_atomic_op_misaligned : Warning< + "%select{large|misaligned}0 atomic operation may incur " + "significant performance penalty">, InGroup>; + +def warn_alias_with_section : Warning< + "%select{alias|ifunc}1 will not be in section '%0' but in the same section " + "as the %select{aliasee|resolver}2">, + InGroup; + +let CategoryName = "Instrumentation Issue" in { +def warn_profile_data_out_of_date : Warning< + "profile data may be out of date: of %0 function%s0, %1 %plural{1:has|:have}1" + " mismatched data that will be ignored">, + InGroup; +def warn_profile_data_missing : Warning< + "profile data may be incomplete: of %0 function%s0, %1 %plural{1:has|:have}1" + " no data">, + InGroup, + DefaultIgnore; +def warn_profile_data_unprofiled : Warning< + "no profile data available for file \"%0\"">, + InGroup; + +} // end of instrumentation issue category + } diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index e24f4f3..1f8dd2e 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -622,11 +622,6 @@ def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">; def err_invalid_cpu_is : Error<"invalid cpu name for builtin">; def err_invalid_cpu_specific_dispatch_value : Error< "invalid option '%0' for %select{cpu_specific|cpu_dispatch}1">; -def err_builtin_needs_feature : Error<"%0 needs target feature %1">; -def err_function_needs_feature - : Error<"always_inline function %1 requires target feature '%2', but would " - "be inlined into function %0 that is compiled without support for " - "'%2'">; def warn_builtin_unknown : Warning<"use of unknown builtin %0">, InGroup, DefaultError; def warn_cstruct_memaccess : Warning< @@ -2880,20 +2875,6 @@ def err_attribute_weakref_without_alias : Error< "weakref declaration of %0 must also have an alias attribute">; def err_alias_not_supported_on_darwin : Error < "aliases are not supported on darwin">; -def err_alias_to_undefined : Error< - "%select{alias|ifunc}0 must point to a defined %select{variable or |}1function">; -def warn_alias_to_weak_alias : Warning< - "%select{alias|ifunc}2 will always resolve to %0 even if weak definition of %1 is overridden">, - InGroup; -def warn_alias_with_section : Warning< - "%select{alias|ifunc}1 will not be in section '%0' but in the same section as the %select{aliasee|resolver}2">, - InGroup; -def err_duplicate_mangled_name : Error< - "definition with same mangled name '%0' as another definition">; -def err_cyclic_alias : Error< - "%select{alias|ifunc}0 definition is part of a cycle">; -def err_ifunc_resolver_return : Error< - "ifunc resolver function must return a pointer">; def warn_attribute_wrong_decl_type_str : Warning< "%0 attribute only applies to %1">, InGroup; def err_attribute_wrong_decl_type_str : Error< @@ -7147,9 +7128,6 @@ def warn_atomic_op_has_invalid_memory_order : Warning< InGroup>; def err_atomic_op_has_invalid_synch_scope : Error< "synchronization scope argument to atomic operation is invalid">; -def warn_atomic_op_misaligned : Warning< - "%select{large|misaligned}0 atomic operation may incur " - "significant performance penalty">, InGroup>; def warn_atomic_implicit_seq_cst : Warning< "implicit use of sequentially-consistent atomic may incur stronger memory barriers than necessary">, InGroup>, DefaultIgnore; @@ -7413,8 +7391,6 @@ let CategoryName = "Inline Assembly Issue" in { "invalid input constraint '%0' in asm">; def err_asm_immediate_expected : Error<"constraint '%0' expects " "an integer constant expression">; - def err_asm_invalid_type_in_input : Error< - "invalid type %0 in asm input for constraint '%1'">; def err_asm_tying_incompatible_types : Error< "unsupported inline asm: input with type " "%diff{$ matching output with type $|}0,1">; @@ -9318,22 +9294,6 @@ def warn_not_a_doxygen_trailing_member_comment : Warning< "not a Doxygen trailing comment">, InGroup, DefaultIgnore; } // end of documentation issue category -let CategoryName = "Instrumentation Issue" in { -def warn_profile_data_out_of_date : Warning< - "profile data may be out of date: of %0 function%s0, %1 %plural{1:has|:have}1" - " mismatched data that will be ignored">, - InGroup; -def warn_profile_data_missing : Warning< - "profile data may be incomplete: of %0 function%s0, %1 %plural{1:has|:have}1" - " no data">, - InGroup, - DefaultIgnore; -def warn_profile_data_unprofiled : Warning< - "no profile data available for file \"%0\"">, - InGroup; - -} // end of instrumentation issue category - let CategoryName = "Nullability Issue" in { def warn_mismatched_nullability_attr : Warning< diff --git a/clang/lib/CodeGen/CGAtomic.cpp b/clang/lib/CodeGen/CGAtomic.cpp index 9379c83..24056a4 100644 --- a/clang/lib/CodeGen/CGAtomic.cpp +++ b/clang/lib/CodeGen/CGAtomic.cpp @@ -18,7 +18,7 @@ #include "TargetInfo.h" #include "clang/AST/ASTContext.h" #include "clang/CodeGen/CGFunctionInfo.h" -#include "clang/Sema/SemaDiagnostic.h" +#include "clang/Frontend/FrontendDiagnostic.h" #include "llvm/ADT/DenseMap.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/Intrinsics.h" diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index caf6891..bc7a18a 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -19,7 +19,6 @@ #include "clang/Basic/Builtins.h" #include "clang/Basic/PrettyStackTrace.h" #include "clang/Basic/TargetInfo.h" -#include "clang/Sema/SemaDiagnostic.h" #include "llvm/ADT/StringExtras.h" #include "llvm/IR/CallSite.h" #include "llvm/IR/DataLayout.h" diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 600640f..7c7ba9d0 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -31,7 +31,7 @@ #include "clang/Basic/TargetInfo.h" #include "clang/CodeGen/CGFunctionInfo.h" #include "clang/Frontend/CodeGenOptions.h" -#include "clang/Sema/SemaDiagnostic.h" +#include "clang/Frontend/FrontendDiagnostic.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/Dominators.h" #include "llvm/IR/Intrinsics.h" diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 9ebd86a..8130449 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -43,7 +43,7 @@ #include "clang/Basic/Version.h" #include "clang/CodeGen/ConstantInitBuilder.h" #include "clang/Frontend/CodeGenOptions.h" -#include "clang/Sema/SemaDiagnostic.h" +#include "clang/Frontend/FrontendDiagnostic.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/ADT/Triple.h" #include "llvm/Analysis/TargetLibraryInfo.h"