llvm/clang-tools-extra/clangd/DecisionForest.cpp

//===--- DecisionForest.cpp --------------------------------------*- C++-*-===//
//
// 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
//
//===----------------------------------------------------------------------===//

#include "Features.inc"

#if !CLANGD_DECISION_FOREST
#include "Quality.h"
#include <cstdlib>

namespace clang {
namespace clangd {
DecisionForestScores
evaluateDecisionForest(const SymbolQualitySignals &Quality,
                       const SymbolRelevanceSignals &Relevance, float Base) {
  llvm::errs() << "Clangd was compiled without decision forest support.\n";
  std::abort();
}

} // namespace clangd
} // namespace clang

#else // !CLANGD_DECISION_FOREST

#include "CompletionModel.h"
#include "Quality.h"
#include <cmath>

namespace clang {
namespace clangd {

DecisionForestScores
evaluateDecisionForest(const SymbolQualitySignals &Quality,
                       const SymbolRelevanceSignals &Relevance, float Base) {}

} // namespace clangd
} // namespace clang

#endif // !CLANGD_DECISION_FOREST