We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is a source code:
Function EntryPoint Alias "EntryPoint"()As Integer Dim pValue As Integer Ptr = CPtr(Integer Ptr, 0) Return 0 End Function
When compiling with the "-gen lvm " option and then compiling via "clang.exe -c -S EntryPoint.ll -o EntryPoint.asm" returns an error:
EntryPoint.ll:29:13: error: integer constant must have integer type store i64* 0, i64** %PVALUE.1 ^ 1 error generated.
In the generated code, we find:
%FBSTRING = type { i8*, i64, i64 } declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1) nounwind %fb_RTTI$ = type { i8*, i8*, %fb_RTTI$* } @__fb_ZTS6Object = global %fb_RTTI$ zeroinitializer @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 0, void ()* @fb_ctor__EntryPoint }] define i64 @EntryPoint( ) nounwind { ; localvar fb$result %fb$result.0 = alloca i64 ; localvar PVALUE %PVALUE.1 = alloca i64* ; addrof fb$result ; memclear fb$result %vr1 = bitcast i64* %fb$result.0 to i8* call void @llvm.memset.p0i8.i32( i8* %vr1, i8 0, i32 8, i32 1, i1 false ) ; label .Lt_0004 br label %.Lt_0004 .Lt_0004: ; store PVALUE := 20 store i64* 0, i64** %PVALUE.1 ; store fb$result := 0 store i64 0, i64* %fb$result.0 ; goto .Lt_0005 br label %.Lt_0005 .Lt_0006: ; label .Lt_0005 br label %.Lt_0005 .Lt_0005: ; loadres fb$result %vr3 = load i64, i64* %fb$result.0 ret i64 %vr3 }
And it should be like this:
store i64* inttoptr (i64 0 to i64*), i64** %1, align 8
Clang also throws an error on strings:
@__fb_ZTS6Object = global %fb_RTTI$ zeroinitializer @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 0, void ()* @fb_ctor__EntryPoint }]
If you remove them, the compilation will be successful.
The text was updated successfully, but these errors were encountered:
EntryPoint.ll:8:100: error: use of undefined value '@fb_ctor__EntryPoint' @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 0, void ()* @"<U+0001>fb_ctor__EntryPoint" }] ^ 1 error generated.
Sorry, something went wrong.
I think constructors and destructors need to be declared before use.
No branches or pull requests
There is a source code:
When compiling with the "-gen lvm " option and then compiling via "clang.exe -c -S EntryPoint.ll -o EntryPoint.asm" returns an error:
In the generated code, we find:
And it should be like this:
Clang also throws an error on strings:
If you remove them, the compilation will be successful.
The text was updated successfully, but these errors were encountered: