CPPLanguageRuntime.h revision bad9753828b6e0e415e38094bb9627e41d57874c
1//===-- CPPLanguageRuntime.h ---------------------------------------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_CPPLanguageRuntime_h_
11#define liblldb_CPPLanguageRuntime_h_
12
13// C Includes
14// C++ Includes
15#include <vector>
16// Other libraries and framework includes
17// Project includes
18#include "lldb/Core/PluginInterface.h"
19#include "lldb/lldb-private.h"
20#include "lldb/Target/LanguageRuntime.h"
21
22namespace lldb_private {
23
24class CPPLanguageRuntime :
25    public LanguageRuntime
26{
27public:
28    virtual
29    ~CPPLanguageRuntime();
30
31    virtual lldb::LanguageType
32    GetLanguageType () const
33    {
34        return lldb::eLanguageTypeC_plus_plus;
35    }
36
37    virtual bool
38    IsVTableName (const char *name) = 0;
39
40    virtual bool
41    GetObjectDescription (Stream &str, ValueObject &object);
42
43    virtual bool
44    GetObjectDescription (Stream &str, Value &value, ExecutionContextScope *exe_scope);
45
46    static bool
47    IsCPPMangledName(const char *name);
48
49    static bool
50    IsPossibleCPPCall (const char *name, const char *&base_name_start, const char *&base_name_end);
51
52    static bool
53    StripNamespacesFromVariableName (const char *name, const char *&base_name_start, const char *&base_name_end);
54
55    // in some cases, compilers will output different names for one same type. when tht happens, it might be impossible
56    // to construct SBType objects for a valid type, because the name that is available is not the same as the name that
57    // can be used as a search key in FindTypes(). the equivalents map here is meant to return possible alternative names
58    // for a type through which a search can be conducted. Currently, this is only enabled for C++ but can be extended
59    // to ObjC or other languages if necessary
60    static uint32_t
61    FindEquivalentNames(ConstString type_name, std::vector<ConstString>& equivalents);
62
63protected:
64    //------------------------------------------------------------------
65    // Classes that inherit from CPPLanguageRuntime can see and modify these
66    //------------------------------------------------------------------
67    CPPLanguageRuntime(Process *process);
68private:
69    DISALLOW_COPY_AND_ASSIGN (CPPLanguageRuntime);
70};
71
72} // namespace lldb_private
73
74#endif  // liblldb_CPPLanguageRuntime_h_
75