Make Declarator::getDeclSpec() return a const reference to avoid
cases where mutation can introduce bugs.  Propagate around 'const'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52772 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 278c841..e0d9758 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -296,9 +296,9 @@
   ScopedDecl *ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II,
                                  Scope *S);
   // Decl attributes - this routine is the top level dispatcher. 
-  void HandleDeclAttributes(Decl *New, AttributeList *declspec_prefix,
-                            AttributeList *declarator_postfix);
-  void HandleDeclAttribute(Decl *New, AttributeList *rawAttr);
+  void HandleDeclAttributes(Decl *New, const AttributeList *DeclSpecAttrs,
+                            const AttributeList *DeclaratorAttrs);
+  void HandleDeclAttribute(Decl *New, const AttributeList *rawAttr);
 
   /// HandleAddressSpaceTypeAttribute - this attribute is only applicable to 
   /// objects without automatic storage duration. 
@@ -311,7 +311,7 @@
   /// primitive type.  Note that this is a variable attribute, and not
   /// a type attribute.
   QualType HandleModeTypeAttribute(QualType curType, 
-                                   AttributeList *rawAttr);                                
+                                   const AttributeList *rawAttr);
 
   // HandleVectorTypeAttribute - this attribute is only applicable to 
   // integral and float scalars, although arrays, pointers, and function
@@ -321,24 +321,26 @@
   // The raw attribute should contain precisely 1 argument, the vector size 
   // for the variable, measured in bytes. If curType and rawAttr are well
   // formed, this routine will return a new vector type.
-  QualType HandleVectorTypeAttribute(QualType curType, AttributeList *rawAttr);
-  void HandleExtVectorTypeAttribute(TypedefDecl *d, AttributeList *rawAttr);
+  QualType HandleVectorTypeAttribute(QualType curType,
+                                     const AttributeList *rawAttr);
+  void HandleExtVectorTypeAttribute(TypedefDecl *d, 
+                                    const AttributeList *rawAttr);
   
-  void HandleAlignedAttribute(Decl *d, AttributeList *rawAttr);
-  void HandleAliasAttribute(Decl *d, AttributeList *rawAttr);
-  void HandlePackedAttribute(Decl *d, AttributeList *rawAttr);
-  void HandleAnnotateAttribute(Decl *d, AttributeList *rawAttr);
-  void HandleNoReturnAttribute(Decl *d, AttributeList *rawAttr);
-  void HandleDeprecatedAttribute(Decl *d, AttributeList *rawAttr);
-  void HandleWeakAttribute(Decl *d, AttributeList *rawAttr);
-  void HandleDLLImportAttribute(Decl *d, AttributeList *rawAttr);
-  void HandleDLLExportAttribute(Decl *d, AttributeList *rawAttr);
-  void HandleVisibilityAttribute(Decl *d, AttributeList *rawAttr);
-  void HandleNothrowAttribute(Decl *d, AttributeList *rawAttr);
-  void HandleFormatAttribute(Decl *d, AttributeList *rawAttr);
-  void HandleStdCallAttribute(Decl *d, AttributeList *rawAttr);
-  void HandleFastCallAttribute(Decl *d, AttributeList *rawAttr);
-  void HandleTransparentUnionAttribute(Decl *d, AttributeList *rawAttr);
+  void HandleAlignedAttribute(Decl *d, const AttributeList *rawAttr);
+  void HandleAliasAttribute(Decl *d, const AttributeList *rawAttr);
+  void HandlePackedAttribute(Decl *d, const AttributeList *rawAttr);
+  void HandleAnnotateAttribute(Decl *d, const AttributeList *rawAttr);
+  void HandleNoReturnAttribute(Decl *d, const AttributeList *rawAttr);
+  void HandleDeprecatedAttribute(Decl *d, const AttributeList *rawAttr);
+  void HandleWeakAttribute(Decl *d, const AttributeList *rawAttr);
+  void HandleDLLImportAttribute(Decl *d, const AttributeList *rawAttr);
+  void HandleDLLExportAttribute(Decl *d, const AttributeList *rawAttr);
+  void HandleVisibilityAttribute(Decl *d, const AttributeList *rawAttr);
+  void HandleNothrowAttribute(Decl *d, const AttributeList *rawAttr);
+  void HandleFormatAttribute(Decl *d, const AttributeList *rawAttr);
+  void HandleStdCallAttribute(Decl *d, const AttributeList *rawAttr);
+  void HandleFastCallAttribute(Decl *d, const AttributeList *rawAttr);
+  void HandleTransparentUnionAttribute(Decl *d, const AttributeList *rawAttr);
   
   void WarnUndefinedMethod(SourceLocation ImpLoc, ObjCMethodDecl *method,
                            bool &IncompleteImpl);