For setting attributes, don't assume there are ParamVarDecls available, 
because trying to access non-existent ParamVarDecls can crash. 
Testcase from the original source for PR2414.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51960 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/typedef-func.c b/test/CodeGen/typedef-func.c
index 08328e6..c14a42c 100644
--- a/test/CodeGen/typedef-func.c
+++ b/test/CodeGen/typedef-func.c
@@ -1,13 +1,16 @@
 // RUN: clang -emit-llvm < %s
 
 // PR2414
-typedef void filter_func_t();
+struct mad_frame{};
+enum mad_flow {};
+
+typedef enum mad_flow filter_func_t(void *, struct mad_frame *);
+
 filter_func_t mono_filter;
 
 void addfilter2(filter_func_t *func){}
 
 void setup_filters()
 {
-        addfilter2( mono_filter);
+  addfilter2( mono_filter);
 }
-