diff options
| author | Carlos Alberto Enciso <carlos.alberto.enciso@gmail.com> | 2018-03-26 13:48:03 +0000 |
|---|---|---|
| committer | Carlos Alberto Enciso <carlos.alberto.enciso@gmail.com> | 2018-03-26 13:48:03 +0000 |
| commit | 01ae6f2c5f0e48f42f9e8a66f2c9a02106034696 (patch) | |
| tree | 623a366f934aea3caeeb69e1ddba3193d20b8fcc /clang/lib | |
| parent | ff9c1092b708d39f9dc99855f31d75b50c809c63 (diff) | |
| download | bcm5719-llvm-01ae6f2c5f0e48f42f9e8a66f2c9a02106034696.tar.gz bcm5719-llvm-01ae6f2c5f0e48f42f9e8a66f2c9a02106034696.zip | |
[SemaCXX] _Pragma("clang optimize off") not affecting lambda.
Declaring "_Pragma("clang optimize off")" before the body of a
function with a lambda leads to the lambda functions in the body
not being affected.
Differential Revision: https://reviews.llvm.org/D43821
llvm-svn: 328494
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaLambda.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp index db8dd1793cf..1b9702f79ac 100644 --- a/clang/lib/Sema/SemaLambda.cpp +++ b/clang/lib/Sema/SemaLambda.cpp @@ -904,6 +904,10 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro, ParamInfo.getDeclSpec().isConstexprSpecified()); if (ExplicitParams) CheckCXXDefaultArguments(Method); + + // This represents the function body for the lambda function, check if we + // have to apply optnone due to a pragma. + AddRangeBasedOptnone(Method); // Attributes on the lambda apply to the method. ProcessDeclAttributes(CurScope, Method, ParamInfo); |

