summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/CommentLexer.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-09-18 12:11:16 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-09-18 12:11:16 +0000
commit4b8b7f249c627639d2c529d460e7f015fe47385f (patch)
treeb1b0254f7191cd4f27a7207868d66c47b0265cf5 /clang/lib/AST/CommentLexer.cpp
parent1541dd4841860589866ddf3befeac604fdd3d5ec (diff)
downloadbcm5719-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.cpp7
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());
OpenPOWER on IntegriCloud