comparison gen/toir.cpp @ 122:36ab367572df trunk

[svn r126] String switch is now implemented. A few other fixes.
author lindquist
date Tue, 27 Nov 2007 09:19:07 +0100
parents 9c79b61fb638
children 7f9a0a58394b
comparison
equal deleted inserted replaced
121:9c79b61fb638 122:36ab367572df
90 else if (AliasDeclaration* a = declaration->isAliasDeclaration()) 90 else if (AliasDeclaration* a = declaration->isAliasDeclaration())
91 { 91 {
92 Logger::println("AliasDeclaration - no work"); 92 Logger::println("AliasDeclaration - no work");
93 // do nothing 93 // do nothing
94 } 94 }
95 // enum
95 else if (EnumDeclaration* e = declaration->isEnumDeclaration()) 96 else if (EnumDeclaration* e = declaration->isEnumDeclaration())
96 { 97 {
97 Logger::println("EnumDeclaration - no work"); 98 Logger::println("EnumDeclaration - no work");
98 // do nothing 99 // do nothing
100 }
101 // class
102 else if (ClassDeclaration* e = declaration->isClassDeclaration())
103 {
104 Logger::println("ClassDeclaration");
105 DtoForceConstInitDsymbol(e);
99 } 106 }
100 // unsupported declaration 107 // unsupported declaration
101 else 108 else
102 { 109 {
103 error("Unimplemented DeclarationExp type"); 110 error("Unimplemented DeclarationExp type");
362 LOG_SCOPE; 369 LOG_SCOPE;
363 370
364 Type* dtype = DtoDType(type); 371 Type* dtype = DtoDType(type);
365 Type* cty = DtoDType(dtype->next); 372 Type* cty = DtoDType(dtype->next);
366 373
367 const llvm::Type* ct = DtoType(dtype->next); 374 const llvm::Type* ct = DtoType(cty);
368 //printf("ct = %s\n", type->next->toChars()); 375 //printf("ct = %s\n", type->next->toChars());
369 const llvm::ArrayType* at = llvm::ArrayType::get(ct,len+1); 376 const llvm::ArrayType* at = llvm::ArrayType::get(ct,len+1);
370 377
371 llvm::Constant* _init; 378 llvm::Constant* _init;
372 if (cty->ty == Tchar) { 379 if (cty->ty == Tchar) {