diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2017-12-15 16:28:31 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2017-12-15 16:28:31 +0000 |
commit | b952e639d9dc0cf9c7d46231d080e436fae5f9e4 (patch) | |
tree | 2f949b961d84dc59a82293f25498e01457978d50 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | cb12249238f063038b58cfb3d724a4ed010e83ef (diff) | |
download | bcm5719-llvm-b952e639d9dc0cf9c7d46231d080e436fae5f9e4.tar.gz bcm5719-llvm-b952e639d9dc0cf9c7d46231d080e436fae5f9e4.zip |
[OPENMP] Codegen `declare simd` for function declarations.
Previously the attributes were emitted only for function definitions.
Patch adds emission of the attributes for function declarations.
llvm-svn: 320826
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 421a1ad3d0d..c59dc71da59 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1238,6 +1238,9 @@ void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F, // is handled with better precision by the receiving DSO. if (!CodeGenOpts.SanitizeCfiCrossDso) CreateFunctionTypeMetadata(FD, F); + + if (getLangOpts().OpenMP && FD->hasAttr<OMPDeclareSimdDeclAttr>()) + getOpenMPRuntime().emitDeclareSimdFunction(FD, F); } void CodeGenModule::addUsedGlobal(llvm::GlobalValue *GV) { |