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 | 76719ba5f1bfdf01d066bab0cf5970656b756596 (patch) | |
| tree | 37f5572955e229d863fed2dec34ed1b65e04d22d /llvm/lib/VMCore | |
| parent | b18b0b99c6c5a1d8ddfd3bcaf1015c1237840ada (diff) | |
| download | bcm5719-llvm-76719ba5f1bfdf01d066bab0cf5970656b756596.tar.gz bcm5719-llvm-76719ba5f1bfdf01d066bab0cf5970656b756596.zip | |
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.
llvm-svn: 45525
Diffstat (limited to 'llvm/lib/VMCore')
| -rw-r--r-- | llvm/lib/VMCore/Function.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp index b9a139d75b4..8e6570a6272 100644 --- a/llvm/lib/VMCore/Function.cpp +++ b/llvm/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, |

