diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-02-04 07:23:21 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-02-04 07:23:21 +0000 |
commit | a0cdc21a4388c6da290fcf88db023fbfa971270f (patch) | |
tree | 380371dd98b9ac0287c8a522898b23052d9e1351 /lib/CodeGen/CGCall.cpp | |
parent | 02e88c076bc8781552c97e4da251d03f320cb0c8 (diff) |
Sema: Add support for __declspec(restrict)
__declspec(restrict) and __attribute(malloc) are both handled
identically by clang: they are allowed to the noalias LLVM attribute.
Seeing as how noalias models the C99 notion of 'restrict', rename the
internal clang attribute to Restrict from Malloc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228120 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 6515d14f8b..b0b30a6133 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -1402,7 +1402,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, FuncAttrs.addAttribute(llvm::Attribute::ReadOnly); FuncAttrs.addAttribute(llvm::Attribute::NoUnwind); } - if (TargetDecl->hasAttr<MallocAttr>()) + if (TargetDecl->hasAttr<RestrictAttr>()) RetAttrs.addAttribute(llvm::Attribute::NoAlias); if (TargetDecl->hasAttr<ReturnsNonNullAttr>()) RetAttrs.addAttribute(llvm::Attribute::NonNull); |