llvm/clang/lib/Sema/CodeCompleteConsumer.cpp

//===- CodeCompleteConsumer.cpp - Code Completion Interface ---------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
//  This file implements the CodeCompleteConsumer class.
//
//===----------------------------------------------------------------------===//

#include "clang/Sema/CodeCompleteConsumer.h"
#include "clang-c/Index.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/Type.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/Sema.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <string>

usingnamespaceclang;

//===----------------------------------------------------------------------===//
// Code completion context implementation
//===----------------------------------------------------------------------===//

bool CodeCompletionContext::wantConstructorResults() const {}

StringRef clang::getCompletionKindString(CodeCompletionContext::Kind Kind) {}

//===----------------------------------------------------------------------===//
// Code completion string implementation
//===----------------------------------------------------------------------===//

CodeCompletionString::Chunk::Chunk(ChunkKind Kind, const char *Text)
    :{}

CodeCompletionString::Chunk
CodeCompletionString::Chunk::CreateText(const char *Text) {}

CodeCompletionString::Chunk
CodeCompletionString::Chunk::CreateOptional(CodeCompletionString *Optional) {}

CodeCompletionString::Chunk
CodeCompletionString::Chunk::CreatePlaceholder(const char *Placeholder) {}

CodeCompletionString::Chunk
CodeCompletionString::Chunk::CreateInformative(const char *Informative) {}

CodeCompletionString::Chunk
CodeCompletionString::Chunk::CreateResultType(const char *ResultType) {}

CodeCompletionString::Chunk CodeCompletionString::Chunk::CreateCurrentParameter(
    const char *CurrentParameter) {}

CodeCompletionString::CodeCompletionString(
    const Chunk *Chunks, unsigned NumChunks, unsigned Priority,
    CXAvailabilityKind Availability, const char **Annotations,
    unsigned NumAnnotations, StringRef ParentName, const char *BriefComment)
    :{}

unsigned CodeCompletionString::getAnnotationCount() const {}

const char *CodeCompletionString::getAnnotation(unsigned AnnotationNr) const {}

std::string CodeCompletionString::getAsString() const {}

const char *CodeCompletionString::getTypedText() const {}

std::string CodeCompletionString::getAllTypedText() const {}

const char *CodeCompletionAllocator::CopyString(const Twine &String) {}

StringRef CodeCompletionTUInfo::getParentName(const DeclContext *DC) {}

CodeCompletionString *CodeCompletionBuilder::TakeString() {}

void CodeCompletionBuilder::AddTypedTextChunk(const char *Text) {}

void CodeCompletionBuilder::AddTextChunk(const char *Text) {}

void CodeCompletionBuilder::AddOptionalChunk(CodeCompletionString *Optional) {}

void CodeCompletionBuilder::AddPlaceholderChunk(const char *Placeholder) {}

void CodeCompletionBuilder::AddInformativeChunk(const char *Text) {}

void CodeCompletionBuilder::AddResultTypeChunk(const char *ResultType) {}

void CodeCompletionBuilder::AddCurrentParameterChunk(
    const char *CurrentParameter) {}

void CodeCompletionBuilder::AddChunk(CodeCompletionString::ChunkKind CK,
                                     const char *Text) {}

void CodeCompletionBuilder::addParentContext(const DeclContext *DC) {}

void CodeCompletionBuilder::addBriefComment(StringRef Comment) {}

//===----------------------------------------------------------------------===//
// Code completion overload candidate implementation
//===----------------------------------------------------------------------===//
FunctionDecl *CodeCompleteConsumer::OverloadCandidate::getFunction() const {}

const FunctionType *
CodeCompleteConsumer::OverloadCandidate::getFunctionType() const {}

const FunctionProtoTypeLoc
CodeCompleteConsumer::OverloadCandidate::getFunctionProtoTypeLoc() const {}

unsigned CodeCompleteConsumer::OverloadCandidate::getNumParams() const {}

QualType
CodeCompleteConsumer::OverloadCandidate::getParamType(unsigned N) const {}

const NamedDecl *
CodeCompleteConsumer::OverloadCandidate::getParamDecl(unsigned N) const {}

//===----------------------------------------------------------------------===//
// Code completion consumer implementation
//===----------------------------------------------------------------------===//

CodeCompleteConsumer::~CodeCompleteConsumer() = default;

bool PrintingCodeCompleteConsumer::isResultFilteredOut(
    StringRef Filter, CodeCompletionResult Result) {}

void PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(
    Sema &SemaRef, CodeCompletionContext Context, CodeCompletionResult *Results,
    unsigned NumResults) {}

// This function is used solely to preserve the former presentation of overloads
// by "clang -cc1 -code-completion-at", since CodeCompletionString::getAsString
// needs to be improved for printing the newer and more detailed overload
// chunks.
static std::string getOverloadAsString(const CodeCompletionString &CCS) {}

void PrintingCodeCompleteConsumer::ProcessOverloadCandidates(
    Sema &SemaRef, unsigned CurrentArg, OverloadCandidate *Candidates,
    unsigned NumCandidates, SourceLocation OpenParLoc, bool Braced) {}

/// Retrieve the effective availability of the given declaration.
static AvailabilityResult getDeclAvailability(const Decl *D) {}

void CodeCompletionResult::computeCursorKindAndAvailability(bool Accessible) {}

/// Retrieve the name that should be used to order a result.
///
/// If the name needs to be constructed as a string, that string will be
/// saved into Saved and the returned StringRef will refer to it.
StringRef CodeCompletionResult::getOrderedName(std::string &Saved) const {}

bool clang::operator<(const CodeCompletionResult &X,
                      const CodeCompletionResult &Y) {}