Skip to content
Snippets Groups Projects
Commit 3dc54a8c authored by Zuzana Baranová's avatar Zuzana Baranová
Browse files

CC: Put builtin headers into a stringtable to avoid mapping them individually.

parent 0b897fd3
No related branches found
No related tags found
No related merge requests found
...@@ -32,10 +32,10 @@ DIVINE_UNRELAX_WARNINGS ...@@ -32,10 +32,10 @@ DIVINE_UNRELAX_WARNINGS
#include <divine/cc/cc1.hpp> #include <divine/cc/cc1.hpp>
#include <lart/divine/vaarg.h> #include <lart/divine/vaarg.h>
namespace divine::str::cc namespace divine::str
{ {
extern const std::string_view stddef_h; struct stringtable { std::string n; std::string_view c; };
extern const std::string_view stdarg_h; extern stringtable cc_list[];
} }
namespace divine::cc namespace divine::cc
...@@ -84,8 +84,8 @@ namespace divine::cc ...@@ -84,8 +84,8 @@ namespace divine::cc
if ( !ctx ) if ( !ctx )
ctx.reset( new llvm::LLVMContext ); ctx.reset( new llvm::LLVMContext );
mapVirtualFile( "/builtin/stddef.h", ::divine::str::cc::stddef_h ); for ( auto src = str::cc_list; !src->n.empty(); ++src )
mapVirtualFile( "/builtin/stdarg.h", ::divine::str::cc::stdarg_h ); mapVirtualFile( brick::fs::joinPath( "/builtin/", src->n ), src->c );
} }
CC1::~CC1() { } CC1::~CC1() { }
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
namespace divine::str namespace divine::str
{ {
struct stringtable { std::string n; std::string_view c; }; struct stringtable { std::string n; std::string_view c; };
extern stringtable dios_list[]; extern stringtable dios_list[];
namespace dios_native { extern std::string_view libdios_host_a, libc__abi_a, libc___a; } namespace dios_native { extern std::string_view libdios_host_a, libc__abi_a, libc___a; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment