You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
604 B

#include "source_range.hpp"
clangmm::SourceRange::SourceRange(const clangmm::SourceLocation &start, const clangmm::SourceLocation &end) {
cx_range = clang_getRange(start.cx_location, end.cx_location);
}
clangmm::SourceLocation clangmm::SourceRange::get_start() const {
return SourceLocation(clang_getRangeStart(cx_range));
}
clangmm::SourceLocation clangmm::SourceRange::get_end() const {
return SourceLocation(clang_getRangeEnd(cx_range));
}
std::pair<clangmm::Offset, clangmm::Offset> clangmm::SourceRange::get_offsets() const {
return {get_start().get_offset(), get_end().get_offset()};
}