Implement support for the const and pure attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57142 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index a1c3c33..a246ade 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -520,6 +520,10 @@
       FuncAttrs |= llvm::Attribute::NoUnwind;
     if (TargetDecl->getAttr<NoReturnAttr>())
       FuncAttrs |= llvm::Attribute::NoReturn;
+    if (TargetDecl->getAttr<PureAttr>())
+      FuncAttrs |= llvm::Attribute::ReadOnly;
+    if (TargetDecl->getAttr<ConstAttr>())
+      FuncAttrs |= llvm::Attribute::ReadNone;
   }
 
   QualType RetTy = *begin;