]> granicus.if.org Git - clang/commit
[libclang] Add PrintingPolicy for pretty printing declarations
authorJonathan Coe <jbcoe@me.com>
Tue, 16 Jan 2018 10:19:56 +0000 (10:19 +0000)
committerJonathan Coe <jbcoe@me.com>
Tue, 16 Jan 2018 10:19:56 +0000 (10:19 +0000)
commit377ea9a1a8d0d3d4a4113468e2e55e86474d5c5b
tree1b0c3433df6b94efc625d354beb3481cc892201a
parent5a18d2f1fc25509646440ab21963781c7e9b494c
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322540 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang-c/Index.h
test/Index/print-display-names.cpp
tools/c-index-test/c-index-test.c
tools/libclang/CIndex.cpp
tools/libclang/libclang.exports
unittests/libclang/LibclangTest.cpp