diff options
author | Jan Hubicka <jh@suse.cz> | 2019-06-01 18:36:49 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2019-06-01 16:36:49 +0000 |
commit | e4b44fd741ee25aa5ad086949ccfbcbd3736c0f3 (patch) | |
tree | de277309e24560ad8eaec387435ea436ae9943ba /gcc/ipa-devirt.c | |
parent | 5a2a2fb3152a801b5652bb65c380d92db2d900d3 (diff) |
alias.c: Include ipa-utils.h.
* alias.c: Include ipa-utils.h.
(get_alias_set): Try to complete ODR type via ODR type hash lookup.
* ipa-devirt.c (prevailing_odr_type): New.
* ipa-utils.h (previaling_odr_type): Declare.
* g++.dg/lto/alias-1_0.C: New testcase.
* g++.dg/lto/alias-1_1.C: New testcase.
From-SVN: r271837
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r-- | gcc/ipa-devirt.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index a51b1517422..e9cb1800b3f 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -2170,6 +2170,20 @@ get_odr_type (tree type, bool insert) return val; } +/* Return type that in ODR type hash prevailed TYPE. Be careful and punt + on ODR violations. */ + +tree +prevailing_odr_type (tree type) +{ + odr_type t = get_odr_type (type, false); + if (!t || t->odr_violated) + return type; + return t->type; +} + +/* Return true if we reported some ODR violation on TYPE. */ + bool odr_type_violation_reported_p (tree type) { |