summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/Refactoring/SourceSelectionConstraints.cpp
blob: 5fbe2946a9db45f081fff7ddcc8148df79b30b5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//===--- SourceSelectionConstraints.cpp - Evaluate selection constraints --===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "clang/Tooling/Refactoring/SourceSelectionConstraints.h"
#include "clang/Tooling/Refactoring/RefactoringRuleContext.h"

using namespace clang;
using namespace tooling;
using namespace selection;

Optional<SourceSelectionRange>
SourceSelectionRange::evaluate(RefactoringRuleContext &Context) {
  SourceRange R = Context.getSelectionRange();
  if (R.isInvalid())
    return None;
  return SourceSelectionRange(Context.getSources(), R);
}
OpenPOWER on IntegriCloud