]> granicus.if.org Git - clang/commit
[Frontend] Fix printing policy for AST context loaded from file
authorVedant Kumar <vsk@apple.com>
Fri, 25 Aug 2017 18:07:03 +0000 (18:07 +0000)
committerVedant Kumar <vsk@apple.com>
Fri, 25 Aug 2017 18:07:03 +0000 (18:07 +0000)
commit66e630882c6ad48bce5a116b61b811fc4bc39926
treef3127c839e34bba5236a31c197ee47212d6e5d7f
parent6f135344102bde8d81237cef04ea3d4e1a1b8b46
[Frontend] Fix printing policy for AST context loaded from file

In ASTUnit::LoadFromASTFile, the context object is set up using
default-constructed LangOptions (which only later get populated). As the
language options are used in the constructor of PrintingPolicy, this
needs to be updated explicitly after the language options are available.

Patch by Johann Klähn!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311787 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Frontend/ASTUnit.cpp
unittests/Frontend/ASTUnitTest.cpp [new file with mode: 0644]
unittests/Frontend/CMakeLists.txt