Mercurial > projects > ldc
view gen/dwarftypes.cpp @ 1605:1d5721f9ae18
[WIP] Merge DMD r251: bugzilla 111 (appending a dchar to a char[])
This patch needs some work in the code generation, because of the runtime
changes (functions "_d_arrayappendcd" and "_d_arrayappendwd" are added).
This doesn't affect existing code though, it just makes with patch
a little useless, because something like this:
char [] s;
s ~= '\u6211';
That failed to compile with a nice error message previously to this
change, now fails with and ugly error message (a failed assertion).
Apparently there is a regression introduced by this patch too, when
compiling Dil I get this assertion message:
ldc: /home/luca/tesis/ldc/gen/statements.cpp:132: virtual void ReturnStatement::toIR(IRState*): Assertion `p->topfunc()->getReturnType() == llvm::Type::getVoidTy(gIR->context())' failed.
0 ldc 0x08a91628
Thank god we have bisecting capabilities in VCSs now ;)
---
dmd/expression.c | 47 +++++++++++++++++++++++++++++++++++++++++------
1 files changed, 41 insertions(+), 6 deletions(-)
author | Leandro Lucarella <llucax@gmail.com> |
---|---|
date | Wed, 06 Jan 2010 15:18:19 -0300 |
parents | 8d086d552909 |
children |
line wrap: on
line source
// Generated by llvm2cpp - DO NOT MODIFY! #include <llvm/Module.h> #include <llvm/DerivedTypes.h> #include <llvm/Constants.h> #include <llvm/GlobalVariable.h> #include <llvm/Function.h> #include <llvm/CallingConv.h> #include <llvm/BasicBlock.h> #include <llvm/Instructions.h> #include <llvm/InlineAsm.h> #include <llvm/Attributes.h> #include <llvm/Support/MathExtras.h> #include <llvm/Pass.h> #include <llvm/PassManager.h> #include <llvm/Analysis/Verifier.h> #include <llvm/Assembly/PrintModulePass.h> #include <algorithm> void RegisterDwarfSymbols(llvm::Module* mod) { using namespace llvm; // Type Definitions std::vector<const Type*>StructTy_llvm_dbg_anchor_type_fields; StructTy_llvm_dbg_anchor_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_anchor_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructType* StructTy_llvm_dbg_anchor_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_anchor_type_fields, /*isPacked=*/false); mod->addTypeName("llvm.dbg.anchor.type", StructTy_llvm_dbg_anchor_type); std::vector<const Type*>StructTy_llvm_dbg_basictype_type_fields; StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); std::vector<const Type*>StructTy_1_fields; StructType* StructTy_1 = StructType::get(mod->getContext(), StructTy_1_fields, /*isPacked=*/false); PointerType* PointerTy_0 = PointerType::get(StructTy_1,0); StructTy_llvm_dbg_basictype_type_fields.push_back(PointerTy_0); PointerType* PointerTy_2 = PointerType::get(IntegerType::get(mod->getContext(), 8),0); StructTy_llvm_dbg_basictype_type_fields.push_back(PointerTy_2); StructTy_llvm_dbg_basictype_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(mod->getContext(), 64)); StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(mod->getContext(), 64)); StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(mod->getContext(), 64)); StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructType* StructTy_llvm_dbg_basictype_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_basictype_type_fields, /*isPacked=*/false); mod->addTypeName("llvm.dbg.basictype.type", StructTy_llvm_dbg_basictype_type); std::vector<const Type*>StructTy_llvm_dbg_compile_unit_type_fields; StructTy_llvm_dbg_compile_unit_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_compile_unit_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_2); StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_2); StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_2); StructType* StructTy_llvm_dbg_compile_unit_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_compile_unit_type_fields, /*isPacked=*/false); mod->addTypeName("llvm.dbg.compile_unit.type", StructTy_llvm_dbg_compile_unit_type); std::vector<const Type*>StructTy_llvm_dbg_compositetype_type_fields; StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_2); StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(mod->getContext(), 64)); StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(mod->getContext(), 64)); StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(mod->getContext(), 64)); StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0); StructType* StructTy_llvm_dbg_compositetype_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_compositetype_type_fields, /*isPacked=*/false); mod->addTypeName("llvm.dbg.compositetype.type", StructTy_llvm_dbg_compositetype_type); std::vector<const Type*>StructTy_llvm_dbg_derivedtype_type_fields; StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_derivedtype_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_derivedtype_type_fields.push_back(PointerTy_2); StructTy_llvm_dbg_derivedtype_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(mod->getContext(), 64)); StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(mod->getContext(), 64)); StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(mod->getContext(), 64)); StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_derivedtype_type_fields.push_back(PointerTy_0); StructType* StructTy_llvm_dbg_derivedtype_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_derivedtype_type_fields, /*isPacked=*/false); mod->addTypeName("llvm.dbg.derivedtype.type", StructTy_llvm_dbg_derivedtype_type); std::vector<const Type*>StructTy_llvm_dbg_global_variable_type_fields; StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_2); StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_2); StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_2); StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(mod->getContext(), 1)); StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(mod->getContext(), 1)); StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0); StructType* StructTy_llvm_dbg_global_variable_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_global_variable_type_fields, /*isPacked=*/false); mod->addTypeName("llvm.dbg.global_variable.type", StructTy_llvm_dbg_global_variable_type); std::vector<const Type*>StructTy_llvm_dbg_subprogram_type_fields; StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_2); StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_2); StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_2); StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(mod->getContext(), 1)); StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(mod->getContext(), 1)); StructType* StructTy_llvm_dbg_subprogram_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_subprogram_type_fields, /*isPacked=*/false); mod->addTypeName("llvm.dbg.subprogram.type", StructTy_llvm_dbg_subprogram_type); std::vector<const Type*>StructTy_llvm_dbg_variable_type_fields; StructTy_llvm_dbg_variable_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_2); StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_0); StructTy_llvm_dbg_variable_type_fields.push_back(IntegerType::get(mod->getContext(), 32)); StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_0); StructType* StructTy_llvm_dbg_variable_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_variable_type_fields, /*isPacked=*/false); mod->addTypeName("llvm.dbg.variable.type", StructTy_llvm_dbg_variable_type); std::vector<const Type*>FuncTy_3_args; FuncTy_3_args.push_back(PointerTy_0); FunctionType* FuncTy_3 = FunctionType::get( /*Result=*/Type::getVoidTy(mod->getContext()), /*Params=*/FuncTy_3_args, /*isVarArg=*/false); std::vector<const Type*>FuncTy_4_args; FuncTy_4_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_4_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_4_args.push_back(PointerTy_0); FunctionType* FuncTy_4 = FunctionType::get( /*Result=*/Type::getVoidTy(mod->getContext()), /*Params=*/FuncTy_4_args, /*isVarArg=*/false); std::vector<const Type*>FuncTy_5_args; FuncTy_5_args.push_back(PointerTy_0); FuncTy_5_args.push_back(PointerTy_0); FunctionType* FuncTy_5 = FunctionType::get( /*Result=*/Type::getVoidTy(mod->getContext()), /*Params=*/FuncTy_5_args, /*isVarArg=*/false); // Function Declarations Function* func_llvm_dbg_func_start = Function::Create( /*Type=*/FuncTy_3, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"llvm.dbg.func.start", mod); // (external, no body) func_llvm_dbg_func_start->setCallingConv(CallingConv::C); Function* func_llvm_dbg_stoppoint = Function::Create( /*Type=*/FuncTy_4, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"llvm.dbg.stoppoint", mod); // (external, no body) func_llvm_dbg_stoppoint->setCallingConv(CallingConv::C); Function* func_llvm_dbg_declare = Function::Create( /*Type=*/FuncTy_5, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"llvm.dbg.declare", mod); // (external, no body) func_llvm_dbg_declare->setCallingConv(CallingConv::C); Function* func_llvm_dbg_region_end = Function::Create( /*Type=*/FuncTy_3, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"llvm.dbg.region.end", mod); // (external, no body) func_llvm_dbg_region_end->setCallingConv(CallingConv::C); }