Skip to content

Commit

Permalink
Fix build error for vs2019. (#2626)
Browse files Browse the repository at this point in the history
  • Loading branch information
python3kgae authored Dec 19, 2019
1 parent 2749458 commit e8422a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/HLSL/DxilCondenseResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ bool LegalizeResourcesPHIs(Module &M, DxilValueCache *DVC) {

Br->dropAllReferences();
Br->eraseFromParent();

auto PhiEnd = PHIs.end();
for (Instruction &I : *Succ)
if (PHINode *PN = dyn_cast<PHINode>(&I)) {
if (Instruction *IncomingI = dyn_cast<Instruction>(PN->getIncomingValueForBlock(BB))) {
Expand All @@ -504,7 +504,7 @@ bool LegalizeResourcesPHIs(Module &M, DxilValueCache *DVC) {

if (PN->getNumIncomingValues() == 1) {
PN->replaceAllUsesWith(PN->getIncomingValue(0));
std::remove(PHIs.begin(), PHIs.end(), PN);
PhiEnd = std::remove(PHIs.begin(), PhiEnd, PN);
AddCleanupValues(PN); // Mark for deletion
}
}
Expand All @@ -515,7 +515,7 @@ bool LegalizeResourcesPHIs(Module &M, DxilValueCache *DVC) {
while (!BB->empty()){
Instruction *ChildI = &*BB->rbegin();
if (PHINode *PN = dyn_cast<PHINode>(ChildI))
std::remove(PHIs.begin(), PHIs.end(), PN);
PhiEnd = std::remove(PHIs.begin(), PhiEnd, PN);
ChildI->eraseFromParent();
}
BB->eraseFromParent();
Expand Down
6 changes: 6 additions & 0 deletions tools/clang/unittests/HLSL/DxilContainerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@
#include <atlfile.h>
#include <d3dcompiler.h>
#pragma comment(lib, "d3dcompiler.lib")
#if _MSC_VER >= 1920
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
#include <experimental/filesystem>
#else
#include <filesystem>
#endif
#endif

#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
Expand All @@ -60,6 +65,7 @@
using namespace std;
using namespace hlsl_test;
#ifdef _WIN32

using namespace std::experimental::filesystem;

static uint8_t MaskCount(uint8_t V) {
Expand Down

0 comments on commit e8422a4

Please sign in to comment.