Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:47

0001 //===-- ExpressionSourceCode.h ----------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_EXPRESSION_EXPRESSIONSOURCECODE_H
0010 #define LLDB_EXPRESSION_EXPRESSIONSOURCECODE_H
0011 
0012 #include "lldb/lldb-enumerations.h"
0013 #include "llvm/ADT/ArrayRef.h"
0014 #include "llvm/ADT/StringRef.h"
0015 
0016 #include <string>
0017 
0018 namespace lldb_private {
0019 
0020 class ExpressionSourceCode {
0021 protected:
0022   enum Wrapping : bool {
0023     Wrap = true,
0024     NoWrap = false,
0025   };
0026 
0027 public:
0028   bool NeedsWrapping() const { return m_wrap == Wrap; }
0029 
0030   const char *GetName() const { return m_name.c_str(); }
0031 
0032 protected:
0033   ExpressionSourceCode(llvm::StringRef name, llvm::StringRef prefix,
0034                        llvm::StringRef body, Wrapping wrap)
0035       : m_name(name.str()), m_prefix(prefix.str()), m_body(body.str()),
0036         m_wrap(wrap) {}
0037 
0038   std::string m_name;
0039   std::string m_prefix;
0040   std::string m_body;
0041   Wrapping m_wrap;
0042 };
0043 
0044 } // namespace lldb_private
0045 
0046 #endif