summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-04 03:39:28 +0000
committerChris Lattner <sabre@nondot.org>2007-05-04 03:39:28 +0000
commita919f6dddc2cfac03f7857849bef42b05167f55c (patch)
treee80da9452ce0e5e2bd46b39926c784d1d6401ec6 /llvm
parent0454316c79586cf713a029a96f1d3f16daaf59cc (diff)
downloadbcm5719-llvm-a919f6dddc2cfac03f7857849bef42b05167f55c.tar.gz
bcm5719-llvm-a919f6dddc2cfac03f7857849bef42b05167f55c.zip
if functiontype is going to have a pointer to a paramattr object, it better
be const. The only way to get a pointer to these returns a const pointer. llvm-svn: 36734
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/DerivedTypes.h6
-rw-r--r--llvm/lib/VMCore/Type.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/llvm/include/llvm/DerivedTypes.h b/llvm/include/llvm/DerivedTypes.h
index af58827c881..5aaa76ede3e 100644
--- a/llvm/include/llvm/DerivedTypes.h
+++ b/llvm/include/llvm/DerivedTypes.h
@@ -140,12 +140,12 @@ public:
class FunctionType : public DerivedType {
friend class TypeMap<FunctionValType, FunctionType>;
bool isVarArgs;
- ParamAttrsList *ParamAttrs;
+ const ParamAttrsList *ParamAttrs;
FunctionType(const FunctionType &); // Do not implement
const FunctionType &operator=(const FunctionType &); // Do not implement
FunctionType(const Type *Result, const std::vector<const Type*> &Params,
- bool IsVarArgs, ParamAttrsList *Attrs = 0);
+ bool IsVarArgs, const ParamAttrsList *Attrs = 0);
public:
/// FunctionType::get - This static method is the primary way of constructing
@@ -155,7 +155,7 @@ public:
const Type *Result, ///< The result type
const std::vector<const Type*> &Params, ///< The types of the parameters
bool isVarArg, ///< Whether this is a variable argument length function
- ParamAttrsList *Attrs = 0
+ const ParamAttrsList *Attrs = 0
///< Indicates the parameter attributes to use, if any. The 0th entry
///< in the list refers to the return type. Parameters are numbered
///< starting at 1. This argument must be on the heap and FunctionType
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp
index 3463e383896..4bb32bbae89 100644
--- a/llvm/lib/VMCore/Type.cpp
+++ b/llvm/lib/VMCore/Type.cpp
@@ -417,7 +417,7 @@ const IntegerType *Type::Int64Ty = new BuiltinIntegerType(64);
FunctionType::FunctionType(const Type *Result,
const std::vector<const Type*> &Params,
- bool IsVarArgs, ParamAttrsList *Attrs)
+ bool IsVarArgs, const ParamAttrsList *Attrs)
: DerivedType(FunctionTyID), isVarArgs(IsVarArgs), ParamAttrs(Attrs) {
ContainedTys = reinterpret_cast<PATypeHandle*>(this+1);
NumContainedTys = Params.size() + 1; // + 1 for result type
@@ -1084,7 +1084,7 @@ FunctionValType FunctionValType::get(const FunctionType *FT) {
FunctionType *FunctionType::get(const Type *ReturnType,
const std::vector<const Type*> &Params,
bool isVarArg,
- ParamAttrsList *Attrs) {
+ const ParamAttrsList *Attrs) {
FunctionValType VT(ReturnType, Params, isVarArg, Attrs);
FunctionType *FT = FunctionTypes->get(VT);
OpenPOWER on IntegriCloud