LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

SourceLanguage.cpp

Go to the documentation of this file.
00001 //===-- SourceLanguage.cpp - Implement the SourceLanguage class -----------===//
00002 // 
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file was developed by the LLVM research group and is distributed under
00006 // the University of Illinois Open Source License. See LICENSE.TXT for details.
00007 // 
00008 //===----------------------------------------------------------------------===//
00009 // 
00010 // This file implements the SourceLanguage class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #include "llvm/Debugger/SourceLanguage.h"
00015 #include "llvm/Debugger/ProgramInfo.h"
00016 using namespace llvm;
00017 
00018 const SourceLanguage &SourceLanguage::get(unsigned ID) {
00019   switch (ID) {
00020   case 1:  // DW_LANG_C89
00021   case 2:  // DW_LANG_C
00022   case 12: // DW_LANG_C99
00023     return getCFamilyInstance();
00024 
00025   case 4:  // DW_LANG_C_plus_plus
00026     return getCPlusPlusInstance();
00027 
00028   case 3:  // DW_LANG_Ada83
00029   case 5:  // DW_LANG_Cobol74
00030   case 6:  // DW_LANG_Cobol85
00031   case 7:  // DW_LANG_Fortran77
00032   case 8:  // DW_LANG_Fortran90
00033   case 9:  // DW_LANG_Pascal83
00034   case 10: // DW_LANG_Modula2
00035   case 11: // DW_LANG_Java
00036   case 13: // DW_LANG_Ada95
00037   case 14: // DW_LANG_Fortran95
00038   default:
00039     return getUnknownLanguageInstance();
00040   }
00041 }
00042 
00043 
00044 SourceFileInfo *
00045 SourceLanguage::createSourceFileInfo(const GlobalVariable *Desc,
00046                                      ProgramInfo &PI) const {
00047   return new SourceFileInfo(Desc, *this);
00048 }
00049 
00050 SourceFunctionInfo *
00051 SourceLanguage::createSourceFunctionInfo(const GlobalVariable *Desc,
00052                                          ProgramInfo &PI) const {
00053   return new SourceFunctionInfo(PI, Desc);
00054 }