aboutsummaryrefslogtreecommitdiffstats
path: root/include/lldb/Expression/ExpressionSourceCode.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Expression/ExpressionSourceCode.h')
-rw-r--r--include/lldb/Expression/ExpressionSourceCode.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/include/lldb/Expression/ExpressionSourceCode.h b/include/lldb/Expression/ExpressionSourceCode.h
index d0d01b5f9b59..e7d39e7ca24a 100644
--- a/include/lldb/Expression/ExpressionSourceCode.h
+++ b/include/lldb/Expression/ExpressionSourceCode.h
@@ -17,20 +17,27 @@
namespace lldb_private {
class ExpressionSourceCode {
+protected:
+ enum Wrapping : bool {
+ Wrap = true,
+ NoWrap = false,
+ };
+
public:
- bool NeedsWrapping() const { return m_wrap; }
+ bool NeedsWrapping() const { return m_wrap == Wrap; }
const char *GetName() const { return m_name.c_str(); }
protected:
- ExpressionSourceCode(const char *name, const char *prefix, const char *body,
- bool wrap)
- : m_name(name), m_prefix(prefix), m_body(body), m_wrap(wrap) {}
+ ExpressionSourceCode(llvm::StringRef name, llvm::StringRef prefix,
+ llvm::StringRef body, Wrapping wrap)
+ : m_name(name.str()), m_prefix(prefix.str()), m_body(body.str()),
+ m_wrap(wrap) {}
std::string m_name;
std::string m_prefix;
std::string m_body;
- bool m_wrap;
+ Wrapping m_wrap;
};
} // namespace lldb_private