diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-09-18 12:11:16 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-09-18 12:11:16 +0000 |
commit | 4b8b7f249c627639d2c529d460e7f015fe47385f (patch) | |
tree | b1b0254f7191cd4f27a7207868d66c47b0265cf5 /clang/lib/AST/CommentLexer.cpp | |
parent | 1541dd4841860589866ddf3befeac604fdd3d5ec (diff) | |
download | bcm5719-llvm-4b8b7f249c627639d2c529d460e7f015fe47385f.tar.gz bcm5719-llvm-4b8b7f249c627639d2c529d460e7f015fe47385f.zip |
[AST] CommentLexer - Remove (optional) Invalid parameter from getSpelling.
The static analyzer noticed that we were dereferencing it even when the default null value was being used. Further investigation showed that we never explicitly set the parameter so I've just removed it entirely.
llvm-svn: 372217
Diffstat (limited to 'clang/lib/AST/CommentLexer.cpp')
-rw-r--r-- | clang/lib/AST/CommentLexer.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/AST/CommentLexer.cpp b/clang/lib/AST/CommentLexer.cpp index 19485f6018c..c1ea3eab075 100644 --- a/clang/lib/AST/CommentLexer.cpp +++ b/clang/lib/AST/CommentLexer.cpp @@ -850,17 +850,14 @@ again: } StringRef Lexer::getSpelling(const Token &Tok, - const SourceManager &SourceMgr, - bool *Invalid) const { + const SourceManager &SourceMgr) const { SourceLocation Loc = Tok.getLocation(); std::pair<FileID, unsigned> LocInfo = SourceMgr.getDecomposedLoc(Loc); bool InvalidTemp = false; StringRef File = SourceMgr.getBufferData(LocInfo.first, &InvalidTemp); - if (InvalidTemp) { - *Invalid = true; + if (InvalidTemp) return StringRef(); - } const char *Begin = File.data() + LocInfo.second; return StringRef(Begin, Tok.getLength()); |