Remove clang-c dependency from command_line.cc

This commit is contained in:
Jacob Dufault 2017-04-16 14:51:47 -07:00
parent c0fb407447
commit 741e357053
3 changed files with 9 additions and 6 deletions

View File

@ -15,7 +15,6 @@
#include "typed_bidi_message_queue.h"
#include "working_files.h"
#include <clang-c/Index.h>
#include <doctest/doctest.h>
#include <rapidjson/istreamwrapper.h>
#include <rapidjson/ostreamwrapper.h>
@ -1877,17 +1876,14 @@ void LanguageServerMain() {
int main(int argc, char** argv) {
// TODO: Move to IndexInit(), remove clang-c include.
clang_enableStackTraces();
clang_toggleCrashRecovery(1);
//bool loop = true;
//while (loop)
// std::this_thread::sleep_for(std::chrono::milliseconds(10));
//std::this_thread::sleep_for(std::chrono::seconds(3));
PlatformInit();
IndexInit();
RegisterMessageTypes();
// if (argc == 1) {

View File

@ -1464,3 +1464,9 @@ std::vector<std::unique_ptr<IndexedFile>> Parse(FileConsumer::SharedState* file_
}
return result;
}
void IndexInit() {
clang_enableStackTraces();
clang_toggleCrashRecovery(1);
}

View File

@ -455,3 +455,4 @@ struct IndexedFile {
};
std::vector<std::unique_ptr<IndexedFile>> Parse(FileConsumer::SharedState* file_consumer_shared, std::string filename, std::vector<std::string> args, bool dump_ast = false);
void IndexInit();