Skip to content

LLVM bitcode file doesn't contain a valid module. #50

@dio4ev

Description

@dio4ev

Suppose the following simple C file

#include <stdlib.h>

int main (void) {
return EXIT_SUCCESS;
}

and its LLVM IR representation (created with LLVM 3.5 and clang -emit-llvm -S hello.c -o hello.c.bc)

; ModuleID = 'hello.c'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind uwtable
define i32 @main() #0 {
%1 = alloca i32, align 4
store i32 0, i32* %1
ret i32 0
}

attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }

!llvm.ident = !{!0}

!0 = metadata !{metadata !"clang version 3.5.2 (tags/RELEASE_352/final)"}

If I call llvm2kittel on the LLVM file then I get the following error message LLVM bitcode file doesn't contain a valid module..
What is missing here? Do I need an additional flag for clang?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions