1 // compGloss.cxx - Gloss component. -*- C++ -*-
3 // Copyright (C) 1999, 2000 Red Hat.
4 // This file is part of SID and is licensed under the GPL.
5 // See the file COPYING.SID for conditions for redistribution.
34 types.push_back("sw-gloss-m32r/libgloss");
37 types.push_back("sw-gloss-arm/angel");
40 types.push_back("sw-gloss-mips32/idt");
42 types.push_back("sw-gloss-generic/libgloss");
49 compGlossCreate(const string& typeName)
52 if (typeName == "sw-gloss-m32r/libgloss")
53 return new m32r_libgloss();
56 if (typeName == "sw-gloss-arm/angel")
57 return new arm_angel();
60 if (typeName == "sw-gloss-mips32/idt")
61 return new mips32_idt();
63 if (typeName == "sw-gloss-generic/libgloss")
71 compGlossDelete(component* c)
73 // Two of these dynamic_cast<>s will return 0. It is safe to delete 0.
75 m32r_libgloss* g1 = dynamic_cast<m32r_libgloss*>(c);
76 if (g1) { delete g1; return; }
79 arm_angel* g2 = dynamic_cast<arm_angel*>(c);
80 if (g2) { delete g2; return; }
83 mips32_idt* g3 = dynamic_cast<mips32_idt*>(c);
84 if (g3) { delete g3; return; }
86 gloss32* g4 = dynamic_cast<gloss32*>(c);
87 if (g4) { delete g4; return; }
92 extern const component_library gloss_component_library;
94 const component_library gloss_component_library DLLEXPORT =
96 COMPONENT_LIBRARY_MAGIC,