summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/Refactoring/SourceSelectionConstraints.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Tooling/Refactoring/SourceSelectionConstraints.cpp')
-rw-r--r--clang/lib/Tooling/Refactoring/SourceSelectionConstraints.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/lib/Tooling/Refactoring/SourceSelectionConstraints.cpp b/clang/lib/Tooling/Refactoring/SourceSelectionConstraints.cpp
new file mode 100644
index 00000000000..5fbe2946a9d
--- /dev/null
+++ b/clang/lib/Tooling/Refactoring/SourceSelectionConstraints.cpp
@@ -0,0 +1,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