From 58d74910c6b82e622ecbb57d6644d48fec5a5c0f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 12 Mar 2008 17:45:29 +0000 Subject: Reimplement the parameter attributes support, phase #1. hilights: 1. There is now a "PAListPtr" class, which is a smart pointer around the underlying uniqued parameter attribute list object, and manages its refcount. It is now impossible to mess up the refcount. 2. PAListPtr is now the main interface to the underlying object, and the underlying object is now completely opaque. 3. Implementation details like SmallVector and FoldingSet are now no longer part of the interface. 4. You can create a PAListPtr with an arbitrary sequence of ParamAttrsWithIndex's, no need to make a SmallVector of a specific size (you can just use an array or scalar or vector if you wish). 5. All the client code that had to check for a null pointer before dereferencing the pointer is simplified to just access the PAListPtr directly. 6. The interfaces for adding attrs to a list and removing them is a bit simpler. Phase #2 will rename some stuff (e.g. PAListPtr) and do other less invasive changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48289 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/PruneEH.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/Transforms/IPO/PruneEH.cpp') diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp index 147818a47e..46e11280b0 100644 --- a/lib/Transforms/IPO/PruneEH.cpp +++ b/lib/Transforms/IPO/PruneEH.cpp @@ -25,7 +25,6 @@ #include "llvm/ADT/Statistic.h" #include "llvm/Support/CFG.h" #include "llvm/Support/Compiler.h" -#include "llvm/ParamAttrsList.h" #include #include using namespace llvm; @@ -131,9 +130,8 @@ bool PruneEH::runOnSCC(const std::vector &SCC) { if (!SCCMightReturn) NewAttributes |= ParamAttr::NoReturn; - const ParamAttrsList *PAL = SCC[i]->getFunction()->getParamAttrs(); - PAL = ParamAttrsList::includeAttrs(PAL, 0, NewAttributes); - SCC[i]->getFunction()->setParamAttrs(PAL); + const PAListPtr &PAL = SCC[i]->getFunction()->getParamAttrs(); + SCC[i]->getFunction()->setParamAttrs(PAL.addAttr(0, NewAttributes)); } for (unsigned i = 0, e = SCC.size(); i != e; ++i) { -- cgit v1.2.3