summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-03 05:04:52 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-03 05:04:52 +0000
commit507f1bc37e86a3488c89dc2fdfd7f402bad3b265 (patch)
tree3df687dd982facc3dc94072ea8934ccb7790ab80 /clang
parent04ade04e981cfe7377a1f61483af88a272719140 (diff)
downloadbcm5719-llvm-507f1bc37e86a3488c89dc2fdfd7f402bad3b265.tar.gz
bcm5719-llvm-507f1bc37e86a3488c89dc2fdfd7f402bad3b265.zip
Don't assume an implicit IntrusiveRefCntPtr -> bool operator.
llvm-svn: 210075
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Frontend/CompilerInstance.h16
-rw-r--r--clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp2
2 files changed, 9 insertions, 9 deletions
diff --git a/clang/include/clang/Frontend/CompilerInstance.h b/clang/include/clang/Frontend/CompilerInstance.h
index 97c140ecbda..53c9193ed0a 100644
--- a/clang/include/clang/Frontend/CompilerInstance.h
+++ b/clang/include/clang/Frontend/CompilerInstance.h
@@ -193,7 +193,7 @@ public:
/// @name Compiler Invocation and Options
/// {
- bool hasInvocation() const { return Invocation != nullptr; }
+ bool hasInvocation() const { return (bool)Invocation; }
CompilerInvocation &getInvocation() {
assert(Invocation && "Compiler instance has no invocation!");
@@ -291,7 +291,7 @@ public:
/// @name Diagnostics Engine
/// {
- bool hasDiagnostics() const { return Diagnostics != nullptr; }
+ bool hasDiagnostics() const { return (bool)Diagnostics; }
/// Get the current diagnostics engine.
DiagnosticsEngine &getDiagnostics() const {
@@ -312,7 +312,7 @@ public:
/// @name Target Info
/// {
- bool hasTarget() const { return Target != nullptr; }
+ bool hasTarget() const { return (bool)Target; }
TargetInfo &getTarget() const {
assert(Target && "Compiler instance has no target!");
@@ -326,7 +326,7 @@ public:
/// @name Virtual File System
/// {
- bool hasVirtualFileSystem() const { return VirtualFileSystem != nullptr; }
+ bool hasVirtualFileSystem() const { return (bool)VirtualFileSystem; }
vfs::FileSystem &getVirtualFileSystem() const {
assert(hasVirtualFileSystem() &&
@@ -346,7 +346,7 @@ public:
/// @name File Manager
/// {
- bool hasFileManager() const { return FileMgr != nullptr; }
+ bool hasFileManager() const { return (bool)FileMgr; }
/// Return the current file manager to the caller.
FileManager &getFileManager() const {
@@ -366,7 +366,7 @@ public:
/// @name Source Manager
/// {
- bool hasSourceManager() const { return SourceMgr != nullptr; }
+ bool hasSourceManager() const { return (bool)SourceMgr; }
/// Return the current source manager.
SourceManager &getSourceManager() const {
@@ -386,7 +386,7 @@ public:
/// @name Preprocessor
/// {
- bool hasPreprocessor() const { return PP != nullptr; }
+ bool hasPreprocessor() const { return (bool)PP; }
/// Return the current preprocessor.
Preprocessor &getPreprocessor() const {
@@ -406,7 +406,7 @@ public:
/// @name ASTContext
/// {
- bool hasASTContext() const { return Context != nullptr; }
+ bool hasASTContext() const { return (bool)Context; }
ASTContext &getASTContext() const {
assert(Context && "Compiler instance has no AST context!");
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
index b415d5b53ff..1fdcdbaf6a5 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
@@ -724,7 +724,7 @@ const char *TrackConstraintBRVisitor::getTag() {
bool TrackConstraintBRVisitor::isUnderconstrained(const ExplodedNode *N) const {
if (IsZeroCheck)
return N->getState()->isNull(Constraint).isUnderconstrained();
- return N->getState()->assume(Constraint, !Assumption);
+ return (bool)N->getState()->assume(Constraint, !Assumption);
}
PathDiagnosticPiece *
OpenPOWER on IntegriCloud