mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
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
This commit is contained in:
parent
e54252e6e1
commit
c613164542
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user