Mercurial > projects > ldc
diff gen/dwarftypes.c @ 82:d8dd47ef3973 trunk
[svn r86] Changed the way arguments are given storage. It is now detected if they will need it during semantic passes.
Initial support for debug information. Very limited, but MUCH better than nothing :)
author | lindquist |
---|---|
date | Fri, 02 Nov 2007 01:17:26 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gen/dwarftypes.c Fri Nov 02 01:17:26 2007 +0100 @@ -0,0 +1,187 @@ +// 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/ParameterAttributes.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> +#include <iostream> + +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(32)); + StructTy_llvm_dbg_anchor_type_fields.push_back(IntegerType::get(32)); + StructType* StructTy_llvm_dbg_anchor_type = StructType::get(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(32)); + std::vector<const Type*>StructTy_1_fields; + StructType* StructTy_1 = StructType::get(StructTy_1_fields, /*isPacked=*/false); + + PointerType* PointerTy_0 = PointerType::get(StructTy_1); + + StructTy_llvm_dbg_basictype_type_fields.push_back(PointerTy_0); + PointerType* PointerTy_2 = PointerType::get(IntegerType::get(8)); + + 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(32)); + StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(64)); + StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(64)); + StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(64)); + StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(32)); + StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(32)); + StructType* StructTy_llvm_dbg_basictype_type = StructType::get(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(32)); + StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_0); + StructTy_llvm_dbg_compile_unit_type_fields.push_back(IntegerType::get(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(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(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(32)); + StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(64)); + StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(64)); + StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(64)); + StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(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(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(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(32)); + StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(64)); + StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(64)); + StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(64)); + StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(32)); + StructTy_llvm_dbg_derivedtype_type_fields.push_back(PointerTy_0); + StructType* StructTy_llvm_dbg_derivedtype_type = StructType::get(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(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(32)); + StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0); + StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(1)); + StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(1)); + StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0); + StructType* StructTy_llvm_dbg_global_variable_type = StructType::get(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(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(32)); + StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_0); + StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(1)); + StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(1)); + StructType* StructTy_llvm_dbg_subprogram_type = StructType::get(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(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(32)); + StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_0); + StructType* StructTy_llvm_dbg_variable_type = StructType::get(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); + ParamAttrsList *FuncTy_3_PAL = 0; + FunctionType* FuncTy_3 = FunctionType::get( + /*Result=*/Type::VoidTy, + /*Params=*/FuncTy_3_args, + /*isVarArg=*/false, + /*ParamAttrs=*/FuncTy_3_PAL); + + std::vector<const Type*>FuncTy_4_args; + FuncTy_4_args.push_back(IntegerType::get(32)); + FuncTy_4_args.push_back(IntegerType::get(32)); + FuncTy_4_args.push_back(PointerTy_0); + ParamAttrsList *FuncTy_4_PAL = 0; + FunctionType* FuncTy_4 = FunctionType::get( + /*Result=*/Type::VoidTy, + /*Params=*/FuncTy_4_args, + /*isVarArg=*/false, + /*ParamAttrs=*/FuncTy_4_PAL); + + std::vector<const Type*>FuncTy_5_args; + FuncTy_5_args.push_back(PointerTy_0); + FuncTy_5_args.push_back(PointerTy_0); + ParamAttrsList *FuncTy_5_PAL = 0; + FunctionType* FuncTy_5 = FunctionType::get( + /*Result=*/Type::VoidTy, + /*Params=*/FuncTy_5_args, + /*isVarArg=*/false, + /*ParamAttrs=*/FuncTy_5_PAL); + + + // Function Declarations + + Function* func_llvm_dbg_func_start = new Function( + /*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 = new Function( + /*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 = new Function( + /*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 = new Function( + /*Type=*/FuncTy_3, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"llvm.dbg.region.end", mod); // (external, no body) + func_llvm_dbg_region_end->setCallingConv(CallingConv::C); +}