aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ASTConcept.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/ASTConcept.cpp')
-rw-r--r--clang/lib/AST/ASTConcept.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/clang/lib/AST/ASTConcept.cpp b/clang/lib/AST/ASTConcept.cpp
index 8f2d94572184..b3ec99448b3e 100644
--- a/clang/lib/AST/ASTConcept.cpp
+++ b/clang/lib/AST/ASTConcept.cpp
@@ -13,10 +13,9 @@
#include "clang/AST/ASTConcept.h"
#include "clang/AST/ASTContext.h"
-#include "clang/AST/Decl.h"
-#include "clang/AST/TemplateBase.h"
+#include "clang/AST/PrettyPrinter.h"
#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/FoldingSet.h"
+
using namespace clang;
namespace {
@@ -89,3 +88,27 @@ void ConstraintSatisfaction::Profile(
for (auto &Arg : TemplateArgs)
Arg.Profile(ID, C);
}
+
+ConceptReference *
+ConceptReference::Create(const ASTContext &C, NestedNameSpecifierLoc NNS,
+ SourceLocation TemplateKWLoc,
+ DeclarationNameInfo ConceptNameInfo,
+ NamedDecl *FoundDecl, ConceptDecl *NamedConcept,
+ const ASTTemplateArgumentListInfo *ArgsAsWritten) {
+ return new (C) ConceptReference(NNS, TemplateKWLoc, ConceptNameInfo,
+ FoundDecl, NamedConcept, ArgsAsWritten);
+}
+
+void ConceptReference::print(llvm::raw_ostream &OS,
+ const PrintingPolicy &Policy) const {
+ if (NestedNameSpec)
+ NestedNameSpec.getNestedNameSpecifier()->print(OS, Policy);
+ ConceptName.printName(OS, Policy);
+ if (hasExplicitTemplateArgs()) {
+ OS << "<";
+ // FIXME: Find corresponding parameter for argument
+ for (auto &ArgLoc : ArgsAsWritten->arguments())
+ ArgLoc.getArgument().print(Policy, OS, /*IncludeType*/ false);
+ OS << ">";
+ }
+}