Skip to content

Commit

Permalink
Linux fixes (#124)
Browse files Browse the repository at this point in the history
* added some improvements

* compile issues for linux

* some fixes

* more fixes

* update

* update

* added some fix

* progress of fixes

* cleanup some warnings

* update

* cleanup

* typo

* fixes for using as without proper testring syntax kind

* some cleanups

Signed-off-by: ASDAlexander77 <duzhar@googlemail.com>

* update

* added some improvements for no default lib option

* cleanup

---------

Signed-off-by: ASDAlexander77 <duzhar@googlemail.com>
  • Loading branch information
ASDAlexander77 authored Sep 15, 2024
1 parent 3279cec commit ac26b59
Show file tree
Hide file tree
Showing 30 changed files with 243 additions and 88 deletions.
Empty file modified prepare_3rdParty_debug.sh
100644 → 100755
Empty file.
Empty file modified prepare_3rdParty_release.sh
100644 → 100755
Empty file.
Empty file modified prepare_3rdParty_wasm_debug.sh
100644 → 100755
Empty file.
Empty file modified scripts/build_gc_debug.sh
100644 → 100755
Empty file.
Empty file modified scripts/build_gc_release.sh
100644 → 100755
Empty file.
Empty file modified scripts/build_llvm_debug.sh
100644 → 100755
Empty file.
Empty file modified scripts/build_llvm_release.sh
100644 → 100755
Empty file.
Empty file modified scripts/build_llvm_wasm_debug.sh
100644 → 100755
Empty file.
Empty file modified scripts/build_llvm_wasm_release.sh
100644 → 100755
Empty file.
Empty file modified scripts/config_llvm_debug.sh
100644 → 100755
Empty file.
Empty file modified scripts/config_llvm_release.sh
100644 → 100755
Empty file.
Empty file modified scripts/config_llvm_wasm_debug.sh
100644 → 100755
Empty file.
Empty file modified scripts/config_llvm_wasm_release.sh
100644 → 100755
Empty file.
Empty file modified scripts/separate_debug_info.sh
100644 → 100755
Empty file.
9 changes: 8 additions & 1 deletion tsc.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,14 @@
"memory_resource": "cpp",
"string_view": "cpp",
"numbers": "cpp",
"semaphore": "cpp"
"semaphore": "cpp",
"__bit_reference": "cpp",
"__hash_table": "cpp",
"__node_handle": "cpp",
"__split_buffer": "cpp",
"__threading_support": "cpp",
"__verbose_abort": "cpp",
"print": "cpp"
},
"cmake.sourceDirectory": "${workspaceFolder}/..",
"cmake.useCMakePresets": "always",
Expand Down
2 changes: 1 addition & 1 deletion tsc/cmake/config_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if(MSVC)
else()
#SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-unused-function -Wno-unused-result -Wno-unused-variable -Wno-unused-private-field -Wno-sign-compare -Wno-implicit-fallthrough -Wno-logical-op-parentheses -Wno-parentheses -Wno-unused-command-line-argument -frtti -lstdc++fs")
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-unused-function -Wno-unused-result -Wno-unused-variable -Wno-sign-compare -Wno-implicit-fallthrough -Wno-parentheses -Wno-type-limits -Wno-unused-const-variable -Wno-subobject-linkage -Wno-unused-private-field")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-unused-function -Wno-unused-result -Wno-unused-variable -Wno-sign-compare -Wno-implicit-fallthrough -Wno-parentheses -Wno-type-limits -Wno-unused-const-variable -Wno-unused-private-field")
else()
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-unused-function -Wno-unused-result -Wno-unused-variable -Wno-sign-compare -Wno-implicit-fallthrough -Wno-parentheses -Wno-type-limits -Wno-unused-but-set-variable -Wno-subobject-linkage")
endif()
Expand Down
5 changes: 3 additions & 2 deletions tsc/include/TypeScript/LowerToLLVM/LLVMDebugInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ namespace typescript

struct CompositeSizesTrack
{
CompositeSizesTrack(LLVMTypeConverterHelper &llvmtch) : llvmtch(llvmtch),
CompositeSizesTrack(LLVMTypeConverterHelper &llvmtch) :
elementSizeInBits(0),
elementAlignInBits(0),
sizeInBits(0),
alignInBits(0),
offsetInBits(0)
offsetInBits(0),
llvmtch(llvmtch)
{
};

Expand Down
2 changes: 1 addition & 1 deletion tsc/include/TypeScript/MLIRLogic/MLIRGenContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ struct GenContext

struct ValueOrLogicalResult
{
ValueOrLogicalResult() = default;
ValueOrLogicalResult() : result(mlir::success()), value(mlir::Value()) {};
ValueOrLogicalResult(mlir::LogicalResult result) : result(result) {};
ValueOrLogicalResult(mlir::Value value) : result(mlir::success()), value(value) {};

Expand Down
8 changes: 3 additions & 5 deletions tsc/include/TypeScript/MLIRLogic/MLIRGenStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@ struct InterfaceInfo

for (auto &method : methods)
{
tupleFields.push_back({MLIRHelper::TupleFieldName(method.name, context), method.funcType});
tupleFields.push_back({MLIRHelper::TupleFieldName(method.name, context), method.funcType, false});
}

for (auto &field : fields)
{
tupleFields.push_back({field.id, field.type});
tupleFields.push_back({field.id, field.type, false});
}

return mlir::success();
Expand Down Expand Up @@ -284,9 +284,7 @@ struct InterfaceInfo
{
if (field.isConditional)
{
mlir_ts::FieldInfo missingField;
missingField.id = field.id;
missingField.type = field.type;
mlir_ts::FieldInfo missingField{field.id, field.type};
vtable.push_back({missingField, true});
}
else
Expand Down
20 changes: 10 additions & 10 deletions tsc/include/TypeScript/MLIRLogic/MLIRTypeHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class MLIRTypeHelper
llvm::SmallVector<mlir_ts::FieldInfo> fields;
for (auto type : types)
{
fields.push_back(mlir_ts::FieldInfo{nullptr, type});
fields.push_back(mlir_ts::FieldInfo{nullptr, type, false});
}

return mlir_ts::TupleType::get(context, fields);
Expand Down Expand Up @@ -824,7 +824,7 @@ class MLIRTypeHelper
SmallVector<mlir_ts::FieldInfo> fieldInfos;
for (auto param : calledFuncType.getInputs())
{
fieldInfos.push_back({mlir::Attribute(), param});
fieldInfos.push_back({mlir::Attribute(), param, false});
}

return getTupleType(fieldInfos);
Expand Down Expand Up @@ -1717,10 +1717,10 @@ class MLIRTypeHelper
}
else
{
fieldInfos.push_back({mlir::Attribute(), existType.second});
fieldInfos.push_back({mlir::Attribute(), existType.second, false});
}

fieldInfos.push_back({mlir::Attribute(), currentType});
fieldInfos.push_back({mlir::Attribute(), currentType, false});

currentType = getTupleType(fieldInfos);
}
Expand Down Expand Up @@ -1894,16 +1894,16 @@ class MLIRTypeHelper
else if (srcType.dyn_cast<mlir_ts::ArrayType>() || srcType.dyn_cast<mlir_ts::ConstArrayType>() || srcType.dyn_cast<mlir_ts::StringType>())
{
// TODO: do not break the order as it is used in Debug info
destTupleFields.push_back({ mlir::Attribute(), mlir_ts::NumberType::get(context) });
destTupleFields.push_back({ MLIRHelper::TupleFieldName(LENGTH_FIELD_NAME, context), mlir_ts::StringType::get(context) });
//destTupleFields.push_back({ MLIRHelper::TupleFieldName(INDEX_ACCESS_FIELD_NAME, context), mlir_ts::NumberType::get(context) });
destTupleFields.push_back({ mlir::Attribute(), mlir_ts::NumberType::get(context), false });
destTupleFields.push_back({ MLIRHelper::TupleFieldName(LENGTH_FIELD_NAME, context), mlir_ts::StringType::get(context), false });
//destTupleFields.push_back({ MLIRHelper::TupleFieldName(INDEX_ACCESS_FIELD_NAME, context), mlir_ts::NumberType::get(context), false });
return mlir::success();
}
else if (auto optType = srcType.dyn_cast<mlir_ts::OptionalType>())
{
// TODO: do not break the order as it is used in Debug info
destTupleFields.push_back({ MLIRHelper::TupleFieldName("value", context), optType.getElementType() });
destTupleFields.push_back({ MLIRHelper::TupleFieldName("hasValue", context), mlir_ts::BooleanType::get(context) });
destTupleFields.push_back({ MLIRHelper::TupleFieldName("value", context), optType.getElementType(), false });
destTupleFields.push_back({ MLIRHelper::TupleFieldName("hasValue", context), mlir_ts::BooleanType::get(context), false });
return mlir::success();
}

Expand Down Expand Up @@ -2984,7 +2984,7 @@ class MLIRTypeHelper
auto mergedType = mergeType(existingIt->type, currentIt->type, merged);
if (mergedType)
{
resultFields.push_back({ existingIt->id, mergedType });
resultFields.push_back({ existingIt->id, mergedType, false });
}
}

Expand Down
6 changes: 5 additions & 1 deletion tsc/include/TypeScript/TypeScriptOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ struct FieldInfo
Type type;
bool isConditional;

FieldInfo() = default;
FieldInfo(Attribute id, Type type) : id{id}, type{type}, isConditional{false} {};
FieldInfo(Attribute id, Type type, bool isConditional) : id{id}, type{type}, isConditional{isConditional} {};

// Custom allocation called from generated constructor code
FieldInfo allocateInto(TypeStorageAllocator &alloc) const
{
// return FieldInfo{alloc.copyInto(name), type};
return FieldInfo{id, type};
return FieldInfo{id, type, false};
}
};

Expand Down
Loading

0 comments on commit ac26b59

Please sign in to comment.