Make sure to print cvr-qualifiers on function declarations
authorDouglas Gregor <dgregor@apple.com>
Fri, 19 Nov 2010 18:44:34 +0000 (18:44 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 19 Nov 2010 18:44:34 +0000 (18:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119817 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DeclPrinter.cpp

index a8f19952b698e1f8b5c3d410ba066dbe9ce82e28..a6e60aa5afaa007474690b5a05a1c710c6c939e9 100644 (file)
@@ -379,6 +379,16 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
 
     Proto += ")";
     
+    if (FT && FT->getTypeQuals()) {
+      unsigned TypeQuals = FT->getTypeQuals();
+      if (TypeQuals & Qualifiers::Const)
+        Proto += " const";
+      if (TypeQuals & Qualifiers::Volatile) 
+        Proto += " volatile";
+      if (TypeQuals & Qualifiers::Restrict)
+        Proto += " restrict";
+    }
+    
     if (FT && FT->hasExceptionSpec()) {
       Proto += " throw(";
       if (FT->hasAnyExceptionSpec())