Paths to system header files

Thank you Mikhail and Jacob,

So, the two vectors are filled with the header’s name and content, attachedis the method I use to embed them. It isn’t an ideal solution but it works.I created a small script that (more or less) automatically converts all thebuiltin headers to strings. If you want it, just let me know.

Right now, I don’t understand why I need to convert the builtin headers to strings, but of course I would like to have a look to the script. Any help is very welcomed. You can send it directly to me email if you prefer.

After both vectors are filled, I simply do (bold):

clang::tooling::FixedCompilationDatabase Compilations(“./”,compiler_string);
std::vectorstd::string sources;
sources.push_back(“/esbmc_intrinsics.h”);
sources.push_back(path);

clang::tooling::ClangTool Tool(Compilations, sources);

Tool.mapVirtualFile(“/esbmc_intrinsics.h”, intrinsics);

for(auto it = clang_headers_name.begin(), it1 =clang_headers_content.begin();
(it != clang_headers_name.end()) && (it1 !=clang_headers_content.end());
++it, ++it1)
Tool.mapVirtualFile(*it, *it1);

Ok, I catch the idea, but I have some doubts:

  • “esbmc_intrinsics.h” is always that string? is that a real file?
  • What are “path”, “instrinsics” and “compiler_string” in your code?

As soon as clang 3.8 is released, we’ll open source our project that usesthis code, so it’ll be easier to understand how it’s done. I hope thishelps for now.Also, You will need clang 3.8, as this doesn’t work on clang 3.7.

Could you tell me then how to obtain clang 3.8?

Thanks again.

El día 26 feb 2016 14:06, Pedro Delgado Perez pedro.delgadoperez@mail.uca.es escribió: