Hi all,
I was looking at the Internalize patch, and decided to clean it up a bit. The
attached patch makes two functional changes to the pass:
1. If both -internalize-public-api-file and -internalize-public-api-list
options are given on the commandline, only -file was used. Now, all
options are respected and the contents of the file merged with the items
given with the -list option(s). I think it is very confusing for users to
have commandline options ignored without any indication, especially when
it is perfectly possibly to use all options.
2. There was an odd case, when InternalizeEverything was false and the
-internalize-public-api-file was given but pointed to an empty or
nonexistent file, the InternalizeEverything option would not be respected
(ie, all globals except for main would still be internalized). This
behaviour was also different from not specifying the
-internalize-public-api-file option, in which case nothing would be
internalized (thus respecting the InternalizeEverything option). The
difference between not specifying the -file option and having an empty or
non-existent file was removed and the AllButMain option (the new name for
InternalizeEverything) is always respected.
Furthermore, this patch does some renaming and has improved comments.
Lastly, this patch adds a few testcases for the Internalize pass. The first
three RUN lines work with the orginal and modified code, the last two RUN
lines need the first functional change above.
The second functional change (or anything with AllButMain) is not tested.
Gr.
Matthijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: internalize.diff
Type: text/x-diff
Size: 7676 bytes
Desc: not available
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20080509/4f816edb/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20080509/4f816edb/attachment.sig>