Skip to content

Commit 217f6ef

Browse files
committed
use string instead of stringref
1 parent 945966b commit 217f6ef

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

include/API/Device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Device {
6363
size_t SizeInBytes) = 0;
6464

6565
virtual llvm::Expected<std::shared_ptr<Texture>>
66-
createTexture(llvm::StringRef Name, TextureCreateDesc &Desc) = 0;
66+
createTexture(std::string Name, TextureCreateDesc &Desc) = 0;
6767

6868
virtual void printExtra(llvm::raw_ostream &OS) {}
6969

lib/API/DX/Device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ class DXDevice : public offloadtest::Device {
404404
}
405405

406406
llvm::Expected<std::shared_ptr<offloadtest::Texture>>
407-
createTexture(llvm::StringRef Name, TextureCreateDesc &Desc) override {
407+
createTexture(std::string Name, TextureCreateDesc &Desc) override {
408408
if (!isValidTextureUsageAndFormat(Desc.Usage, Desc.Format))
409409
return llvm::createStringError(
410410
std::errc::invalid_argument,

lib/API/MTL/MTLDevice.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ class MTLDevice : public offloadtest::Device {
592592
}
593593

594594
llvm::Expected<std::shared_ptr<offloadtest::Texture>>
595-
createTexture(llvm::StringRef Name, TextureCreateDesc &Desc) override {
595+
createTexture(std::string Name, TextureCreateDesc &Desc) override {
596596
if (!isValidTextureUsageAndFormat(Desc.Usage, Desc.Format))
597597
return llvm::createStringError(
598598
std::errc::invalid_argument,
@@ -601,10 +601,9 @@ class MTLDevice : public offloadtest::Device {
601601
getTextureUsageName(Desc.Usage).c_str(),
602602
getTextureFormatName(Desc.Format).data());
603603

604-
MTL::TextureDescriptor *TDesc =
605-
MTL::TextureDescriptor::texture2DDescriptor(
606-
getMetalFormat(Desc.Format), Desc.Width, Desc.Height,
607-
Desc.MipLevels > 1);
604+
MTL::TextureDescriptor *TDesc = MTL::TextureDescriptor::texture2DDescriptor(
605+
getMetalFormat(Desc.Format), Desc.Width, Desc.Height,
606+
Desc.MipLevels > 1);
608607
TDesc->setMipmapLevelCount(Desc.MipLevels);
609608
TDesc->setStorageMode(getMetalStorageMode(Desc.Location));
610609
TDesc->setUsage(getMetalTextureUsage(Desc.Usage));

lib/API/VK/Device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ class VulkanDevice : public offloadtest::Device {
672672
}
673673

674674
llvm::Expected<std::shared_ptr<offloadtest::Texture>>
675-
createTexture(llvm::StringRef Name, TextureCreateDesc &Desc) override {
675+
createTexture(std::string Name, TextureCreateDesc &Desc) override {
676676
if (!isValidTextureUsageAndFormat(Desc.Usage, Desc.Format))
677677
return llvm::createStringError(
678678
std::errc::invalid_argument,

0 commit comments

Comments
 (0)