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

tools: Add dioscc (divcc with DiOS).

parent 8aa1ebcd
No related branches found
No related tags found
No related merge requests found
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 4 -*-
/*
* (c) 2017 Jan Horáček <me@apophis.cz>
* (c) 2017-2019 Zuzana Baranová <xbaranov@fi.muni.cz>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <divine/cc/cc1.hpp> //CompileError
#include <divine/cc/native.hpp>
#include <divine/rt/dios-cc.hpp>
#include <divine/rt/runtime.hpp>
#include <divine/ui/version.hpp>
using namespace divine;
/* usage: same as gcc */
int main( int argc, char **argv )
{
try {
rt::NativeDiosCC nativeCC( { argv + 1, argv + argc } );
nativeCC.set_cxx( brick::string::endsWith( argv[0], "divc++" ) );
auto& po = nativeCC._po;
if ( po.hasHelp || po.hasVersion )
{
nativeCC.print_info( ui::version() );
return 0;
}
return nativeCC.run();
} catch ( cc::CompileError &err ) {
std::cerr << err.what() << std::endl;
return 1;
} catch ( std::runtime_error &err ) {
std::cerr << "compilation failed: " << err.what() << std::endl;
return 2;
}
}
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