Clang
view release on metacpan or search on metacpan
xs/Cursor.xs view on Meta::CPAN
void
location(self)
Cursor self
INIT:
CXFile file;
const char *filename;
unsigned int line, line_end, col, col_end, offset;
PPCODE:
CXSourceLocation loc = clang_getCursorLocation(*self);
CXSourceRange range = clang_getCursorExtent(*self);
CXSourceLocation end = clang_getRangeEnd(range);
clang_getSpellingLocation(loc, &file, &line, &col, NULL);
clang_getSpellingLocation(end, NULL, &line_end, &col_end, NULL);
filename = clang_getCString(clang_getFileName(file));
xs/Diagnostic.xs view on Meta::CPAN
void
location(self)
Diagnostic self
INIT:
CXFile file;
const char *filename;
unsigned int line, column, offset;
PPCODE:
CXSourceLocation loc = clang_getDiagnosticLocation(self);
clang_getSpellingLocation(loc, &file, &line, &column, NULL);
filename = clang_getCString(clang_getFileName(file));
if (filename != NULL)
mXPUSHp(filename, strlen(filename));
else
mXPUSHp("", 0);
( run in 0.849 second using v1.01-cache-2.11-cpan-71847e10f99 )