P4 to Git Change 1062532 by shivara@shivaram_llvmmerge_dt on 2014/08/04 09:50:20

ECR #333753 - Fix for 1.2 conformance compiler options_include_directory test. Added code to pass -I<include_path> option to clang.

Affected files ...

... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/options.cpp#28 edit
This commit is contained in:
foreman
2014-08-04 09:55:45 -04:00
parent 7b3974b5e5
commit fe4d2c12a1
+16 -3
View File
@@ -1047,9 +1047,22 @@ parseAllOptions(std::string& options, Options& Opts, bool linkOptsOnly)
size_t sPos1 = (isShortName ? sPos - 1 : sPos - 2);
std::string oStr = options.substr(sPos1, pos - sPos1);
if (OPTION_info(od) & OA_CLC) {
Opts.clcOptions.append(" " + oStr);
if (!oStr.compare(0, 2, "-D"))
Opts.clangOptions.push_back(oStr);
Opts.clcOptions.append(" " + oStr);
if (!oStr.compare(0, 2, "-D") ||
!oStr.compare(0, 2, "-I")) {
// strip off the leading whitespaces in macro
// definition and include path. Clang treats
// whitespaces as part of macro and include paths.
size_t vPos1 = oStr.find_first_not_of(" ", 2);
if (vPos1 == std::string::npos) {
// Do not allow blank macro and include directories
logInvalidOption(options, bpos, Opts.optionsLog(),
" (expected value)");
return false;
}
std::string vStr = oStr.substr(vPos1, std::string::npos);
Opts.clangOptions.push_back(oStr.substr(0,2) + vStr);
}
}
}