clang format, indent pp directives

This commit is contained in:
Ludovic Jozeau 2020-07-20 12:45:51 +02:00
parent cb08df44aa
commit 8bd9cf07ff
9 changed files with 55 additions and 54 deletions

View File

@ -1 +1,2 @@
BasedOnStyle: LLVM
IndentPPDirectives: AfterHash

View File

@ -119,7 +119,7 @@ buildCompilerInvocation(const std::string &main, std::vector<const char *> args,
const driver::JobList &jobs = comp->getJobs();
bool offload_compilation = false;
if (jobs.size() > 1) {
for (auto &a : comp->getActions()){
for (auto &a : comp->getActions()) {
// On MacOSX real actions may end up being wrapped in BindArchAction
if (isa<driver::BindArchAction>(a))
a = *a->input_begin();

View File

@ -687,7 +687,7 @@ public:
IndexDataConsumer(IndexParam &param) : param(param) {}
void initialize(ASTContext &ctx) override { this->ctx = param.ctx = &ctx; }
#if LLVM_VERSION_MAJOR < 10 // llvmorg-10-init-12036-g3b9715cb219
# define handleDeclOccurrence handleDeclOccurence
# define handleDeclOccurrence handleDeclOccurence
#endif
bool handleDeclOccurrence(const Decl *d, index::SymbolRoleSet roles,
ArrayRef<index::SymbolRelation> relations,
@ -885,10 +885,10 @@ public:
Usr usr1 = getUsr(d1, &info1);
IndexType &type1 = db->toType(usr1);
SourceLocation sl1 = d1->getLocation();
type1.def.spell = {
Use{{fromTokenRange(sm, lang, {sl1, sl1}), Role::Definition},
lid},
fromTokenRange(sm, lang, sr1)};
type1.def.spell = {Use{{fromTokenRange(sm, lang, {sl1, sl1}),
Role::Definition},
lid},
fromTokenRange(sm, lang, sr1)};
type1.def.detailed_name = intern(info1->short_name);
type1.def.short_name_size = int16_t(info1->short_name.size());
type1.def.kind = SymbolKind::TypeParameter;
@ -1208,7 +1208,7 @@ class IndexDiags : public DiagnosticConsumer {
public:
llvm::SmallString<64> message;
void HandleDiagnostic(DiagnosticsEngine::Level level,
const clang::Diagnostic &info) override {
const clang::Diagnostic &info) override {
DiagnosticConsumer::HandleDiagnostic(level, info);
if (message.empty())
info.FormatDiagnostic(message);

View File

@ -27,7 +27,7 @@
#include <shared_mutex>
#include <thread>
#ifndef _WIN32
#include <unistd.h>
# include <unistd.h>
#endif
using namespace llvm;
namespace chrono = std::chrono;

View File

@ -2,38 +2,38 @@
// SPDX-License-Identifier: Apache-2.0
#if defined(__unix__) || defined(__APPLE__)
#include "platform.hh"
# include "platform.hh"
#include "utils.hh"
# include "utils.hh"
#include <assert.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
# include <assert.h>
# include <limits.h>
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <time.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <signal.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/types.h> // required for stat.h
#include <sys/wait.h>
#include <unistd.h>
#ifdef __GLIBC__
#include <malloc.h>
#endif
# include <dirent.h>
# include <errno.h>
# include <fcntl.h>
# include <pthread.h>
# include <signal.h>
# include <sys/resource.h>
# include <sys/stat.h>
# include <sys/types.h> // required for stat.h
# include <sys/wait.h>
# include <unistd.h>
# ifdef __GLIBC__
# include <malloc.h>
# endif
#include <llvm/ADT/SmallString.h>
#include <llvm/Support/Path.h>
# include <llvm/ADT/SmallString.h>
# include <llvm/Support/Path.h>
#include <atomic>
#include <condition_variable>
#include <mutex>
#include <string>
# include <atomic>
# include <condition_variable>
# include <mutex>
# include <string>
namespace ccls {
namespace pipeline {
@ -47,9 +47,9 @@ std::string normalizePath(llvm::StringRef path) {
}
void freeUnusedMemory() {
#ifdef __GLIBC__
# ifdef __GLIBC__
malloc_trim(4 * 1024 * 1024);
#endif
# endif
}
void traceMe() {

View File

@ -2,21 +2,21 @@
// SPDX-License-Identifier: Apache-2.0
#if defined(_WIN32)
#include "platform.hh"
# include "platform.hh"
#include "utils.hh"
# include "utils.hh"
#include <Windows.h>
#include <direct.h>
#include <fcntl.h>
#include <io.h>
# include <Windows.h>
# include <direct.h>
# include <fcntl.h>
# include <io.h>
#include <sys/stat.h>
#include <sys/types.h>
# include <sys/stat.h>
# include <sys/types.h>
#include <algorithm>
#include <string>
#include <thread>
# include <algorithm>
# include <string>
# include <thread>
namespace ccls {
std::string normalizePath(llvm::StringRef path) {

View File

@ -25,9 +25,9 @@
#include <rapidjson/writer.h>
#ifdef _WIN32
#include <Windows.h>
# include <Windows.h>
#else
#include <unistd.h>
# include <unistd.h>
#endif
#include <array>

View File

@ -47,12 +47,12 @@ struct ProxyFileSystem : FileSystem {
std::error_code setCurrentWorkingDirectory(const Twine &Path) override {
return FS->setCurrentWorkingDirectory(Path);
}
#if LLVM_VERSION_MAJOR == 7
# if LLVM_VERSION_MAJOR == 7
std::error_code getRealPath(const Twine &Path,
SmallVectorImpl<char> &Output) const override {
return FS->getRealPath(Path, Output);
}
#endif
# endif
FileSystem &getUnderlyingFS() { return *FS; }
IntrusiveRefCntPtr<FileSystem> FS;
};

View File

@ -25,8 +25,8 @@
// The 'diff' utility is available and we can use dprintf(3).
#if _POSIX_C_SOURCE >= 200809L
#include <sys/wait.h>
#include <unistd.h>
# include <sys/wait.h>
# include <unistd.h>
#endif
using namespace llvm;