Add a shorthand: subst_target_var

This function is a shorthand for a common code pattern when replacing
a variable's type with the target type.
Enhance track_var (and rename it to track_expr)

Add handling for some common expression operations, so that things like
"s = var + 1" are recognized.
Add support for tracking functions

Only the function's return type is tracked ATM.
Find forward declarations for tracking purposes

We need a function that finds the next possible declaration with the
same type, name and scope as the original: varscope_find_next
Avoid dependence on uninitialized data

If scope != tree, then scopenode must be NULL. However, only scopenode
is initialized on entry to do_find().
Add rudimentary support for pointers

This includes pointers to functions and functions returning pointers.
However, no check is done that the level of indirection matches. The
assumption is made that there is no code like this:

long *p;
long x;
x = p;

Additionally, the compiler will issue a warning for this case.

However, this code will HAVE TO be improved if we add support for
typecasts.
Include the dependencies in the main patch

There are two reasons for this change:

1. There were much fewer dependency changes than anticipated.
2. The track_vars() transform is not self-contained; it always depends
   on the result of the previous transformation.

Point 1 means that the resulting patch is somehow managable.
Point 2 means that it's in fact cleaner to combine the two passes.
Always compile in dump_tree and friends

This is pretty useful for debugging, even when we don't want the other
debug output.
Maintain a list of duplicates

If a node is duplicated, link it to the original, so all duplicates can
be found easily.
subst_target_var: substitute all var duplicates, too

This is needed to solve situations like this:

static struct local_unwind_table {
        struct {
                unsigned long pc;
                unsigned long range;
        } core, init;
        void *address;
        unsigned long size;
} *local_unwind_tables, default_unwind_table;

In this case the "size" member is duplicated for each of the variables
(local_unwind_tables and default_unwind_table), but we don't want to
split this type into two structures, because they would become two
distinct structs. Instead, find the second copy of the variable and
change it too.
Provide utility functions to check for pointer and function types

No functional change, but the code is more readable now.
track_vars: also walk the splitlist

Some variables may not have been replaced yet, because they're still on
the split list. Their dependencies would be missed.

On the other hand, the tracking may add new entries to the replacedlist
(if no split is necessary), so we must walk both lists again until no
new entries are added to the replacedlist.
Put the walking of duplicates to a helper function

No functional change.
Improve pointer indirections

Track pointers and dereferences to make sure that the correct types are
substituted (e.g. "void *").
Update list_splice() and friends

Update this code from the latest Linux kernel.
Various small fixes in check_split()

Assorted items:
- fix the test for valid split pointer.
- add comments describing what each action means.
Add support for replacing pointer types

This code allows replacing pointer types for the first time.

We have to operate on the base type first (because that's the only
thing that can be omitted in a declaration of multiple vars), and
the original type has to be "flattened", e.g. all the pointer type
objects must be removed.

If you have e.g.:

void **p, *x;

and identify "void *p" as a candidate for replacement to "tptr", then
the shared part between p and x is "void" (the base type). But if you
decide to replace "void *" with "tptr", then you must remove the
extra asterisk to get:

tptr *p, x;
Fix handling of func types in subst_target_var()

This is broken with indirection level, because the indirection level
refers to the function's return type, not to the function itself, i.e.
we're not counting if this is a pointer to (a pointer to) a function,
but whether the function returns a pointer type.
flatten_type: remove the string representation

Provide a delete_node() helper, which removes the node and also the
related dynstr, ensuring consistency between the tree representation
and the program text.
remove_text_list{_rev}: shorten segments if possible

The old code always replaced the first/last text pointer with a
pointer to dummydynstr. This is correct for elements that get deleted
completely, but wrong for elements that are part of a longer string,
e.g. when removing asterisks from a pointer declaration:

char *ptr;   ->  char ptr;

The type_var node stretches over "*ptr". After removing the "*" (via
its type_type node), it should still read "ptr".