Fix debug flags for non-debug VS builds (#364)

The DBG define was set even for release builds.
This commit is contained in:
Marcelo Lopez Ruiz 2017-06-16 19:48:13 -07:00 коммит произвёл GitHub
Родитель fba18dd59c
Коммит 23f9b82096
5 изменённых файлов: 13 добавлений и 9 удалений

Просмотреть файл

@ -60,7 +60,9 @@ if( LLVM_ENABLE_ASSERTIONS )
if( NOT MSVC ) if( NOT MSVC )
add_definitions( -D_DEBUG ) add_definitions( -D_DEBUG )
endif() endif()
add_definitions( -DDBG ) # HLSL Change set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDBG") # HLSL Change
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -UNDEBUG") # HLSL Change
if (0) # HLSL Change Starts
# On non-Debug builds cmake automatically defines NDEBUG, so we # On non-Debug builds cmake automatically defines NDEBUG, so we
# explicitly undefine it: # explicitly undefine it:
if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" ) if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
@ -77,6 +79,7 @@ if( LLVM_ENABLE_ASSERTIONS )
"${flags_var_to_scrub}" "${${flags_var_to_scrub}}") "${flags_var_to_scrub}" "${${flags_var_to_scrub}}")
endforeach() endforeach()
endif() endif()
endif (0) # HLSL Change Ends
endif() endif()
string(TOUPPER "${LLVM_ABI_BREAKING_CHECKS}" uppercase_LLVM_ABI_BREAKING_CHECKS) string(TOUPPER "${LLVM_ABI_BREAKING_CHECKS}" uppercase_LLVM_ABI_BREAKING_CHECKS)

Просмотреть файл

@ -1174,8 +1174,8 @@ void GenerateInputOutputUserCall(InputOutputAccessInfo &info, Value *undefVertex
} else { } else {
Value *V = stInst->getValueOperand(); Value *V = stInst->getValueOperand();
Type *Ty = V->getType(); Type *Ty = V->getType();
DXASSERT(Ty == Ty->getScalarType() && !Ty->isAggregateType(), DXASSERT_LOCALVAR(Ty, Ty == Ty->getScalarType() && !Ty->isAggregateType(),
"only support scalar here"); "only support scalar here");
if (ConstantInt *ColIdx = dyn_cast<ConstantInt>(info.vectorIdx)) { if (ConstantInt *ColIdx = dyn_cast<ConstantInt>(info.vectorIdx)) {
IRBuilder<> Builder(stInst); IRBuilder<> Builder(stInst);
@ -3501,4 +3501,4 @@ ModulePass *llvm::createDxilLegalizeEvalOperationsPass() {
INITIALIZE_PASS(DxilLegalizeEvalOperations, INITIALIZE_PASS(DxilLegalizeEvalOperations,
"hlsl-dxil-legalize-eval-operations", "hlsl-dxil-legalize-eval-operations",
"DXIL legalize eval operations", false, false) "DXIL legalize eval operations", false, false)

Просмотреть файл

@ -432,8 +432,8 @@ void OP::RefreshCache() {
OpCode OpCode = OP::GetDxilOpFuncCallInst(CI); OpCode OpCode = OP::GetDxilOpFuncCallInst(CI);
Type *pOverloadType = OP::GetOverloadType(OpCode, &F); Type *pOverloadType = OP::GetOverloadType(OpCode, &F);
Function *OpFunc = GetOpFunc(OpCode, pOverloadType); Function *OpFunc = GetOpFunc(OpCode, pOverloadType);
(OpFunc);
DXASSERT_NOMSG(OpFunc == &F); DXASSERT_NOMSG(OpFunc == &F);
} }
} }
} }

Просмотреть файл

@ -2309,9 +2309,10 @@ void HLMatrixLowerPass::runOnFunction(Function &F) {
if (group == HLOpcodeGroup::HLMatLoadStore) { if (group == HLOpcodeGroup::HLMatLoadStore) {
HLMatLoadStoreOpcode opcode = HLMatLoadStoreOpcode opcode =
static_cast<HLMatLoadStoreOpcode>(hlsl::GetHLOpcode(CI)); static_cast<HLMatLoadStoreOpcode>(hlsl::GetHLOpcode(CI));
DXASSERT(opcode == HLMatLoadStoreOpcode::ColMatStore || DXASSERT_LOCALVAR(opcode,
opcode == HLMatLoadStoreOpcode::RowMatStore, opcode == HLMatLoadStoreOpcode::ColMatStore ||
"Must MatStore here, load will go IsMatrixType path"); opcode == HLMatLoadStoreOpcode::RowMatStore,
"Must MatStore here, load will go IsMatrixType path");
// Lower it here to make sure it is ready before replace. // Lower it here to make sure it is ready before replace.
lowerToVec(&I); lowerToVec(&I);
} }

Просмотреть файл

@ -280,7 +280,7 @@ private:
Value *CreateResourceForCbPtr(GetElementPtrInst *CbPtr, GlobalVariable *CbGV, Value *CreateResourceForCbPtr(GetElementPtrInst *CbPtr, GlobalVariable *CbGV,
MDNode *MD) { MDNode *MD) {
Type *CbTy = CbPtr->getPointerOperandType(); Type *CbTy = CbPtr->getPointerOperandType();
DXASSERT_NOMSG(CbTy == CbGV->getType()); DXASSERT_LOCALVAR(CbTy, CbTy == CbGV->getType(), "else arg not point to var");
gep_type_iterator GEPIt = gep_type_begin(CbPtr), E = gep_type_end(CbPtr); gep_type_iterator GEPIt = gep_type_begin(CbPtr), E = gep_type_end(CbPtr);
unsigned i = 0; unsigned i = 0;