aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Attributes.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/llvm/Attributes.h b/include/llvm/Attributes.h
index c9589603f9..381aedf957 100644
--- a/include/llvm/Attributes.h
+++ b/include/llvm/Attributes.h
@@ -518,7 +518,10 @@ public:
/// getParamAttributes - The attributes for the specified index are
/// returned.
Attributes getParamAttributes(unsigned Idx) const {
- assert (Idx && Idx != ~0U && "Invalid parameter index!");
+ if (Idx == 0)
+ return getRetAttributes();
+ if (Idx == ~0U)
+ return getFnAttributes();
return getAttributes(Idx);
}