HomePhabricator

[libclang] Add PrintingPolicy for pretty printing declarations

Description

[libclang] Add PrintingPolicy for pretty printing declarations

Summary:
Introduce clang_getCursorPrettyPrinted() for pretty printing
declarations. Expose also PrintingPolicy, so the user gets more
fine-grained control of the entities being printed.

The already existing clang_getCursorDisplayName() is pretty limited -
for example, it does not handle return types, parameter names or default
arguments for function declarations. Addressing these issues in
clang_getCursorDisplayName() would mean to duplicate existing code
(e.g. clang::DeclPrinter), so rather expose new API to access the
existing functionality.

Reviewed By: jbcoe

Subscribers: cfe-commits

Tags: #clang

Patch by nik (Nikolai Kosjar)

Differential Revision: https://reviews.llvm.org/D39903

Details

Committed
jbcoeJan 16 2018, 2:19 AM
Reviewer
jbcoe
Differential Revision
D39903: [libclang] Allow pretty printing declarations
Parents
rL322539: Merging r322518:
Branches
Unknown
Tags
Unknown