review: address LLVM/objcopy guideline comments
This commit is contained in:
parent
7ca8df7351
commit
56cbd57532
@ -7,11 +7,10 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/ObjCopy/DXContainer/DXContainerObjcopy.h"
|
||||
#include "llvm/ObjCopy/CommonConfig.h"
|
||||
#include "llvm/ObjCopy/DXContainer/DXContainerConfig.h"
|
||||
|
||||
#include "DXContainerReader.h"
|
||||
#include "DXContainerWriter.h"
|
||||
#include "llvm/ObjCopy/CommonConfig.h"
|
||||
#include "llvm/ObjCopy/DXContainer/DXContainerConfig.h"
|
||||
|
||||
namespace llvm {
|
||||
namespace objcopy {
|
||||
|
@ -6,8 +6,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_LIB_OBJCOPY_DXContainer_DXContainerOBJECT_H
|
||||
#define LLVM_LIB_OBJCOPY_DXContainer_DXContainerOBJECT_H
|
||||
#ifndef LLVM_LIB_OBJCOPY_DXCONTAINER_DXCONTAINEROBJECT_H
|
||||
#define LLVM_LIB_OBJCOPY_DXCONTAINER_DXCONTAINEROBJECT_H
|
||||
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
@ -44,4 +44,4 @@ struct Object {
|
||||
} // end namespace objcopy
|
||||
} // end namespace llvm
|
||||
|
||||
#endif // LLVM_LIB_OBJCOPY_DXContainer_DXContainerOBJECT_H
|
||||
#endif // LLVM_LIB_OBJCOPY_DXCONTAINER_DXCONTAINEROBJECT_H
|
||||
|
@ -21,14 +21,13 @@ Expected<std::unique_ptr<Object>> DXContainerReader::create() const {
|
||||
DataRefImpl PartDRI = Part.getRawDataRefImpl();
|
||||
Expected<StringRef> Name = DXContainerObj.getSectionName(PartDRI);
|
||||
if (auto E = Name.takeError())
|
||||
return createStringError(inconvertibleErrorCode(), "Missing Part Name");
|
||||
return E;
|
||||
assert(Name->size() == 4 &&
|
||||
"Valid DXIL Part name consists of 4 characters");
|
||||
Expected<ArrayRef<uint8_t>> Data =
|
||||
DXContainerObj.getSectionContents(PartDRI);
|
||||
if (auto E = Data.takeError())
|
||||
return createStringError(inconvertibleErrorCode(),
|
||||
"Missing Part Contents");
|
||||
return E;
|
||||
Obj->Parts.push_back({*Name, *Data});
|
||||
}
|
||||
return std::move(Obj);
|
||||
|
@ -1,17 +1,19 @@
|
||||
## Tests that the copied DXContainer is identical to the original
|
||||
|
||||
# RUN: yaml2obj %s -o %t
|
||||
# RUN: llvm-objcopy %t %t.out
|
||||
# RUN: cmp %t %t.out
|
||||
|
||||
# The following DXContainer to copied was generated with:
|
||||
## The DXContainer described below was generated with:
|
||||
|
||||
# `clang-dxc -T cs_6_7 test.hlsl /Fo temp.dxo`
|
||||
# `obj2yaml temp.dxo`
|
||||
## `clang-dxc -T cs_6_7 test.hlsl /Fo temp.dxo`
|
||||
## `obj2yaml temp.dxo`
|
||||
|
||||
# ``` test.hlsl
|
||||
# [RootSignature("")]
|
||||
# [numthreads(1,1,1)]
|
||||
# void main() {}
|
||||
# ```
|
||||
## ``` test.hlsl
|
||||
## [RootSignature("")]
|
||||
## [numthreads(1,1,1)]
|
||||
## void main() {}
|
||||
## ```
|
||||
|
||||
--- !dxcontainer
|
||||
Header:
|
||||
|
@ -1,3 +1,6 @@
|
||||
## Tests that the copied DXContainer is identical to the original, ensuring all
|
||||
## the different headers are correctly handled
|
||||
|
||||
# RUN: yaml2obj %s -o %t
|
||||
# RUN: llvm-objcopy %t %t.out
|
||||
# RUN: cmp %t %t.out
|
||||
|
Loading…
x
Reference in New Issue
Block a user