diff options
Diffstat (limited to 'clang/include/clang/Frontend/CompilerInstance.h')
| -rw-r--r-- | clang/include/clang/Frontend/CompilerInstance.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/clang/include/clang/Frontend/CompilerInstance.h b/clang/include/clang/Frontend/CompilerInstance.h index 7c4d754bf9c..62aeca103ca 100644 --- a/clang/include/clang/Frontend/CompilerInstance.h +++ b/clang/include/clang/Frontend/CompilerInstance.h @@ -426,7 +426,7 @@ public: /// @name ASTConsumer /// { - bool hasASTConsumer() const { return Consumer.isValid(); } + bool hasASTConsumer() const { return (bool)Consumer; } ASTConsumer &getASTConsumer() const { assert(Consumer && "Compiler instance has no AST consumer!"); @@ -444,8 +444,8 @@ public: /// } /// @name Semantic analysis /// { - bool hasSema() const { return TheSema.isValid(); } - + bool hasSema() const { return (bool)TheSema; } + Sema &getSema() const { assert(TheSema && "Compiler instance has no Sema object!"); return *TheSema; @@ -464,9 +464,7 @@ public: /// @name Code Completion /// { - bool hasCodeCompletionConsumer() const { - return CompletionConsumer.isValid(); - } + bool hasCodeCompletionConsumer() const { return (bool)CompletionConsumer; } CodeCompleteConsumer &getCodeCompletionConsumer() const { assert(CompletionConsumer && @@ -488,7 +486,7 @@ public: /// @name Frontend timer /// { - bool hasFrontendTimer() const { return FrontendTimer.isValid(); } + bool hasFrontendTimer() const { return (bool)FrontendTimer; } llvm::Timer &getFrontendTimer() const { assert(FrontendTimer && "Compiler instance has no frontend timer!"); |

