+2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
+
+ PR lto/79061
+ * asan.c (get_translation_unit_decl): New function.
+ (asan_add_global): Extract modules file name from globals
+ TRANSLATION_UNIT_DECL name.
+
2017-01-24 Eric Botcazou <ebotcazou@adacore.com>
PR target/77439
+2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
+
+ PR lto/79061
+ * gcc-interface/utils.c (get_global_context): Pass main_input_filename
+ to build_translation_unit_decl.
+
2017-01-23 Javier Miranda <miranda@adacore.com>
* sem_util.adb (New_Copy_Tree): Code cleanup:
{
if (!global_context)
{
- global_context = build_translation_unit_decl (NULL_TREE);
+ global_context
+ = build_translation_unit_decl (get_identifier (main_input_filename));
debug_hooks->register_main_translation_unit (global_context);
}
&& TREE_PUBLIC (decl));
}
+/* For given DECL return its corresponding TRANSLATION_UNIT_DECL. */
+
+static const_tree
+get_translation_unit_decl (tree decl)
+{
+ const_tree context = decl;
+ while (context && TREE_CODE (context) != TRANSLATION_UNIT_DECL)
+ {
+ if (TREE_CODE (context) == BLOCK)
+ context = BLOCK_SUPERCONTEXT (context);
+ else
+ context = get_containing_scope (context);
+ }
+ return context;
+}
+
/* Append description of a single global DECL into vector V.
TYPE is __asan_global struct type as returned by asan_global_struct. */
pp_string (&asan_pp, "<unknown>");
str_cst = asan_pp_string (&asan_pp);
- pp_string (&module_name_pp, main_input_filename);
+ const char *filename = main_input_filename;
+ if (in_lto_p)
+ {
+ const_tree translation_unit_decl = get_translation_unit_decl (decl);
+ if (translation_unit_decl && DECL_NAME (translation_unit_decl) != NULL)
+ filename = IDENTIFIER_POINTER (DECL_NAME (translation_unit_decl));
+ }
+ pp_string (&module_name_pp, filename);
module_name_cst = asan_pp_string (&module_name_pp);
if (asan_needs_local_alias (decl))
+2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
+
+ PR lto/79061
+ * c-decl.c (pop_scope): Pass main_input_filename to
+ build_translation_unit_decl.
+
2017-01-24 David Malcolm <dmalcolm@redhat.com>
* c-parser.c: Include "read-rtl-function.h" and
context = current_function_decl;
else if (scope == file_scope)
{
- tree file_decl = build_translation_unit_decl (NULL_TREE);
+ tree file_decl
+ = build_translation_unit_decl (get_identifier (main_input_filename));
context = file_decl;
debug_hooks->register_main_translation_unit (file_decl);
}
+2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
+
+ PR lto/79061
+ * decl.c (cxx_init_decl_processing): Pass main_input_filename
+ to build_translation_unit_decl.
+
2017-01-24 Jakub Jelinek <jakub@redhat.com>
PR c++/79205
gcc_assert (global_namespace == NULL_TREE);
global_namespace = build_lang_decl (NAMESPACE_DECL, global_scope_name,
void_type_node);
- DECL_CONTEXT (global_namespace) = build_translation_unit_decl (NULL_TREE);
+ DECL_CONTEXT (global_namespace)
+ = build_translation_unit_decl (get_identifier (main_input_filename));
debug_hooks->register_main_translation_unit
(DECL_CONTEXT (global_namespace));
TREE_PUBLIC (global_namespace) = 1;
+2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
+
+ PR lto/79061
+ * f95-lang.c (gfc_create_decls): Include stringpool.h.
+ Pass main_input_filename to build_translation_unit_decl.
+
2017-01-23 Thomas Koenig <tkoenig@netcologne.de>
* arith.c (arith_power): If simplifying integer power expression
#include "tree.h"
#include "gfortran.h"
#include "trans.h"
+#include "stringpool.h"
#include "diagnostic.h" /* For errorcount/warningcount */
#include "langhooks.h"
#include "langhooks-def.h"
gfc_init_constants ();
/* Build our translation-unit decl. */
- current_translation_unit = build_translation_unit_decl (NULL_TREE);
+ current_translation_unit
+ = build_translation_unit_decl (get_identifier (main_input_filename));
debug_hooks->register_main_translation_unit (current_translation_unit);
}