diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-06-21 11:34:16 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-06-21 11:34:16 -0700 |
commit | 222873819b08b3758f82bc2f432a99dcd76397de (patch) | |
tree | ecc203076dba68796eed8856145276b05bd1a339 /lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp | |
parent | c51cdee071a24059cc510297a3a6ad4cf5c8f4fa (diff) |
PNaCl wire format: Remove function attributes from pexe reader/writer
Remove support for reading and writing the PARAMATTR_BLOCK_ID and
PARAMATTR_GROUP_BLOCK_ID blocks.
These blocks will no longer be written into pexes. While PNaCl
doesn't allow function attributes on normal functions,
Function::Create() always inserts them back on intrinsics, so
previously the PARAMATTR blocks were being written into pexes.
Remove paramattr fields from two record types:
* MODULE_CODE_FUNCTION records (function declarations). Also remove
the fields that follow paramattr, which PNaCl also does not use.
* FUNC_CODE_INST_CALL (function calls).
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3506
TEST=PNaCl toolchain trybots + GCC torture tests + Spec2k
Review URL: https://codereview.chromium.org/17419013
Diffstat (limited to 'lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp')
-rw-r--r-- | lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp b/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp index e5554b206a..845a608255 100644 --- a/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp +++ b/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp @@ -50,7 +50,6 @@ NaClValueEnumerator::NaClValueEnumerator(const Module *M) { // Enumerate the functions. for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) { EnumerateValue(I); - EnumerateAttributes(cast<Function>(I)->getAttributes()); } // Enumerate the aliases. @@ -97,10 +96,6 @@ NaClValueEnumerator::NaClValueEnumerator(const Module *M) { EnumerateOperandType(*OI); } EnumerateType(I->getType()); - if (const CallInst *CI = dyn_cast<CallInst>(I)) - EnumerateAttributes(CI->getAttributes()); - else if (const InvokeInst *II = dyn_cast<InvokeInst>(I)) - EnumerateAttributes(II->getAttributes()); // Enumerate metadata attached with this instruction. MDs.clear(); @@ -497,28 +492,6 @@ void NaClValueEnumerator::EnumerateOperandType(const Value *V) { EnumerateMetadata(V); } -void NaClValueEnumerator::EnumerateAttributes(AttributeSet PAL) { - if (PAL.isEmpty()) return; // null is always 0. - - // Do a lookup. - unsigned &Entry = AttributeMap[PAL]; - if (Entry == 0) { - // Never saw this before, add it. - Attribute.push_back(PAL); - Entry = Attribute.size(); - } - - // Do lookups for all attribute groups. - for (unsigned i = 0, e = PAL.getNumSlots(); i != e; ++i) { - AttributeSet AS = PAL.getSlotAttributes(i); - unsigned &Entry = AttributeGroupMap[AS]; - if (Entry == 0) { - AttributeGroups.push_back(AS); - Entry = AttributeGroups.size(); - } - } -} - void NaClValueEnumerator::incorporateFunction(const Function &F) { InstructionCount = 0; NumModuleValues = Values.size(); @@ -547,10 +520,6 @@ void NaClValueEnumerator::incorporateFunction(const Function &F) { // Optimize the constant layout. OptimizeConstants(FirstFuncConstantID, Values.size()); - // Add the function's parameter attributes so they are available for use in - // the function's instruction. - EnumerateAttributes(F.getAttributes()); - FirstInstID = Values.size(); SmallVector<MDNode *, 8> FnLocalMDVector; |