diff --git a/libclangmm/Diagnostic.h b/libclangmm/Diagnostic.h index 7c6fa571..fadb5989 100644 --- a/libclangmm/Diagnostic.h +++ b/libclangmm/Diagnostic.h @@ -1,7 +1,6 @@ #if false +#pragma once -#ifndef DIAGNOSTIC_H_ -#define DIAGNOSTIC_H_ #include #include #include @@ -10,16 +9,16 @@ namespace clang { class Diagnostic { +public: friend class TranslationUnit; Diagnostic(CXTranslationUnit& cx_tu, CXDiagnostic& cx_diagnostic); -public: - class FixIt { - public: - FixIt(const std::string &source, const std::pair &offsets) : - source(source), offsets(offsets) {} - std::string source; - std::pair offsets; - }; + //class FixIt { + //public: + // FixIt(const std::string &source, const std::pair &offsets) : + // source(source), offsets(offsets) {} + // std::string source; + // std::pair offsets; + //}; static const std::string get_severity_spelling(unsigned severity); @@ -32,6 +31,4 @@ public: }; } -#endif // DIAGNOSTIC_H_ - #endif \ No newline at end of file diff --git a/libclangmm/TranslationUnit.cc b/libclangmm/TranslationUnit.cc index 207e1d2e..8716bed6 100644 --- a/libclangmm/TranslationUnit.cc +++ b/libclangmm/TranslationUnit.cc @@ -7,11 +7,12 @@ namespace clang { + /* TranslationUnit::TranslationUnit(Index &index, const std::string &file_path, const std::vector &command_line_args, const std::string &buffer, unsigned flags) { std::vector args; - for (auto &a : command_line_args) { + for (auto& a : command_line_args) { args.push_back(a.c_str()); } @@ -24,6 +25,7 @@ TranslationUnit::TranslationUnit(Index &index, const std::string &file_path, index.cx_index, file_path.c_str(), args.data(), args.size(), files, 1, flags, &cx_tu); assert(!error_code); } +*/ TranslationUnit::TranslationUnit(Index &index, const std::string &file_path, const std::vector &command_line_args, unsigned flags) { @@ -31,7 +33,7 @@ TranslationUnit::TranslationUnit(Index &index, const std::string &file_path, // TODO: only push defines for the time being. Might need to pass more flags. std::vector args; for (const std::string& a : command_line_args) { - if (a.size() >= 2 && a[0] == '-' && a[1] == 'D') + //if (a.size() >= 2 && a[0] == '-' && a[1] == 'D') args.push_back(a.c_str()); } diff --git a/libclangmm/TranslationUnit.h b/libclangmm/TranslationUnit.h index 8695374e..8f82172a 100644 --- a/libclangmm/TranslationUnit.h +++ b/libclangmm/TranslationUnit.h @@ -14,11 +14,11 @@ namespace clang { class TranslationUnit { public: - TranslationUnit(Index &index, - const std::string &file_path, - const std::vector &command_line_args, - const std::string &buffer, - unsigned flags=DefaultFlags()); + //TranslationUnit(Index &index, + // const std::string &file_path, + // const std::vector &command_line_args, + // const std::string &buffer, + // unsigned flags=DefaultFlags()); TranslationUnit(Index &index, const std::string &file_path, const std::vector &command_line_args,