summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-01-03 00:10:22 +0000
committerChris Lattner <sabre@nondot.org>2008-01-03 00:10:22 +0000
commitd0e1f10078426406b56b37fbfc9204dcfeb20f30 (patch)
treec88a2ffc24a199b79f04a250ff52063837401c99
parentd135068e53be6f586e0e56c8828b5c8047818b16 (diff)
downloadbcm5719-llvm-d0e1f10078426406b56b37fbfc9204dcfeb20f30.tar.gz
bcm5719-llvm-d0e1f10078426406b56b37fbfc9204dcfeb20f30.zip
move some code out of line, rearrange a bit.
llvm-svn: 45519
-rw-r--r--llvm/include/llvm/ParameterAttributes.h4
-rw-r--r--llvm/lib/VMCore/ParameterAttributes.cpp16
2 files changed, 11 insertions, 9 deletions
diff --git a/llvm/include/llvm/ParameterAttributes.h b/llvm/include/llvm/ParameterAttributes.h
index 080de469351..05c3ebe9397 100644
--- a/llvm/include/llvm/ParameterAttributes.h
+++ b/llvm/include/llvm/ParameterAttributes.h
@@ -122,14 +122,12 @@ class ParamAttrsList : public FoldingSetNode {
// ParamAttrsList is uniqued, these should not be publicly available
void operator=(const ParamAttrsList &); // Do not implement
ParamAttrsList(const ParamAttrsList &); // Do not implement
- ParamAttrsList(); // Do not implement
~ParamAttrsList(); // Private implementation
/// Only the \p get method can invoke this when it wants to create a
/// new instance.
/// @brief Construct an ParamAttrsList from a ParamAttrsVector
- explicit ParamAttrsList(const ParamAttrsVector &attrVec)
- : attrs(attrVec), refCount(0) {}
+ explicit ParamAttrsList(const ParamAttrsVector &attrVec);
public:
/// This method ensures the uniqueness of ParamAttrsList instances. The
diff --git a/llvm/lib/VMCore/ParameterAttributes.cpp b/llvm/lib/VMCore/ParameterAttributes.cpp
index 37a2819d86e..aaf80cd7658 100644
--- a/llvm/lib/VMCore/ParameterAttributes.cpp
+++ b/llvm/lib/VMCore/ParameterAttributes.cpp
@@ -15,6 +15,16 @@
#include "llvm/Support/ManagedStatic.h"
using namespace llvm;
+static ManagedStatic<FoldingSet<ParamAttrsList> > ParamAttrsLists;
+
+ParamAttrsList::ParamAttrsList(const ParamAttrsVector &attrVec)
+ : attrs(attrVec), refCount(0) {
+}
+
+ParamAttrsList::~ParamAttrsList() {
+ ParamAttrsLists->RemoveNode(this);
+}
+
uint16_t
ParamAttrsList::getParamAttrs(uint16_t Index) const {
unsigned limit = attrs.size();
@@ -101,8 +111,6 @@ void ParamAttrsList::Profile(FoldingSetNodeID &ID) const {
ID.AddInteger(unsigned(attrs[i].attrs) << 16 | unsigned(attrs[i].index));
}
-static ManagedStatic<FoldingSet<ParamAttrsList> > ParamAttrsLists;
-
const ParamAttrsList *
ParamAttrsList::get(const ParamAttrsVector &attrVec) {
// If there are no attributes then return a null ParamAttrsList pointer.
@@ -220,7 +228,3 @@ ParamAttrsList::excludeAttrs(const ParamAttrsList *PAL,
return getModified(PAL, modVec);
}
-ParamAttrsList::~ParamAttrsList() {
- ParamAttrsLists->RemoveNode(this);
-}
-
OpenPOWER on IntegriCloud