"Attributes.inc" file not found
Asked Answered
L

2

4

I have been using the headers provided in include\llvm and include\llvm-c to try and make my own compiler. However, whenever I try to compile, I get this error. There is no llvm/IR/Attributes.inc in my files nor any LLVM project I have seen. I get this error:

In file included from ./headers/llvm/IR/Function.h:26:
In file included from ./headers/llvm/IR/Argument.h:19:
./headers/llvm/IR/Attributes.h(74,14):  fatal error: 'llvm/IR/Attributes.inc' file not found
    #include "llvm/IR/Attributes.inc"

What is the problem here?

Longanimity answered 4/12, 2018 at 14:50 Comment(3)
Attributes.inc file is generated using tablegen program, which takes Attributes.td domain specific file as input. i suggest you use llvm-config utility to properly get include path of your built llvm.Mistassini
I have not seen tblgen on any tutorial or documentation. Do you recommend any tutorials?Longanimity
i presume you are using the llvm source and building it (instead of llvm-dev packages and headers files), so during the build process it automatically generates all those files and binaries also the "llvm-config" binary contains all the related information. i would suggest you go through llvm.org/docs/GettingStarted.html for building llvm binaries process and pauladamsmith.com/blog/2015/01/… for compiling your c/c++ code using llvm part.Mistassini
G
0

I have encountered the same issue. I got it fixed by adding the following line to the relevant CMakeLists.txt

> add_dependencies(<Module Name> intrinsics_gen)
Globetrotter answered 24/10, 2020 at 14:27 Comment(0)
M
-3

make install-llvm-headers may help u

Malang answered 14/4, 2020 at 7:43 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.