Skip to content

Commit c1858cd

Browse files
[clang-link-wrapper] Fix a warning
This patch fixes: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp:221:23: error: unused function 'getInputBitcodeLibrary' [-Werror,-Wunused-function]
1 parent 847f4ef commit c1858cd

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

-27
Original file line numberDiff line numberDiff line change
@@ -216,33 +216,6 @@ void printCommands(ArrayRef<StringRef> CmdArgs) {
216216
exit(EXIT_FAILURE);
217217
}
218218

219-
/// Create an extra user-specified \p OffloadFile.
220-
/// TODO: We should find a way to wrap these as libraries instead.
221-
Expected<OffloadFile> getInputBitcodeLibrary(StringRef Input) {
222-
auto [Device, Path] = StringRef(Input).split('=');
223-
auto [String, Arch] = Device.rsplit('-');
224-
auto [Kind, Triple] = String.split('-');
225-
226-
llvm::ErrorOr<std::unique_ptr<MemoryBuffer>> ImageOrError =
227-
llvm::MemoryBuffer::getFileOrSTDIN(Path);
228-
if (std::error_code EC = ImageOrError.getError())
229-
return createFileError(Path, EC);
230-
231-
OffloadingImage Image{};
232-
Image.TheImageKind = IMG_Bitcode;
233-
Image.TheOffloadKind = getOffloadKind(Kind);
234-
Image.StringData["triple"] = Triple;
235-
Image.StringData["arch"] = Arch;
236-
Image.Image = std::move(*ImageOrError);
237-
238-
std::unique_ptr<MemoryBuffer> Binary =
239-
MemoryBuffer::getMemBufferCopy(OffloadBinary::write(Image));
240-
auto NewBinaryOrErr = OffloadBinary::create(*Binary);
241-
if (!NewBinaryOrErr)
242-
return NewBinaryOrErr.takeError();
243-
return OffloadFile(std::move(*NewBinaryOrErr), std::move(Binary));
244-
}
245-
246219
std::string getMainExecutable(const char *Name) {
247220
void *Ptr = (void *)(intptr_t)&getMainExecutable;
248221
auto COWPath = sys::fs::getMainExecutable(Name, Ptr);

0 commit comments

Comments
 (0)