diff options
author | Chris Lattner <sabre@nondot.org> | 2008-01-03 01:20:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-01-03 01:20:12 +0000 |
commit | d21fcd52b8fadd45920a362ad9a04ab059eff1cd (patch) | |
tree | 00556cf4522dbb874ecd66b333dc02fe0d0ebf03 | |
parent | 3de70632b2534d164c30239d5c437765b97b723f (diff) | |
download | external_llvm-d21fcd52b8fadd45920a362ad9a04ab059eff1cd.zip external_llvm-d21fcd52b8fadd45920a362ad9a04ab059eff1cd.tar.gz external_llvm-d21fcd52b8fadd45920a362ad9a04ab059eff1cd.tar.bz2 |
Remove the function attr cache for intrinsics. This does not maintain the
refcount on these correctly, and can end up referring to deleted
attributes. This fixes PR1881.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45525 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/VMCore/Function.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index b9a139d..8e6570a 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -325,11 +325,6 @@ const FunctionType *Intrinsic::getType(ID id, const Type **Tys, } const ParamAttrsList *Intrinsic::getParamAttrs(ID id) { - static const ParamAttrsList *IntrinsicAttributes[Intrinsic::num_intrinsics]; - - if (IntrinsicAttributes[id]) - return IntrinsicAttributes[id]; - ParamAttrsVector Attrs; uint16_t Attr = ParamAttr::None; @@ -341,8 +336,7 @@ const ParamAttrsList *Intrinsic::getParamAttrs(ID id) { Attr |= ParamAttr::NoUnwind; Attrs.push_back(ParamAttrsWithIndex::get(0, Attr)); - IntrinsicAttributes[id] = ParamAttrsList::get(Attrs); - return IntrinsicAttributes[id]; + return ParamAttrsList::get(Attrs); } Function *Intrinsic::getDeclaration(Module *M, ID id, const Type **Tys, |