Don't set both readnone and readonly.

llvm-svn: 68833
This commit is contained in:
Daniel Dunbar 2009-04-10 22:14:52 +00:00
parent d959d753bc
commit 8c920c9220
2 changed files with 6 additions and 2 deletions

View File

@ -1654,10 +1654,10 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
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;
else if (TargetDecl->getAttr<PureAttr>())
FuncAttrs |= llvm::Attribute::ReadOnly;
}
QualType RetTy = FI.getReturnType();

View File

@ -43,4 +43,8 @@ int f12(int arg) {
return arg ? 0 : f10_t();
}
// RUN: grep 'define void @f13() nounwind readnone' %t &&
void f13(void) __attribute__((pure)) __attribute__((const));
void f13(void){}
// RUN: true