aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r--lib/CodeGen/CGCall.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index a1c3c33462..a246ade82c 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -520,6 +520,10 @@ void CodeGenModule::ConstructAttributeList(const Decl *TargetDecl,
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;