File tree Expand file tree Collapse file tree
clang/tools/scan-build-py/lib/libear Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -493,15 +493,21 @@ int eaccess(const char *pathname, int mode) {
493493 return 0 ;
494494 }
495495
496+ int nvcc_available = 0 ;
497+ char * value = getenv ("INTERCEPT_COMPILE_PATH" );
498+ if (value ) {
499+ nvcc_available = 1 ;
500+ }
501+
496502 int len = strlen (pathname );
497- if (len == 4 && pathname [3 ] == 'c' && pathname [2 ] == 'c' &&
503+ if (! nvcc_available && len == 4 && pathname [3 ] == 'c' && pathname [2 ] == 'c' &&
498504 pathname [1 ] == 'v' && pathname [0 ] == 'n' ) {
499505 // To handle case like "nvcc foo.cu ..."
500506 return 0 ;
501507 }
502- if (len > 4 && pathname [ len - 1 ] == 'c' && pathname [len - 2 ] == 'c' &&
503- pathname [len - 3 ] == 'v ' && pathname [len - 4 ] == 'n ' &&
504- pathname [len - 5 ] == '/' ) {
508+ if (! nvcc_available && len > 4 && pathname [len - 1 ] == 'c' &&
509+ pathname [len - 2 ] == 'c ' && pathname [len - 3 ] == 'v ' &&
510+ pathname [len - 4 ] == 'n' && pathname [ len - 5 ] == '/' ) {
505511 // To handle case like "/path/to/nvcc foo.cu ..."
506512 return 0 ;
507513 }
You can’t perform that action at this time.
0 commit comments