@@ -2476,6 +2476,7 @@ void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
2476
2476
Diag (diag::note_use_dashdash);
2477
2477
}
2478
2478
}
2479
+ // TODO: remove when -foffload-static-lib support is dropped.
2479
2480
else if (A->getOption ().matches (options::OPT_offload_lib_Group)) {
2480
2481
// Add the foffload-static-lib library to the command line to allow
2481
2482
// processing when no source or object is supplied as well as proper
@@ -2497,7 +2498,7 @@ void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
2497
2498
}
2498
2499
}
2499
2500
2500
- static bool runBundler (const std::vector <StringRef> &BundlerArgs,
2501
+ static bool runBundler (const SmallVectorImpl <StringRef> &BundlerArgs,
2501
2502
Compilation &C) {
2502
2503
// Find bundler.
2503
2504
StringRef ExecPath (C.getArgs ().MakeArgString (C.getDriver ().Dir ));
@@ -2536,8 +2537,8 @@ bool hasFPGABinary(Compilation &C, std::string Object, types::ID Type) {
2536
2537
const char *Inputs = C.getArgs ().MakeArgString (Twine (" -inputs=" ) + Object);
2537
2538
// Always use -type=ao for aocx/aocr bundle checking. The 'bundles' are
2538
2539
// actually archives.
2539
- std::vector <StringRef> BundlerArgs = {" clang-offload-bundler" , " -type=ao" ,
2540
- Targets, Inputs, " -check-section" };
2540
+ SmallVector <StringRef, 6 > BundlerArgs = {" clang-offload-bundler" , " -type=ao" ,
2541
+ Targets, Inputs, " -check-section" };
2541
2542
return runBundler (BundlerArgs, C);
2542
2543
}
2543
2544
@@ -2556,8 +2557,8 @@ static bool hasOffloadSections(Compilation &C, const StringRef &Archive,
2556
2557
const char *Inputs = Args.MakeArgString (Twine (" -inputs=" ) + Archive.str ());
2557
2558
// Always use -type=ao for bundle checking. The 'bundles' are
2558
2559
// actually archives.
2559
- std::vector <StringRef> BundlerArgs = {" clang-offload-bundler" , " -type=ao" ,
2560
- Targets, Inputs, " -check-section" };
2560
+ SmallVector <StringRef, 6 > BundlerArgs = {" clang-offload-bundler" , " -type=ao" ,
2561
+ Targets, Inputs, " -check-section" };
2561
2562
return runBundler (BundlerArgs, C);
2562
2563
}
2563
2564
@@ -2663,6 +2664,7 @@ bool Driver::checkForOffloadStaticLib(Compilation &C,
2663
2664
2664
2665
// Right off the bat, assume the presense of -foffload-static-lib means
2665
2666
// the need to perform linking steps for fat static archive offloading.
2667
+ // TODO: remove when -foffload-static-lib support is dropped.
2666
2668
if (Args.hasArg (options::OPT_offload_lib_Group))
2667
2669
return true ;
2668
2670
SmallVector<const char *, 16 > OffloadLibArgs (getLinkerArgs (C, Args));
0 commit comments