Skip to content

Commit

Permalink
Revert "Replace llvm::integer_sequence and friends with the C++14 sta…
Browse files Browse the repository at this point in the history
…ndard version"

This reverts commit f724ed4.

Commit requires newer gcc than is used in our internal builds.
Revert until newer gcc is available.

Change-Id: I513287576ad2e98675d8554f4b665f5398c46c60
  • Loading branch information
searlmc1 committed Aug 16, 2019
1 parent bf934d8 commit e6a3c23
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions include/clang/ASTMatchers/ASTMatchersInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1334,14 +1334,14 @@ template <typename... Ps> class VariadicOperatorMatcher {
template <typename T> operator Matcher<T>() const {
return DynTypedMatcher::constructVariadic(
Op, ast_type_traits::ASTNodeKind::getFromNodeKind<T>(),
getMatchers<T>(std::index_sequence_for<Ps...>()))
getMatchers<T>(llvm::index_sequence_for<Ps...>()))
.template unconditionalConvertTo<T>();
}

private:
// Helper method to unpack the tuple into a vector.
template <typename T, std::size_t... Is>
std::vector<DynTypedMatcher> getMatchers(std::index_sequence<Is...>) const {
std::vector<DynTypedMatcher> getMatchers(llvm::index_sequence<Is...>) const {
return {Matcher<T>(std::get<Is>(Params))...};
}

Expand Down
4 changes: 2 additions & 2 deletions include/clang/Sema/Sema.h
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ class Sema {

template <std::size_t... Is>
void emit(const SemaDiagnosticBuilder &DB,
std::index_sequence<Is...>) const {
llvm::index_sequence<Is...>) const {
// Apply all tuple elements to the builder in order.
bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
(void)Dummy;
Expand All @@ -1636,7 +1636,7 @@ class Sema {

void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
emit(DB, std::index_sequence_for<Ts...>());
emit(DB, llvm::index_sequence_for<Ts...>());
DB << T;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ template <typename RuleType, typename... RequirementTypes, size_t... Is>
void invokeRuleAfterValidatingRequirements(
RefactoringResultConsumer &Consumer, RefactoringRuleContext &Context,
const std::tuple<RequirementTypes...> &Requirements,
std::index_sequence<Is...>) {
llvm::index_sequence<Is...>) {
// Check if the requirements we're interested in can be evaluated.
auto Values =
std::make_tuple(std::get<Is>(Requirements).evaluate(Context)...);
Expand Down Expand Up @@ -87,7 +87,7 @@ template <typename... RequirementTypes, size_t... Is>
void visitRefactoringOptions(
RefactoringOptionVisitor &Visitor,
const std::tuple<RequirementTypes...> &Requirements,
std::index_sequence<Is...>) {
llvm::index_sequence<Is...>) {
visitRefactoringOptionsImpl(Visitor, std::get<Is>(Requirements)...);
}

Expand Down Expand Up @@ -131,7 +131,7 @@ createRefactoringActionRule(const RequirementTypes &... Requirements) {
RefactoringRuleContext &Context) override {
internal::invokeRuleAfterValidatingRequirements<RuleType>(
Consumer, Context, Requirements,
std::index_sequence_for<RequirementTypes...>());
llvm::index_sequence_for<RequirementTypes...>());
}

bool hasSelectionRequirement() override {
Expand All @@ -142,7 +142,7 @@ createRefactoringActionRule(const RequirementTypes &... Requirements) {
void visitRefactoringOptions(RefactoringOptionVisitor &Visitor) override {
internal::visitRefactoringOptions(
Visitor, Requirements,
std::index_sequence_for<RequirementTypes...>());
llvm::index_sequence_for<RequirementTypes...>());
}
private:
std::tuple<RequirementTypes...> Requirements;
Expand Down
4 changes: 2 additions & 2 deletions lib/CodeGen/EHScopeStack.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@ class EHScopeStack {
SavedTuple Saved;

template <std::size_t... Is>
T restore(CodeGenFunction &CGF, std::index_sequence<Is...>) {
T restore(CodeGenFunction &CGF, llvm::index_sequence<Is...>) {
// It's important that the restores are emitted in order. The braced init
// list guarantees that.
return T{DominatingValue<As>::restore(CGF, std::get<Is>(Saved))...};
}

void Emit(CodeGenFunction &CGF, Flags flags) override {
restore(CGF, std::index_sequence_for<As...>()).Emit(CGF, flags);
restore(CGF, llvm::index_sequence_for<As...>()).Emit(CGF, flags);
}

public:
Expand Down

0 comments on commit e6a3c23

Please sign in to comment.