mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 20:57:55 +00:00
changes to support llvm 9.0 closes #869
This commit is contained in:
parent
296bf77e74
commit
5004f95fdd
@ -197,7 +197,7 @@ ICG:
|
||||
|
||||
force_ICG:
|
||||
$(PRINT_ICG)
|
||||
$(call ECHO_AND_LOG,${TRICK_HOME}/bin/trick-ICG -f -m ${TRICK_ICGFLAGS} ${TRICK_CXXFLAGS} ${TRICK_SYSTEM_CXXFLAGS} S_source.hh)
|
||||
$(call ECHO_AND_LOG,${TRICK_HOME}/bin/trick-ICG -force -m ${TRICK_ICGFLAGS} ${TRICK_CXXFLAGS} ${TRICK_SYSTEM_CXXFLAGS} S_source.hh)
|
||||
|
||||
# Create makefile for IO code
|
||||
build/Makefile_io_src: S_source.hh | build
|
||||
|
@ -43,13 +43,9 @@ void FindTrickICG::If(clang::SourceLocation Loc, clang::SourceRange ConditionRan
|
||||
{
|
||||
if ( ConditionRange.isValid() ) {
|
||||
// Get the full text of the if statement into a string
|
||||
clang::FullSourceLoc fsl_begin(ConditionRange.getBegin() , ci.getSourceManager()) ;
|
||||
clang::FullSourceLoc fsl_end(ConditionRange.getEnd() , ci.getSourceManager()) ;
|
||||
std::string if_text( fsl_begin.getCharacterData() ,
|
||||
(size_t)(fsl_end.getCharacterData() - fsl_begin.getCharacterData())) ;
|
||||
|
||||
llvm::StringRef ref = clang::Lexer::getSourceText(clang::CharSourceRange::getCharRange(ConditionRange), ci.getSourceManager(), clang::LangOptions());
|
||||
// if the if statement contains TRICK_ICG we need to mark it.
|
||||
if ( if_text.find("TRICK_ICG") != std::string::npos ) {
|
||||
if ( ref.str().find("TRICK_ICG") != std::string::npos ) {
|
||||
// for each header in the stack, mark them as being exposed to TRICK_ICG
|
||||
std::vector<std::string>::iterator it ;
|
||||
for ( it = included_files.begin() ; it != included_files.end() ; it++ ) {
|
||||
|
@ -29,18 +29,18 @@
|
||||
|
||||
/* Command line arguments. These work better as globals, as suggested in llvm/CommandLine documentation */
|
||||
llvm::cl::list<std::string> include_dirs("I", llvm::cl::Prefix, llvm::cl::desc("Include directory"), llvm::cl::value_desc("directory"));
|
||||
llvm::cl::list<std::string> f_options("f", llvm::cl::Prefix, llvm::cl::desc("Compiler options that have f prefix"), llvm::cl::value_desc("option"));
|
||||
llvm::cl::list<std::string> isystem_dirs("isystem", llvm::cl::Prefix, llvm::cl::desc("Include directory, suppress all warnings"), llvm::cl::value_desc("directory"));
|
||||
llvm::cl::list<std::string> defines("D", llvm::cl::Prefix, llvm::cl::desc("Defines"), llvm::cl::value_desc("define"));
|
||||
// TODO: remove units_truth_is_scary in 2021.
|
||||
llvm::cl::opt<bool> units_truth_is_scary("units-truth-is-scary", llvm::cl::desc("DEPRECATED: Don't print units conversion messages"));
|
||||
llvm::cl::opt<bool> sim_services_flag("s", llvm::cl::desc("Gernerate io_src for Trick core headers"));
|
||||
llvm::cl::opt<bool> force("f", llvm::cl::desc("Force all io_src files to be generated"));
|
||||
llvm::cl::opt<bool> force("force", llvm::cl::desc("Force all io_src files to be generated"));
|
||||
llvm::cl::opt<int> attr_version("v", llvm::cl::desc("Select version of attributes to produce. 10 and 13 are valid"), llvm::cl::init(10));
|
||||
llvm::cl::opt<int> debug_level("d", llvm::cl::desc("Set debug level"), llvm::cl::init(0), llvm::cl::ZeroOrMore);
|
||||
llvm::cl::opt<bool> create_map("m", llvm::cl::desc("Create map files"), llvm::cl::init(false));
|
||||
llvm::cl::opt<std::string> output_dir("o", llvm::cl::desc("Output directory"));
|
||||
llvm::cl::alias ssf_alias("sim_services" , llvm::cl::desc("Alias for -s") , llvm::cl::aliasopt(sim_services_flag));
|
||||
llvm::cl::alias force_alias("force" , llvm::cl::desc("Alias for -f") , llvm::cl::aliasopt(force));
|
||||
llvm::cl::list<std::string> input_file_names(llvm::cl::Positional, llvm::cl::desc("<input_file>"), llvm::cl::ZeroOrMore);
|
||||
llvm::cl::list<std::string> sink(llvm::cl::Sink, llvm::cl::ZeroOrMore);
|
||||
llvm::cl::list<std::string> pre_compiled_headers("include", llvm::cl::Prefix, llvm::cl::desc("pre-compiled headers"), llvm::cl::value_desc("pre_compiled_headers"));
|
||||
|
Loading…
Reference in New Issue
Block a user