summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-12-09 16:11:56 -0800
committerReid Kleckner <rnk@google.com>2019-12-09 16:17:18 -0800
commit9803178a78c1858b0ac868c2cdf402cec5a10db9 (patch)
tree1e6406871a61926a4e46e39639e2d97b2e2caa2d /clang/lib/CodeGen/CodeGenFunction.cpp
parent7c69a03c56601a55f47f29ea59e33c37e62db556 (diff)
downloadbcm5719-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.cpp10
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() ||
OpenPOWER on IntegriCloud