summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-03-12 17:45:29 +0000
committerChris Lattner <sabre@nondot.org>2008-03-12 17:45:29 +0000
commit8a923e7c288cf383c2d44a23080d02579126c0a0 (patch)
tree528109f8de22bcc7ff4a60c0323b5722be9a8919 /llvm/lib/Bitcode/Reader/BitcodeReader.h
parentb327e490473fdf5673e4ae5641f9f1b60a8c5f61 (diff)
downloadbcm5719-llvm-8a923e7c288cf383c2d44a23080d02579126c0a0.tar.gz
bcm5719-llvm-8a923e7c288cf383c2d44a23080d02579126c0a0.zip
Reimplement the parameter attributes support, phase #1. hilights:
1. There is now a "PAListPtr" class, which is a smart pointer around the underlying uniqued parameter attribute list object, and manages its refcount. It is now impossible to mess up the refcount. 2. PAListPtr is now the main interface to the underlying object, and the underlying object is now completely opaque. 3. Implementation details like SmallVector and FoldingSet are now no longer part of the interface. 4. You can create a PAListPtr with an arbitrary sequence of ParamAttrsWithIndex's, no need to make a SmallVector of a specific size (you can just use an array or scalar or vector if you wish). 5. All the client code that had to check for a null pointer before dereferencing the pointer is simplified to just access the PAListPtr directly. 6. The interfaces for adding attrs to a list and removing them is a bit simpler. Phase #2 will rename some stuff (e.g. PAListPtr) and do other less invasive changes. llvm-svn: 48289
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.h')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.h b/llvm/lib/Bitcode/Reader/BitcodeReader.h
index d7df1a1b029..9a140d95241 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.h
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.h
@@ -15,6 +15,7 @@
#define BITCODE_READER_H
#include "llvm/ModuleProvider.h"
+#include "llvm/ParameterAttributes.h"
#include "llvm/Type.h"
#include "llvm/User.h"
#include "llvm/Bitcode/BitstreamReader.h"
@@ -24,7 +25,6 @@
namespace llvm {
class MemoryBuffer;
- class ParamAttrsList;
class BitcodeReaderValueList : public User {
std::vector<Use> Uses;
@@ -93,7 +93,7 @@ class BitcodeReader : public ModuleProvider {
/// ParamAttrs - The set of parameter attributes by index. Index zero in the
/// file is for null, and is thus not represented here. As such all indices
/// are off by one.
- std::vector<const ParamAttrsList*> ParamAttrs;
+ std::vector<PAListPtr> ParamAttrs;
/// FunctionBBs - While parsing a function body, this is a list of the basic
/// blocks for the function.
@@ -156,10 +156,10 @@ private:
if (ID >= FunctionBBs.size()) return 0; // Invalid ID
return FunctionBBs[ID];
}
- const ParamAttrsList *getParamAttrs(unsigned i) const {
+ PAListPtr getParamAttrs(unsigned i) const {
if (i-1 < ParamAttrs.size())
return ParamAttrs[i-1];
- return 0;
+ return PAListPtr();
}
/// getValueTypePair - Read a value/type pair out of the specified record from
OpenPOWER on IntegriCloud