Skip to content

Commit

Permalink
Merge master:2f1fe1864d2 into amd-gfx
Browse files Browse the repository at this point in the history
Change-Id: I74ce8025760e154a6fdfa9d5685a16ce83b87aa5
  • Loading branch information
jayfoad committed May 7, 2020
2 parents bef5b30 + 2f1fe18 commit 40c0da7
Show file tree
Hide file tree
Showing 40 changed files with 898 additions and 295 deletions.
6 changes: 6 additions & 0 deletions clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ findInsertionPoint(const Tweak::Selection &Inputs,

bool AddUsing::prepare(const Selection &Inputs) {
auto &SM = Inputs.AST->getSourceManager();

// Do not suggest "using" in header files. That way madness lies.
if (isHeaderFile(SM.getFileEntryForID(SM.getMainFileID())->getName(),
Inputs.AST->getLangOpts()))
return false;

auto *Node = Inputs.ASTSelection.commonAncestor();
if (Node == nullptr)
return false;
Expand Down
7 changes: 7 additions & 0 deletions clang-tools-extra/clangd/unittests/TweakTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2463,6 +2463,13 @@ class cc {
// test that we don't crash.
EXPECT_UNAVAILABLE(Header +
"template<typename TT> using foo = one::tt<T^T>;");

// Check that we do not trigger in header files.
FileName = "test.h";
ExtraArgs.push_back("-xc++-header"); // .h file is treated a C by default.
EXPECT_UNAVAILABLE(Header + "void fun() { one::two::f^f(); }");
FileName = "test.hpp";
EXPECT_UNAVAILABLE(Header + "void fun() { one::two::f^f(); }");
}

TEST_F(AddUsingTest, Apply) {
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/AArch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
int getEHDataRegisterNumber(unsigned RegNo) const override;

bool hasInt128Type() const override;

bool hasExtIntType() const override { return true; }
};

class LLVM_LIBRARY_VISIBILITY AArch64leTargetInfo : public AArch64TargetInfo {
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/AMDGPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo {
}

void setAuxTarget(const TargetInfo *Aux) override;

bool hasExtIntType() const override { return true; }
};

} // namespace targets
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/ARC.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class LLVM_LIBRARY_VISIBILITY ARCTargetInfo : public TargetInfo {
TargetInfo::ConstraintInfo &Info) const override {
return false;
}

bool hasExtIntType() const override { return true; }
};

} // namespace targets
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/ARM.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ class LLVM_LIBRARY_VISIBILITY ARMTargetInfo : public TargetInfo {
int getEHDataRegisterNumber(unsigned RegNo) const override;

bool hasSjLjLowering() const override;

bool hasExtIntType() const override { return true; }
};

class LLVM_LIBRARY_VISIBILITY ARMleTargetInfo : public ARMTargetInfo {
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/Hexagon.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ class LLVM_LIBRARY_VISIBILITY HexagonTargetInfo : public TargetInfo {
// We can write more stricter checks later.
return CPU.find('t') != std::string::npos;
}

bool hasExtIntType() const override { return true; }
};
} // namespace targets
} // namespace clang
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/Lanai.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ class LLVM_LIBRARY_VISIBILITY LanaiTargetInfo : public TargetInfo {
}

const char *getClobbers() const override { return ""; }

bool hasExtIntType() const override { return true; }
};
} // namespace targets
} // namespace clang
Expand Down
1 change: 1 addition & 0 deletions clang/lib/Basic/Targets/Mips.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ class LLVM_LIBRARY_VISIBILITY MipsTargetInfo : public TargetInfo {
unsigned getUnwindWordWidth() const override;

bool validateTarget(DiagnosticsEngine &Diags) const override;
bool hasExtIntType() const override { return true; }
};
} // namespace targets
} // namespace clang
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/NVPTX.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ class LLVM_LIBRARY_VISIBILITY NVPTXTargetInfo : public TargetInfo {
return HostTarget->checkCallingConvention(CC);
return CCCR_Warning;
}

bool hasExtIntType() const override { return true; }
};
} // namespace targets
} // namespace clang
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/PNaCl.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class LLVM_LIBRARY_VISIBILITY PNaClTargetInfo : public TargetInfo {
}

const char *getClobbers() const override { return ""; }

bool hasExtIntType() const override { return true; }
};

// We attempt to use PNaCl (le32) frontend and Mips32EL backend.
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/PPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public TargetInfo {
: "u9__ieee128";
}
const char *getFloat128Mangling() const override { return "u9__ieee128"; }

bool hasExtIntType() const override { return true; }
};

class LLVM_LIBRARY_VISIBILITY PPC32TargetInfo : public PPCTargetInfo {
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/RISCV.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ class RISCVTargetInfo : public TargetInfo {

bool handleTargetFeatures(std::vector<std::string> &Features,
DiagnosticsEngine &Diags) override;

bool hasExtIntType() const override { return true; }
};
class LLVM_LIBRARY_VISIBILITY RISCV32TargetInfo : public RISCVTargetInfo {
public:
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/SPIR.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ class LLVM_LIBRARY_VISIBILITY SPIRTargetInfo : public TargetInfo {
// for SPIR since it is a generic target.
getSupportedOpenCLOpts().supportAll();
}

bool hasExtIntType() const override { return true; }
};
class LLVM_LIBRARY_VISIBILITY SPIR32TargetInfo : public SPIRTargetInfo {
public:
Expand Down
3 changes: 3 additions & 0 deletions clang/lib/Basic/Targets/Sparc.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ class LLVM_LIBRARY_VISIBILITY SparcV8TargetInfo : public SparcTargetInfo {
MacroBuilder &Builder) const override;

bool hasSjLjLowering() const override { return true; }
bool hasExtIntType() const override { return true; }
};

// SPARCV8el is the 32-bit little-endian mode selected by Triple::sparcel.
Expand Down Expand Up @@ -227,6 +228,8 @@ class LLVM_LIBRARY_VISIBILITY SparcV9TargetInfo : public SparcTargetInfo {
return false;
return getCPUGeneration(CPU) == CG_V9;
}

bool hasExtIntType() const override { return true; }
};
} // namespace targets
} // namespace clang
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/SystemZ.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class LLVM_LIBRARY_VISIBILITY SystemZTargetInfo : public TargetInfo {
}

const char *getLongDoubleMangling() const override { return "g"; }

bool hasExtIntType() const override { return true; }
};
} // namespace targets
} // namespace clang
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/WebAssembly.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ class LLVM_LIBRARY_VISIBILITY WebAssemblyTargetInfo : public TargetInfo {
return CCCR_Warning;
}
}

bool hasExtIntType() const override { return true; }
};
class LLVM_LIBRARY_VISIBILITY WebAssembly32TargetInfo
: public WebAssemblyTargetInfo {
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/XCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class LLVM_LIBRARY_VISIBILITY XCoreTargetInfo : public TargetInfo {
}

bool allowsLargerPreferedTypeAlignment() const override { return false; }

bool hasExtIntType() const override { return true; }
};
} // namespace targets
} // namespace clang
Expand Down
4 changes: 4 additions & 0 deletions clang/lib/CodeGen/ABIInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ namespace swiftcall {
bool isHomogeneousAggregate(QualType Ty, const Type *&Base,
uint64_t &Members) const;

// Implement the Type::IsPromotableIntegerType for ABI specific needs. The
// only difference is that this considers _ExtInt as well.
bool isPromotableIntegerTypeForABI(QualType Ty) const;

/// A convenience method to return an indirect ABIArgInfo with an
/// expected alignment equal to the ABI alignment of the given type.
CodeGen::ABIArgInfo
Expand Down
Loading

0 comments on commit 40c0da7

Please sign in to comment.