diff --git a/llvm/lib/ObjCopy/DXContainer/DXContainerObjcopy.cpp b/llvm/lib/ObjCopy/DXContainer/DXContainerObjcopy.cpp index a6a978d96925..375e382ddb04 100644 --- a/llvm/lib/ObjCopy/DXContainer/DXContainerObjcopy.cpp +++ b/llvm/lib/ObjCopy/DXContainer/DXContainerObjcopy.cpp @@ -31,6 +31,7 @@ static Error handleArgs(const CommonConfig &Config, Object &Obj) { if (auto E = Obj.removeParts(RemovePred)) return E; + Obj.recomputeHeader(); return Error::success(); } diff --git a/llvm/lib/ObjCopy/DXContainer/DXContainerObject.cpp b/llvm/lib/ObjCopy/DXContainer/DXContainerObject.cpp index d7c2462d803c..b845478de16d 100644 --- a/llvm/lib/ObjCopy/DXContainer/DXContainerObject.cpp +++ b/llvm/lib/ObjCopy/DXContainer/DXContainerObject.cpp @@ -14,7 +14,6 @@ namespace dxbc { Error Object::removeParts(PartPred ToRemove) { erase_if(Parts, ToRemove); - recomputeHeader(); return Error::success(); } diff --git a/llvm/lib/ObjCopy/DXContainer/DXContainerObject.h b/llvm/lib/ObjCopy/DXContainer/DXContainerObject.h index 9dcf01e3a3a2..cbb09f5ec8e0 100644 --- a/llvm/lib/ObjCopy/DXContainer/DXContainerObject.h +++ b/llvm/lib/ObjCopy/DXContainer/DXContainerObject.h @@ -42,8 +42,6 @@ struct Object { } Error removeParts(PartPred ToRemove); - -private: void recomputeHeader(); };