diff options
author | Reid Kleckner <rnk@google.com> | 2019-12-09 16:11:56 -0800 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2019-12-09 16:17:18 -0800 |
commit | 9803178a78c1858b0ac868c2cdf402cec5a10db9 (patch) | |
tree | 1e6406871a61926a4e46e39639e2d97b2e2caa2d /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 7c69a03c56601a55f47f29ea59e33c37e62db556 (diff) | |
download | bcm5719-llvm-9803178a78c1858b0ac868c2cdf402cec5a10db9.tar.gz bcm5719-llvm-9803178a78c1858b0ac868c2cdf402cec5a10db9.zip |
Avoid Attr.h includes, CodeGen edition
This saves around 20 includes of Attr.h. Not much.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 3b63d7cdf91..a2d34d41db2 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -12,9 +12,9 @@ #include "CodeGenFunction.h" #include "CGBlocks.h" -#include "CGCleanup.h" #include "CGCUDARuntime.h" #include "CGCXXABI.h" +#include "CGCleanup.h" #include "CGDebugInfo.h" #include "CGOpenMPRuntime.h" #include "CodeGenModule.h" @@ -22,6 +22,7 @@ #include "TargetInfo.h" #include "clang/AST/ASTContext.h" #include "clang/AST/ASTLambda.h" +#include "clang/AST/Attr.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/StmtCXX.h" @@ -660,6 +661,13 @@ void CodeGenFunction::markAsIgnoreThreadCheckingAtRuntime(llvm::Function *Fn) { } } +/// Check if the return value of this function requires sanitization. +bool CodeGenFunction::requiresReturnValueCheck() const { + return requiresReturnValueNullabilityCheck() || + (SanOpts.has(SanitizerKind::ReturnsNonnullAttribute) && CurCodeDecl && + CurCodeDecl->getAttr<ReturnsNonNullAttr>()); +} + static bool matchesStlAllocatorFn(const Decl *D, const ASTContext &Ctx) { auto *MD = dyn_cast_or_null<CXXMethodDecl>(D); if (!MD || !MD->getDeclName().getAsIdentifierInfo() || |