Browse Source

Last forward declaration gone.

merge-requests/37/head
eidheim 11 years ago
parent
commit
9714ebfc93
  1. 1
      src/CompilationDatabase.h
  2. 5
      src/CompileCommand.cc
  3. 4
      src/CompileCommand.h
  4. 2
      src/CompileCommands.cc
  5. 2
      src/Cursor.h
  6. 2
      src/SourceLocation.h
  7. 2
      src/SourceRange.h

1
src/CompilationDatabase.h

@ -5,7 +5,6 @@
#include <string> #include <string>
namespace clang { namespace clang {
class CompileCommands;
class CompilationDatabase { class CompilationDatabase {
public: public:
explicit CompilationDatabase(const std::string &project_path); explicit CompilationDatabase(const std::string &project_path);

5
src/CompileCommand.cc

@ -1,11 +1,6 @@
#include "CompileCommand.h" #include "CompileCommand.h"
#include "CompileCommands.h" #include "CompileCommands.h"
clang::CompileCommand::
CompileCommand(int nth, clang::CompileCommands &commands) {
cx_command = clang_CompileCommands_getCommand(commands.cx_commands, nth);
}
std::string clang::CompileCommand:: std::string clang::CompileCommand::
get_command() { get_command() {
std::string res; std::string res;

4
src/CompileCommand.h

@ -1,12 +1,12 @@
#ifndef COMPILECOMMAND_H_ #ifndef COMPILECOMMAND_H_
#define COMPILECOMMAND_H_ #define COMPILECOMMAND_H_
#include "CompilationDatabase.h" #include <clang-c/CXCompilationDatabase.h>
#include <vector> #include <vector>
namespace clang { namespace clang {
class CompileCommand { class CompileCommand {
public: public:
CompileCommand(int nth, CompileCommands &commands); CompileCommand(const CXCompileCommand& cx_command) : cx_command(cx_command) {};
std::string get_command(); std::string get_command();
std::vector<std::string> get_command_as_args(); std::vector<std::string> get_command_as_args();

2
src/CompileCommands.cc

@ -18,7 +18,7 @@ get_commands() {
unsigned N = clang_CompileCommands_getSize(cx_commands); unsigned N = clang_CompileCommands_getSize(cx_commands);
std::vector<clang::CompileCommand> res; std::vector<clang::CompileCommand> res;
for (unsigned i = 0; i < N; i++) { for (unsigned i = 0; i < N; i++) {
res.emplace_back(clang::CompileCommand(i, *this)); res.emplace_back(clang_CompileCommands_getCommand(cx_commands, i));
} }
return res; return res;
} }

2
src/Cursor.h

@ -175,7 +175,7 @@ namespace clang {
class Cursor { class Cursor {
public: public:
Cursor(CXCursor cx_cursor) : cx_cursor(cx_cursor) {} Cursor(const CXCursor &cx_cursor) : cx_cursor(cx_cursor) {}
Cursor(CXTranslationUnit &cx_tu, SourceLocation &source_location); Cursor(CXTranslationUnit &cx_tu, SourceLocation &source_location);
const CursorKind get_kind(); const CursorKind get_kind();
SourceLocation get_source_location() const; SourceLocation get_source_location() const;

2
src/SourceLocation.h

@ -7,7 +7,7 @@ namespace clang {
class SourceLocation { class SourceLocation {
public: public:
SourceLocation(CXSourceLocation cx_location) : cx_location(cx_location) {} SourceLocation(const CXSourceLocation& cx_location) : cx_location(cx_location) {}
SourceLocation(CXTranslationUnit &cx_tu, SourceLocation(CXTranslationUnit &cx_tu,
const std::string &filename, const std::string &filename,

2
src/SourceRange.h

@ -13,7 +13,7 @@ namespace clang {
class SourceRange { class SourceRange {
public: public:
SourceRange(CXSourceRange cx_range) : cx_range(cx_range) {} SourceRange(const CXSourceRange& cx_range) : cx_range(cx_range) {}
SourceRange(SourceLocation &start, SourceLocation &end); SourceRange(SourceLocation &start, SourceLocation &end);
std::pair<SourceLocation, SourceLocation> get_source_locations(); std::pair<SourceLocation, SourceLocation> get_source_locations();
static RangeData get_range_data(SourceLocation &start, SourceLocation &end); static RangeData get_range_data(SourceLocation &start, SourceLocation &end);

Loading…
Cancel
Save