aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/InterpShared.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/ByteCode/InterpShared.cpp')
-rw-r--r--clang/lib/AST/ByteCode/InterpShared.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/lib/AST/ByteCode/InterpShared.cpp b/clang/lib/AST/ByteCode/InterpShared.cpp
index 1e94dc1..e01b32b 100644
--- a/clang/lib/AST/ByteCode/InterpShared.cpp
+++ b/clang/lib/AST/ByteCode/InterpShared.cpp
@@ -16,23 +16,23 @@ namespace interp {
llvm::BitVector collectNonNullArgs(const FunctionDecl *F,
ArrayRef<const Expr *> Args) {
llvm::BitVector NonNullArgs;
- if (!F)
- return NonNullArgs;
assert(F);
+ assert(F->hasAttr<NonNullAttr>());
NonNullArgs.resize(Args.size());
for (const auto *Attr : F->specific_attrs<NonNullAttr>()) {
if (!Attr->args_size()) {
NonNullArgs.set();
break;
- } else
- for (auto Idx : Attr->args()) {
- unsigned ASTIdx = Idx.getASTIndex();
- if (ASTIdx >= Args.size())
- continue;
- NonNullArgs[ASTIdx] = true;
- }
+ }
+
+ for (auto Idx : Attr->args()) {
+ unsigned ASTIdx = Idx.getASTIndex();
+ if (ASTIdx >= Args.size())
+ continue;
+ NonNullArgs[ASTIdx] = true;
+ }
}
return NonNullArgs;