From 3aadbb87c2dee357a6cafdd72c8d5e15b1b5530d Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Tue, 4 Apr 2017 13:49:33 -0500 Subject: [PATCH] Trick 15.3.dev does not build with clang/llvm 4.0.0 libraries. #410 Added a missing header file and backported a variation of the almostRealPath call from 17. --- trick_source/codegen/Interface_Code_Gen/Utilities.cpp | 4 ++++ trick_source/codegen/Interface_Code_Gen/Utilities.hh | 1 + trick_source/codegen/Interface_Code_Gen/main.cpp | 1 + 3 files changed, 6 insertions(+) diff --git a/trick_source/codegen/Interface_Code_Gen/Utilities.cpp b/trick_source/codegen/Interface_Code_Gen/Utilities.cpp index 6c8184bd..67d4e302 100644 --- a/trick_source/codegen/Interface_Code_Gen/Utilities.cpp +++ b/trick_source/codegen/Interface_Code_Gen/Utilities.cpp @@ -68,6 +68,10 @@ std::string getFileName( clang::CompilerInstance & ci , clang::SourceLocation sl } #include +char * almostRealPath( const std::string& in_path ) { + return almostRealPath(in_path.c_str()); +} + /* This function returns almost absolute path of the directory of the incoming path. It does not follow the last symbolic link. diff --git a/trick_source/codegen/Interface_Code_Gen/Utilities.hh b/trick_source/codegen/Interface_Code_Gen/Utilities.hh index dfabb3d6..96018337 100644 --- a/trick_source/codegen/Interface_Code_Gen/Utilities.hh +++ b/trick_source/codegen/Interface_Code_Gen/Utilities.hh @@ -11,6 +11,7 @@ std::string trim( const std::string& str, const std::string& whitespace = " \t\n bool isInUserCode( clang::CompilerInstance & ci , clang::SourceLocation sl , HeaderSearchDirs & hsd ) ; bool isInUserOrTrickCode( clang::CompilerInstance & ci , clang::SourceLocation sl , HeaderSearchDirs & hsd ) ; std::string getFileName( clang::CompilerInstance & ci , clang::SourceLocation sl , HeaderSearchDirs & hsd ) ; +char * almostRealPath( const std::string& in_path ) ; char * almostRealPath( const char * in_path ) ; #endif diff --git a/trick_source/codegen/Interface_Code_Gen/main.cpp b/trick_source/codegen/Interface_Code_Gen/main.cpp index 05a942b3..8013da32 100644 --- a/trick_source/codegen/Interface_Code_Gen/main.cpp +++ b/trick_source/codegen/Interface_Code_Gen/main.cpp @@ -13,6 +13,7 @@ #include "clang/Basic/TargetInfo.h" #include "clang/Basic/FileManager.h" #include "clang/Lex/Preprocessor.h" +#include "clang/Lex/PreprocessorOptions.h" #include "clang/Basic/Diagnostic.h" #include "clang/Parse/ParseAST.h"