Added a filter to prevent streaming out builtin identifiers. This filter is copied from symtab.c:497 ...
13 years, 9 months ago
(2011-07-20 20:54:31 UTC)
#1
Added a filter to prevent streaming out builtin identifiers.
This filter is copied from symtab.c:497 where the same filter already existed.
Should I instead add a new macro IS_BUILTIN or something like that to encompass
that logic?
This doesn't fix any current pph test.
Tested with bootstrap build and pph regression testing.
diff --git a/libcpp/ChangeLog.pph b/libcpp/ChangeLog.pph
index de21994..c0ef9f6 100644
--- a/libcpp/ChangeLog.pph
+++ b/libcpp/ChangeLog.pph
@@ -1,3 +1,7 @@
+2011-07-20 Gabriel Charette <gchare@google.com>
+
+ * symtab.c (cpp_lt_capture): Filter out builtin identifiers.
+
2011-06-08 Lawrence Crowl <crowl@google.com>
* symtab.c (lt_query_macro): Querying "user builtin" macros should not
diff --git a/libcpp/symtab.c b/libcpp/symtab.c
index 48c5dcc..3169b86 100644
--- a/libcpp/symtab.c
+++ b/libcpp/symtab.c
@@ -589,9 +589,16 @@ cpp_lt_capture (cpp_reader *reader)
hashnode node = table_entry->node;
if (node)
{
- cpp_ident_use *summary_entry = used.entries + summary_index++;
+ cpp_ident_use *summary_entry;
cpp_hashnode *cpp_node = CPP_HASHNODE (node);
+ /* Filter out builtin identifiers. */
+ if ((cpp_node->flags & NODE_BUILTIN)
+ && cpp_node->value.builtin < BT_FIRST_USER)
+ continue;
+
+ summary_entry = used.entries + summary_index++;
+
summary_entry->used_by_directive = cpp_node->used_by_directive;
summary_entry->expanded_to_text = cpp_node->expanded_to_text;
summary_entry->ident_len = node->len;
--
This patch is available for review at http://codereview.appspot.com/4802047
On 2011/07/20 20:54:31, Gabriel Charette wrote: > Should I instead add a new macro IS_BUILTIN ...
13 years, 9 months ago
(2011-07-20 21:09:05 UTC)
#2
On 2011/07/20 20:54:31, Gabriel Charette wrote:
> Should I instead add a new macro IS_BUILTIN or something like that to
encompass
> that logic?
Sure. But make it a static inline function, please.
OK with that change.
Diego.
Issue 4802047: [pph] Add filter to prevent streaming out builtin identifiers
(Closed)
Created 13 years, 9 months ago by Gabriel Charette
Modified 13 years, 9 months ago
Reviewers: Lawrence Crowl, Diego Novillo
Base URL:
Comments: 0