Browse Source

Have different categories for optimization passes

gingerBill 5 years ago
parent
commit
04fe23a3c8
4 changed files with 408 additions and 179 deletions
  1. 1 1
      build.bat
  2. 394 178
      src/llvm_backend.cpp
  3. 5 0
      src/llvm_backend.hpp
  4. 8 0
      src/types.cpp

+ 1 - 1
build.bat

@@ -49,7 +49,7 @@ del *.ilk > NUL 2> NUL
 
 cl %compiler_settings% "src\main.cpp" ^
 	/link %linker_settings% -OUT:%exe_name% ^
-	&& odin run examples/demo/demo.odin -llvm-api
+	&& odin run examples/demo/demo.odin -llvm-api -keep-temp-files
 if %errorlevel% neq 0 (
 	goto end_of_build
 )

File diff suppressed because it is too large
+ 394 - 178
src/llvm_backend.cpp


+ 5 - 0
src/llvm_backend.hpp

@@ -164,8 +164,13 @@ struct lbTargetList {
 };
 
 
+enum lbProcedureFlag : u32 {
+	lbProcedureFlag_WithoutMemcpyPass = 1<<0,
+};
 
 struct lbProcedure {
+	u32 flags;
+
 	lbProcedure *parent;
 	Array<lbProcedure *> children;
 

+ 8 - 0
src/types.cpp

@@ -3190,6 +3190,14 @@ i64 type_offset_of_from_selection(Type *type, Selection sel) {
 	return offset;
 }
 
+
+Type *get_struct_field_type(Type *t, isize index) {
+	t = base_type(type_deref(t));
+	GB_ASSERT(t->kind == Type_Struct);
+	return t->Struct.fields[index]->type;
+}
+
+
 gbString write_type_to_string(gbString str, Type *type) {
 	if (type == nullptr) {
 		return gb_string_appendc(str, "<no type>");

Some files were not shown because too many files changed in this diff