diff options
author | Anna Zaks <ganna@apple.com> | 2013-04-15 22:37:59 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2013-04-15 22:37:59 +0000 |
commit | 79d0cceb8847bfe6dc9da8eb2ea2f3c6bb73b813 (patch) | |
tree | 83170652722a35f727caa8d147d324a8b32cc400 /include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h | |
parent | 82dd4396fcd2517d06382b7170f393d1b6351c7f (diff) |
[analyzer] Address code review for r179395
Mostly refactoring + handle the nested fields by printing the innermost field only.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179572 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h')
-rw-r--r-- | include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h b/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h index 7ae432e389..0d513f8326 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h @@ -169,7 +169,15 @@ public: /// \brief Print the region for use in diagnostics. virtual void printPretty(raw_ostream &os) const; - virtual void printPrettyNoQuotes(raw_ostream &os) const; + /// \brief Returns true if this region's textual representation can be used + /// as part of a larger expression. + virtual bool canPrintPrettyAsExpr() const; + + /// \brief Print the region as expression. + /// + /// When this region represents a subexpression, the method is for printing + /// an expression containing it. + virtual void printPrettyAsExpr(raw_ostream &os) const; Kind getKind() const { return kind; } @@ -878,7 +886,7 @@ public: bool canPrintPretty() const; - void printPrettyNoQuotes(raw_ostream &os) const; + void printPrettyAsExpr(raw_ostream &os) const; }; /// CXXThisRegion - Represents the region for the implicit 'this' parameter @@ -940,7 +948,8 @@ public: bool canPrintPretty() const; void printPretty(raw_ostream &os) const; - void printPrettyNoQuotes(raw_ostream &os) const; + bool canPrintPrettyAsExpr() const; + void printPrettyAsExpr(raw_ostream &os) const; }; class ObjCIvarRegion : public DeclRegion { @@ -957,7 +966,7 @@ public: QualType getValueType() const; bool canPrintPretty() const; - void printPrettyNoQuotes(raw_ostream &os) const; + void printPrettyAsExpr(raw_ostream &os) const; void dumpToStream(raw_ostream &os) const; |