summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-10-31 17:08:11 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-10-31 17:08:11 +0000
commit9491a5cd4d2d315a98d113b373b0fc11cbd350a9 (patch)
tree86460e9b05753f532fbdfc6baf7f67b6bb93845c
parent626507fab33b50ef542c75078de1182791ceca9a (diff)
downloadbcm5719-llvm-9491a5cd4d2d315a98d113b373b0fc11cbd350a9.tar.gz
bcm5719-llvm-9491a5cd4d2d315a98d113b373b0fc11cbd350a9.zip
Fix unused-function warning differently from r220853
Rather than executing this code only needed for an assertion even in a non-asserts build, just roll the function into the assert. The assertion text literally describes the two cases so it doesn't seem like this benefits much from having a separate function (& have to hassle about ifndef NDEBUG it out, etc) llvm-svn: 220970
-rw-r--r--clang/lib/AST/Decl.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 4337eab16b7..c979759b7ad 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -3283,11 +3283,6 @@ bool FieldDecl::isAnonymousStructOrUnion() const {
return false;
}
-static bool isVLATypeCapturingAllowed(const RecordDecl *RD) {
- // Allow variable-length array capturing in Lambdas and CapturedStmts.
- return RD->isLambda() || RD->isCapturedRecord();
-}
-
unsigned FieldDecl::getBitWidthValue(const ASTContext &Ctx) const {
assert(isBitField() && "not a bitfield");
Expr *BitWidth = static_cast<Expr *>(InitStorage.getPointer());
@@ -3330,10 +3325,8 @@ SourceRange FieldDecl::getSourceRange() const {
}
void FieldDecl::setCapturedVLAType(const VariableArrayType *VLAType) {
- bool fVLATypeCapturingAllowed = isVLATypeCapturingAllowed(getParent());
- assert(fVLATypeCapturingAllowed &&
+ assert((RD->isLambda() || RD->isCapturedRecord()) &&
"capturing type in non-lambda or captured record.");
- (void)fVLATypeCapturingAllowed;
assert(InitStorage.getInt() == ISK_BitWidthOrNothing &&
InitStorage.getPointer() == nullptr &&
"bit width, initializer or captured type already set");
OpenPOWER on IntegriCloud