summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-02-04 07:23:21 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-02-04 07:23:21 +0000
commit631a90b6bc1d8526d463660934dedf21c1904e5f (patch)
tree25419238e391a33944531d075c189ceac4e153d5 /clang/lib/CodeGen
parenta3d95342485530eff535e880fbd94673cf3d62e9 (diff)
downloadbcm5719-llvm-631a90b6bc1d8526d463660934dedf21c1904e5f.tar.gz
bcm5719-llvm-631a90b6bc1d8526d463660934dedf21c1904e5f.zip
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. llvm-svn: 228120
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 6515d14f8bb..b0b30a6133a 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud