diff options
author | Karl Schimpf <kschimpf@google.com> | 2013-06-24 12:12:38 -0700 |
---|---|---|
committer | Karl Schimpf <kschimpf@google.com> | 2013-06-24 12:12:38 -0700 |
commit | 9bdedeb556e162cecaa79aff339150ea53aae99f (patch) | |
tree | 9a8440ecdfd3c06d74e2627c9a4aee2b144de006 /lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp | |
parent | 41dd5ede22556305aed7ea2184a2905f187db78c (diff) |
Simplify representation of forward value references in bitcode.
Simplify instruction records by adding concept of a forward type reference
map that maps ValueID's to types. Used to generate forward reference types
for instruction arguments that need a type because the forward reference
has not yet been generated.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3507
R=jvoung@chromium.org, mseaborn@chromium.org
Review URL: https://codereview.chromium.org/16963004
Diffstat (limited to 'lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp')
-rw-r--r-- | lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp b/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp index 845a608255..4ff9b47bcc 100644 --- a/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp +++ b/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp @@ -497,6 +497,9 @@ void NaClValueEnumerator::incorporateFunction(const Function &F) { NumModuleValues = Values.size(); NumModuleMDValues = MDValues.size(); + // Make sure no insertions outside of a function. + assert(FnForwardTypeRefs.empty()); + // Adding function arguments to the value table. for (Function::const_arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) @@ -565,6 +568,7 @@ void NaClValueEnumerator::purgeFunction() { MDValues.resize(NumModuleMDValues); BasicBlocks.clear(); FunctionLocalMDs.clear(); + FnForwardTypeRefs.clear(); } static void IncorporateFunctionInfoGlobalBBIDs(const Function *F, |