Browse Source

Removed unneeded const return qualifiers, replaced a couple old c-casts, and updated FindLibClang.cmake

merge-requests/37/head
eidheim 10 years ago
parent
commit
6a9f24ac29
  1. 6
      cmake/Modules/FindLibClang.cmake
  2. 4
      src/Cursor.cc
  3. 2
      src/Cursor.h
  4. 4
      src/Token.cc
  5. 2
      src/Token.h

6
cmake/Modules/FindLibClang.cmake

@ -14,7 +14,11 @@
# Known LLVM release numbers.
# most recent versions come first
set(LIBCLANG_KNOWN_LLVM_VERSIONS 3.7
set(LIBCLANG_KNOWN_LLVM_VERSIONS 3.9
3.8.1
3.8
3.7.1
3.7
3.6.2
3.6.1
3.6

4
src/Cursor.cc

@ -2,8 +2,8 @@
#include "Utility.h"
#include <algorithm>
const clang::CursorKind clang::Cursor::get_kind() {
return (CursorKind) clang_getCursorKind(this->cx_cursor);
clang::CursorKind clang::Cursor::get_kind() {
return static_cast<CursorKind>(clang_getCursorKind(this->cx_cursor));
}
clang::SourceLocation clang::Cursor::get_source_location() const {

2
src/Cursor.h

@ -177,7 +177,7 @@ namespace clang {
class Cursor {
public:
Cursor(const CXCursor &cx_cursor) : cx_cursor(cx_cursor) {}
const CursorKind get_kind();
CursorKind get_kind();
SourceLocation get_source_location() const;
SourceRange get_source_range() const;
std::string get_spelling() const;

4
src/Token.cc

@ -20,6 +20,6 @@ std::string clang::Token::get_spelling() {
return clang::to_string(clang_getTokenSpelling(cx_tu, cx_token));
}
const clang::TokenKind clang::Token::get_kind() {
return (TokenKind) clang_getTokenKind(cx_token);
clang::TokenKind clang::Token::get_kind() {
return static_cast<TokenKind>(clang_getTokenKind(cx_token));
}

2
src/Token.h

@ -20,7 +20,7 @@ namespace clang {
Token(CXTranslationUnit &cx_tu, CXToken &cx_token, CXCursor &cx_cursor):
cx_tu(cx_tu), cx_token(cx_token), cx_cursor(cx_cursor), offsets(get_source_range().get_offsets()) {};
public:
const TokenKind get_kind();
TokenKind get_kind();
std::string get_spelling();
SourceLocation get_source_location();
SourceRange get_source_range();

Loading…
Cancel
Save