[llvm-commits] [llvm] r45525 - /llvm/trunk/lib/VMCore/Function.cpp
Chris Lattner
sabre at nondot.org
Wed Jan 2 17:20:12 PST 2008
Author: lattner
Date: Wed Jan 2 19:20:12 2008
New Revision: 45525
URL: http://llvm.org/viewvc/llvm-project?rev=45525&view=rev
Log:
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.
Modified:
llvm/trunk/lib/VMCore/Function.cpp
Modified: llvm/trunk/lib/VMCore/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=45525&r1=45524&r2=45525&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Function.cpp (original)
+++ llvm/trunk/lib/VMCore/Function.cpp Wed Jan 2 19:20:12 2008
@@ -325,11 +325,6 @@
}
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 @@
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,
More information about the llvm-commits
mailing list