1 //===-- SourceLanguage.cpp - Implement the SourceLanguage class -----------===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements the SourceLanguage class.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/Debugger/SourceLanguage.h"
15 #include "llvm/Debugger/ProgramInfo.h"
18 const SourceLanguage
&SourceLanguage::get(unsigned ID
) {
20 case 1: // DW_LANG_C89
22 case 12: // DW_LANG_C99
23 return getCFamilyInstance();
25 case 4: // DW_LANG_C_plus_plus
26 return getCPlusPlusInstance();
28 case 3: // DW_LANG_Ada83
29 case 5: // DW_LANG_Cobol74
30 case 6: // DW_LANG_Cobol85
31 case 7: // DW_LANG_Fortran77
32 case 8: // DW_LANG_Fortran90
33 case 9: // DW_LANG_Pascal83
34 case 10: // DW_LANG_Modula2
35 case 11: // DW_LANG_Java
36 case 13: // DW_LANG_Ada95
37 case 14: // DW_LANG_Fortran95
39 return getUnknownLanguageInstance();
45 SourceLanguage::createSourceFileInfo(const GlobalVariable
*Desc
,
46 ProgramInfo
&PI
) const {
47 return new SourceFileInfo(Desc
, *this);
51 SourceLanguage::createSourceFunctionInfo(const GlobalVariable
*Desc
,
52 ProgramInfo
&PI
) const {
53 return new SourceFunctionInfo(PI
, Desc
);