summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLambda.cpp
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2018-05-16 13:57:17 +0000
committerErich Keane <erich.keane@intel.com>2018-05-16 13:57:17 +0000
commit64144eb194c8eecbc5e7763c1c7c059fb4395861 (patch)
tree51ff23b3866929d62bdd31e271d6e90d936436e0 /clang/lib/Sema/SemaLambda.cpp
parent091069c91e8a0fa173df7895502558f645fb7b9c (diff)
downloadbcm5719-llvm-64144eb194c8eecbc5e7763c1c7c059fb4395861.tar.gz
bcm5719-llvm-64144eb194c8eecbc5e7763c1c7c059fb4395861.zip
Add support for __declspec(code_seg("segname"))
Add support for __declspec(code_seg("segname")) This patch is built on the existing support for #pragma code_seg. The code_seg declspec is allowed on functions and classes. The attribute enables the placement of code into separate named segments, including compiler-generated members and template instantiations. For more information, please see the following: https://msdn.microsoft.com/en-us/library/dn636922.aspx A new CodeSeg attribute is used instead of adding a new spelling to the existing Section attribute since they don’t apply to the same Subjects. Section attributes are also added for the code_seg declspec since they are used for #pragma code_seg. No CodeSeg attributes are added to the AST. The patch is written to match with the Microsoft compiler’s behavior even where that behavior is a little complicated (see https://reviews.llvm.org/D22931, the Microsoft feedback page is no longer available since MS has removed the page). That code is in getImplicitSectionAttrFromClass routine. Diagnostics messages are added to match with the Microsoft compiler for code-seg attribute mismatches on base and derived classes and virtual overrides. Differential Revision: https://reviews.llvm.org/D43352 llvm-svn: 332470
Diffstat (limited to 'clang/lib/Sema/SemaLambda.cpp')
-rw-r--r--clang/lib/Sema/SemaLambda.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp
index fec0d575e5b..4acff89fb90 100644
--- a/clang/lib/Sema/SemaLambda.cpp
+++ b/clang/lib/Sema/SemaLambda.cpp
@@ -910,6 +910,10 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro,
AddRangeBasedOptnone(Method);
// Attributes on the lambda apply to the method.
+ if (Attr *A = getImplicitSectionAttrForFunction(Method))
+ Method->addAttr(A);
+
+ // Attributes on the lambda apply to the method.
ProcessDeclAttributes(CurScope, Method, ParamInfo);
// CUDA lambdas get implicit attributes based on the scope in which they're
OpenPOWER on IntegriCloud