diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-04-23 14:49:45 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-04-23 14:49:45 -0700 |
commit | e0e366e55459a2b934253ac1ada762bdade64571 (patch) | |
tree | 8d75f1e95c84511fc9d265341d2d0c688f51a20d /tools | |
parent | 744ccd6c8bd149a17575b9d768b9a90ce06bf122 (diff) |
PNaCl: Add FlattenGlobals pass for simplifying global variable initializers
This pass converts initializers for global variables into a flattened
normal form which removes nested struct types and simplifies
ConstantExprs.
In the future, we might change the bitcode format to use the flattened
bytes+relocs representation for global initializers. In that case, we
will be able to reuse the FlattenedConstant class in the bitcode
reader/writer for converting to and from this form.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3113
TEST=test/Transforms/NaCl/flatten-globals.ll
Review URL: https://codereview.chromium.org/14017011
Diffstat (limited to 'tools')
-rw-r--r-- | tools/opt/opt.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index 2998a047cf..ff6e5effeb 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -583,6 +583,7 @@ int main(int argc, char **argv) { initializeExpandTlsPass(Registry); initializeExpandTlsConstantExprPass(Registry); initializeExpandVarArgsPass(Registry); + initializeFlattenGlobalsPass(Registry); initializeGlobalCleanupPass(Registry); initializePNaClABIVerifyFunctionsPass(Registry); initializePNaClABIVerifyModulePass(Registry); |