mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 12:56:26 +00:00
Made a couple of changes in ICG source code to handle clang API differences. Encapsulated differences in ifdefs. Added libclangSupport to ICG link line.
This commit is contained in:
parent
afbc78c5e7
commit
a48b39bfc1
@ -233,6 +233,8 @@ AC_CHECK_FILE([$LLVM_LIB_DIR/libclangFrontend.a],
|
||||
)
|
||||
)
|
||||
|
||||
AC_CHECK_FILE([$LLVM_LIB_DIR/libclangSupport.a],[ICG_CLANGLIBS="$ICG_CLANGLIBS -lclangSupport"],[])
|
||||
|
||||
AC_SUBST([ICG_CLANGLIBS])
|
||||
|
||||
TR_CLANG_VERSION
|
||||
|
@ -184,7 +184,7 @@ void HeaderSearchDirs::AddDirsAndFiles(std::string env_var, std::vector<std::str
|
||||
void HeaderSearchDirs::ApplyHeaderSearchOptions () {
|
||||
|
||||
clang::ApplyHeaderSearchOptions( hs , hso , pp.getLangOpts() , pp.getTargetInfo().getTriple() ) ;
|
||||
clang::HeaderSearch::search_dir_iterator sdi ;
|
||||
//clang::HeaderSearch::search_dir_iterator sdi ;
|
||||
/*
|
||||
for ( sdi = hs.quoted_dir_begin() ; sdi != hs.quoted_dir_end() ; sdi++ ) {
|
||||
std::cout << "quoted dir " << (*sdi).getName() << std::endl ;
|
||||
@ -225,8 +225,13 @@ void HeaderSearchDirs::addSearchDirs ( std::vector<std::string> & include_dirs,
|
||||
|
||||
bool HeaderSearchDirs::isPathInUserDir (const std::string& in_dir ) {
|
||||
|
||||
#if (LIBCLANG_MAJOR >= 15)
|
||||
for ( clang::ConstSearchDirIterator sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi = std::next(sdi) )
|
||||
#else
|
||||
clang::HeaderSearch::search_dir_iterator sdi ;
|
||||
for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi++ ) {
|
||||
for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi++ )
|
||||
#endif
|
||||
{
|
||||
#if (LIBCLANG_MAJOR < 4) // TODO delete when RHEL 7 no longer supported
|
||||
std::string curr_dir = (*sdi).getName() ;
|
||||
#else
|
||||
@ -252,8 +257,13 @@ bool HeaderSearchDirs::isPathInUserOrTrickDir (const std::string& in_dir ) {
|
||||
return true ;
|
||||
}
|
||||
|
||||
#if (LIBCLANG_MAJOR >= 15)
|
||||
for ( clang::ConstSearchDirIterator sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi = std::next(sdi) )
|
||||
#else
|
||||
clang::HeaderSearch::search_dir_iterator sdi ;
|
||||
for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi++ ) {
|
||||
for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi++ )
|
||||
#endif
|
||||
{
|
||||
#if (LIBCLANG_MAJOR < 4) // TODO delete when RHEL 7 no longer supported
|
||||
std::string curr_dir = (*sdi).getName() ;
|
||||
#else
|
||||
|
@ -160,7 +160,9 @@ int main(int argc, char * argv[]) {
|
||||
// Set all of the defaults to c++
|
||||
#if (LIBCLANG_MAJOR > 3) || ((LIBCLANG_MAJOR == 3) && (LIBCLANG_MINOR >= 9))
|
||||
llvm::Triple trip (to.Triple) ;
|
||||
#if (LIBCLANG_MAJOR >= 12)
|
||||
#if (LIBCLANG_MAJOR >= 15)
|
||||
//clang::CompilerInvocation::setLangDefaults(ci.getLangOpts(), clang::Language::CXX, trip, ppo.Includes) ;
|
||||
#elif (LIBCLANG_MAJOR >= 12)
|
||||
clang::CompilerInvocation::setLangDefaults(ci.getLangOpts(), clang::Language::CXX, trip, ppo.Includes) ;
|
||||
#elif (LIBCLANG_MAJOR >= 10)
|
||||
clang::CompilerInvocation::setLangDefaults(ci.getLangOpts(), clang::Language::CXX, trip, ppo) ;
|
||||
|
Loading…
Reference in New Issue
Block a user