Skip to content

Disambiguation #16312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/swift/AST/ClangNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class ClangNode {
namespace llvm {
template <typename T>
struct PointerLikeTypeTraits<swift::detail::ClangNodeBox<T>> {
using Box = swift::detail::ClangNodeBox<T>;
using Box = ::swift::detail::ClangNodeBox<T>;

static inline void *getAsVoidPointer(Box P) {
return const_cast<void *>(static_cast<const void *>(P.value));
Expand Down
21 changes: 11 additions & 10 deletions include/swift/SIL/SILInstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ class SILInstructionResultArray {

class iterator;

friend bool operator==(iterator, iterator);
friend bool operator!=(iterator, iterator);

iterator begin() const;
iterator end() const;

Expand Down Expand Up @@ -997,17 +1000,16 @@ class NonValueInstruction : public SILInstruction {
}

/// A helper class for defining some basic boilerplate.
template <SILInstructionKind Kind, typename Base,
template <SILInstructionKind Kind, typename InstBase,
bool IsSingleResult =
std::is_base_of<SingleValueInstruction, Base>::value>
std::is_base_of<SingleValueInstruction, InstBase>::value>
class InstructionBase;

template <SILInstructionKind Kind, typename Base>
class InstructionBase<Kind, Base, /*HasResult*/ true> : public Base {
template <SILInstructionKind Kind, typename InstBase>
class InstructionBase<Kind, InstBase, /*HasResult*/ true> : public InstBase {
protected:
template <typename... As>
InstructionBase(As &&...args)
: Base(Kind, std::forward<As>(args)...) {}
InstructionBase(As &&... args) : InstBase(Kind, std::forward<As>(args)...) {}

public:
/// Override to statically return the kind.
Expand All @@ -1023,12 +1025,11 @@ class InstructionBase<Kind, Base, /*HasResult*/ true> : public Base {
}
};

template <SILInstructionKind Kind, typename Base>
class InstructionBase<Kind, Base, /*HasResult*/ false> : public Base {
template <SILInstructionKind Kind, typename InstBase>
class InstructionBase<Kind, InstBase, /*HasResult*/ false> : public InstBase {
protected:
template <typename... As>
InstructionBase(As &&...args)
: Base(Kind, std::forward<As>(args)...) {}
InstructionBase(As &&... args) : InstBase(Kind, std::forward<As>(args)...) {}

public:
static constexpr SILInstructionKind getKind() {
Expand Down