xref: /freebsd/contrib/llvm-project/lldb/include/lldb/API/SBLanguageRuntime.h (revision c5c02a131a0e2ef52771e683269bc8778fe511f3)
1 //===-- SBLanguageRuntime.h -------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_API_SBLANGUAGERUNTIME_H
10 #define LLDB_API_SBLANGUAGERUNTIME_H
11 
12 #include "lldb/API/SBDefines.h"
13 
14 namespace lldb {
15 
16 class SBLanguageRuntime {
17 public:
18   static lldb::LanguageType GetLanguageTypeFromString(const char *string);
19 
20   static const char *GetNameForLanguageType(lldb::LanguageType language);
21 
22   /// Returns whether the given language is any version of C++.
23   static bool LanguageIsCPlusPlus(lldb::LanguageType language);
24 
25   /// Returns whether the given language is Obj-C or Obj-C++.
26   static bool LanguageIsObjC(lldb::LanguageType language);
27 
28   /// Returns whether the given language is any version of C, C++ or Obj-C.
29   static bool LanguageIsCFamily(lldb::LanguageType language);
30 
31   /// Returns whether the given language supports exception breakpoints on
32   /// throw statements.
33   static bool SupportsExceptionBreakpointsOnThrow(lldb::LanguageType language);
34 
35   /// Returns whether the given language supports exception breakpoints on
36   /// catch statements.
37   static bool SupportsExceptionBreakpointsOnCatch(lldb::LanguageType language);
38 
39   /// Returns the keyword used for throw statements in the given language, e.g.
40   /// Python uses \b raise. Returns \b nullptr if the language is not supported.
41   static const char *GetThrowKeywordForLanguage(lldb::LanguageType language);
42 
43   /// Returns the keyword used for catch statements in the given language, e.g.
44   /// Python uses \b except. Returns \b nullptr if the language is not
45   /// supported.
46   static const char *GetCatchKeywordForLanguage(lldb::LanguageType language);
47 };
48 
49 } // namespace lldb
50 
51 #endif // LLDB_API_SBLANGUAGERUNTIME_H
52