10b57cec5SDimitry Andric //===-- SBLanguageRuntime.h -------------------------------------*- C++ -*-===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric 95ffd83dbSDimitry Andric #ifndef LLDB_API_SBLANGUAGERUNTIME_H 105ffd83dbSDimitry Andric #define LLDB_API_SBLANGUAGERUNTIME_H 110b57cec5SDimitry Andric 120b57cec5SDimitry Andric #include "lldb/API/SBDefines.h" 130b57cec5SDimitry Andric 140b57cec5SDimitry Andric namespace lldb { 150b57cec5SDimitry Andric 160b57cec5SDimitry Andric class SBLanguageRuntime { 170b57cec5SDimitry Andric public: 180b57cec5SDimitry Andric static lldb::LanguageType GetLanguageTypeFromString(const char *string); 190b57cec5SDimitry Andric 200b57cec5SDimitry Andric static const char *GetNameForLanguageType(lldb::LanguageType language); 21*0fca6ea1SDimitry Andric 22*0fca6ea1SDimitry Andric /// Returns whether the given language is any version of C++. 23*0fca6ea1SDimitry Andric static bool LanguageIsCPlusPlus(lldb::LanguageType language); 24*0fca6ea1SDimitry Andric 25*0fca6ea1SDimitry Andric /// Returns whether the given language is Obj-C or Obj-C++. 26*0fca6ea1SDimitry Andric static bool LanguageIsObjC(lldb::LanguageType language); 27*0fca6ea1SDimitry Andric 28*0fca6ea1SDimitry Andric /// Returns whether the given language is any version of C, C++ or Obj-C. 29*0fca6ea1SDimitry Andric static bool LanguageIsCFamily(lldb::LanguageType language); 30*0fca6ea1SDimitry Andric 31*0fca6ea1SDimitry Andric /// Returns whether the given language supports exception breakpoints on 32*0fca6ea1SDimitry Andric /// throw statements. 33*0fca6ea1SDimitry Andric static bool SupportsExceptionBreakpointsOnThrow(lldb::LanguageType language); 34*0fca6ea1SDimitry Andric 35*0fca6ea1SDimitry Andric /// Returns whether the given language supports exception breakpoints on 36*0fca6ea1SDimitry Andric /// catch statements. 37*0fca6ea1SDimitry Andric static bool SupportsExceptionBreakpointsOnCatch(lldb::LanguageType language); 38*0fca6ea1SDimitry Andric 39*0fca6ea1SDimitry Andric /// Returns the keyword used for throw statements in the given language, e.g. 40*0fca6ea1SDimitry Andric /// Python uses \b raise. Returns \b nullptr if the language is not supported. 41*0fca6ea1SDimitry Andric static const char *GetThrowKeywordForLanguage(lldb::LanguageType language); 42*0fca6ea1SDimitry Andric 43*0fca6ea1SDimitry Andric /// Returns the keyword used for catch statements in the given language, e.g. 44*0fca6ea1SDimitry Andric /// Python uses \b except. Returns \b nullptr if the language is not 45*0fca6ea1SDimitry Andric /// supported. 46*0fca6ea1SDimitry Andric static const char *GetCatchKeywordForLanguage(lldb::LanguageType language); 470b57cec5SDimitry Andric }; 480b57cec5SDimitry Andric 490b57cec5SDimitry Andric } // namespace lldb 500b57cec5SDimitry Andric 515ffd83dbSDimitry Andric #endif // LLDB_API_SBLANGUAGERUNTIME_H 52