Fix frequent warnings on gcc and clang (#4175)
This commit is contained in:
Родитель
e9378896be
Коммит
2bd9843e95
|
@ -79,7 +79,7 @@ PointerInfo GetPointerInfo(Value* V, PointerInfoMap &ptrInfoMap) {
|
|||
// }
|
||||
}
|
||||
return ptrInfoMap[V];
|
||||
};
|
||||
}
|
||||
|
||||
struct ValueInfo {
|
||||
bool isCbuffer : 1;
|
||||
|
|
|
@ -1094,7 +1094,7 @@ private:
|
|||
|
||||
void UpdateFunctionToShaderCompat(const llvm::Function* dxilFunc) {
|
||||
#define SFLAG(stage) ((unsigned)1 << (unsigned)DXIL::ShaderKind::stage)
|
||||
for (const auto &user : dxilFunc->users()) {
|
||||
for (const llvm::User *user : dxilFunc->users()) {
|
||||
if (const llvm::CallInst *CI = dyn_cast<const llvm::CallInst>(user)) {
|
||||
// Find calling function
|
||||
const llvm::Function *F = cast<const llvm::Function>(CI->getParent()->getParent());
|
||||
|
@ -1214,7 +1214,7 @@ private:
|
|||
}
|
||||
|
||||
void UpdateFunctionDependency(llvm::Function *F) {
|
||||
for (const auto &user : F->users()) {
|
||||
for (const llvm::User *user : F->users()) {
|
||||
llvm::SmallVector<const llvm::Function*, 8> functions;
|
||||
FindUsingFunctions(user, functions);
|
||||
for (const llvm::Function *userFunction : functions) {
|
||||
|
|
|
@ -894,7 +894,7 @@ private:
|
|||
SmallVector<StringRef, 14> Splits;
|
||||
ArgSpec.split(Splits, ",");
|
||||
|
||||
for (const StringRef Split : Splits)
|
||||
for (const StringRef &Split : Splits)
|
||||
{
|
||||
StringRef Field = Split.trim();
|
||||
StringRef HighLevelArgInfo;
|
||||
|
|
|
@ -2441,7 +2441,7 @@ void CGMSHLSLRuntime::AddHLSLFunctionInfo(Function *F, const FunctionDecl *FD) {
|
|||
}
|
||||
|
||||
// Add target-dependent experimental function attributes
|
||||
for (const auto &Attr : FD->specific_attrs<HLSLExperimentalAttr>()) {
|
||||
for (const HLSLExperimentalAttr *Attr : FD->specific_attrs<HLSLExperimentalAttr>()) {
|
||||
F->addFnAttr(Twine("exp-", Attr->getName()).str(), Attr->getValue());
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
namespace CGHLSLMSHelper
|
||||
{
|
||||
struct Scope;
|
||||
};
|
||||
}
|
||||
|
||||
namespace llvm {
|
||||
class BasicBlock;
|
||||
|
|
|
@ -282,7 +282,7 @@ std::pair<uint32_t, uint32_t> AlignmentSizeCalculator::getAlignmentAndSize(
|
|||
// If this struct is derived from some other structs, place an implicit
|
||||
// field at the very beginning for the base struct.
|
||||
if (const auto *cxxDecl = dyn_cast<CXXRecordDecl>(structType->getDecl())) {
|
||||
for (const auto base : cxxDecl->bases()) {
|
||||
for (const auto &base : cxxDecl->bases()) {
|
||||
uint32_t memberAlignment = 0, memberSize = 0;
|
||||
std::tie(memberAlignment, memberSize) =
|
||||
getAlignmentAndSize(base.getType(), rule, isRowMajor, stride);
|
||||
|
|
|
@ -45,6 +45,8 @@ public:
|
|||
/// regardless of their polymorphism.
|
||||
bool visitInstruction(SpirvInstruction *);
|
||||
|
||||
using Visitor::visit;
|
||||
|
||||
private:
|
||||
/// Emits error to the diagnostic engine associated with this visitor.
|
||||
template <unsigned N>
|
||||
|
|
|
@ -446,7 +446,7 @@ const SpirvType *LowerTypeVisitor::lowerType(QualType type,
|
|||
// If this struct is derived from some other struct, place an implicit
|
||||
// field at the very beginning for the base struct.
|
||||
if (const auto *cxxDecl = dyn_cast<CXXRecordDecl>(decl)) {
|
||||
for (const auto base : cxxDecl->bases()) {
|
||||
for (const auto &base : cxxDecl->bases()) {
|
||||
fields.push_back(HybridStructType::FieldInfo(base.getType()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,8 @@ public:
|
|||
/// regardless of their polymorphism.
|
||||
bool visitInstruction(SpirvInstruction *) { return true; }
|
||||
|
||||
using Visitor::visit;
|
||||
|
||||
private:
|
||||
// Invokes visitor for each operand of the debug instruction `di`. If
|
||||
// `visitor` returns false, it stops and returns.
|
||||
|
|
|
@ -10401,9 +10401,9 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
|
|||
|
||||
// HLSL Change Starts
|
||||
// Handle HLSL binary operands differently
|
||||
if (getLangOpts().HLSL &&
|
||||
if ((getLangOpts().HLSL &&
|
||||
(!getLangOpts().EnableOperatorOverloading ||
|
||||
!hlsl::IsUserDefinedRecordType(LHSExpr->getType())) ||
|
||||
!hlsl::IsUserDefinedRecordType(LHSExpr->getType()))) ||
|
||||
!hlsl::DoesTypeDefineOverloadedOperator(
|
||||
LHSExpr->getType(), clang::BinaryOperator::getOverloadedOperator(Opc),
|
||||
RHSExpr->getType())) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче