Changeset View
Changeset View
Standalone View
Standalone View
languages/clang/tests/minimal_visitor.cpp
Show All 30 Lines | 26 | { | |||
---|---|---|---|---|---|
31 | unsigned startLine, startColumn; | 31 | unsigned startLine, startColumn; | ||
32 | clang_getSpellingLocation(start, &file, &startLine, &startColumn, nullptr); | 32 | clang_getSpellingLocation(start, &file, &startLine, &startColumn, nullptr); | ||
33 | unsigned endLine, endColumn; | 33 | unsigned endLine, endColumn; | ||
34 | clang_getSpellingLocation(end, nullptr, &endLine, &endColumn, nullptr); | 34 | clang_getSpellingLocation(end, nullptr, &endLine, &endColumn, nullptr); | ||
35 | 35 | | |||
36 | auto str = clang_getCursorSpelling(cursor); | 36 | auto str = clang_getCursorSpelling(cursor); | ||
37 | auto fileStr = clang_getFileName(file); | 37 | auto fileStr = clang_getFileName(file); | ||
38 | auto typeStr = clang_getCursorKindSpelling(cursor.kind); | 38 | auto typeStr = clang_getCursorKindSpelling(cursor.kind); | ||
39 | printf("\"%s\" [(%d, %d), (%d, %d)] in %s | %s\n", clang_getCString(str), | 39 | printf("\"%s\" [(%u, %u), (%u, %u)] in %s | %s\n", clang_getCString(str), | ||
40 | startLine, startColumn, endLine, endColumn, | 40 | startLine, startColumn, endLine, endColumn, | ||
41 | clang_getCString(fileStr), clang_getCString(typeStr)); | 41 | clang_getCString(fileStr), clang_getCString(typeStr)); | ||
42 | 42 | | |||
43 | clang_disposeString(str); | 43 | clang_disposeString(str); | ||
44 | clang_disposeString(fileStr); | 44 | clang_disposeString(fileStr); | ||
45 | clang_disposeString(typeStr); | 45 | clang_disposeString(typeStr); | ||
46 | return CXChildVisit_Recurse; | 46 | return CXChildVisit_Recurse; | ||
47 | } | 47 | } | ||
Show All 15 Lines |