Commit Graph

14 Commits

Author SHA1 Message Date
Eric Liu d4492e43e0 Fix an Index test caused by a clang-format change (r332436).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332465 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-16 12:58:13 +00:00
Daniel Jasper 469b6394c1 Fix Index test after recent clang-format change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293754 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-01 10:00:10 +00:00
Daniel Jasper 254708e7b8 Fix test failures after recent clang-format format change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292116 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 13:43:46 +00:00
Argyrios Kyrtzidis ab1d30c042 [libclang] Function templates can be 'overloaded' by return type, so encode the return type in the USR
and handle DependentNameType in order to be able to distinguish them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223628 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 08:48:11 +00:00
Daniel Jasper ae8699bde6 Several small changes in formatting decisions.
1. Use a hanging ident for function calls nested in binary expressions.
   E.g.:
   int aaaaa = aaaaaaaaa && aaaaaaaaaa(
                                aaaaaaaaaa);

2. Slightly improve heuristic for builder type expressions and reduce
   penalty for breaking before "." and "->" in those.

3. Remove  mostly obsolete metric of decreasing indent level. This
   fixes: llvm.org/PR14931.

Changes #1 and #2 were necessary to keep tests passing after #3.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173680 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 09:35:24 +00:00
Daniel Jasper 032f253295 Fix parsing of templated declarations.
Before: template <template <typename T>, typename P > class X;
After:  template <template <typename T>, typename P> class X;

More importantly, the token annotations for the second ">" are now computed
correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173047 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 14:39:22 +00:00
Daniel Jasper c79afdae8a Reduce penalty for splitting between ")" and ".".
').' is likely part of a builder pattern statement.
This is based upon a patch developed by Nico Weber. Thank you!

Before:
int foo() {
  return llvm::StringSwitch<Reference::Kind>(name).StartsWith(
      ".eh_frame_hdr", ORDER_EH_FRAMEHDR).StartsWith(
      ".eh_frame", ORDER_EH_FRAME).StartsWith(".init", ORDER_INIT).StartsWith(
      ".fini", ORDER_FINI).StartsWith(".hash", ORDER_HASH).Default(ORDER_TEXT);
}

After:
int foo() {
  return llvm::StringSwitch<Reference::Kind>(name)
         .StartsWith(".eh_frame_hdr", ORDER_EH_FRAMEHDR)
         .StartsWith(".eh_frame", ORDER_EH_FRAME)
         .StartsWith(".init", ORDER_INIT).StartsWith(".fini", ORDER_FINI)
         .StartsWith(".hash", ORDER_HASH).Default(ORDER_TEXT);
}

Probably not ideal, but makes many cases much more readable.

The changes to overriding-ftemplate-comments.cpp don't seem better or
worse. We should address those soon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172804 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 10:56:38 +00:00
Manuel Klimek d4397b99e2 Various fixes to clang-format's macro handling.
Some of this is still pretty rough (note the load of FIXMEs), but it is
strictly an improvement and fixes various bugs that were related to
macro processing but are also imporant in non-macro use cases.

Specific fixes:
- correctly puts espaced newlines at the end of the line
- fixes counting of white space before a token when escaped newlines are
  present
- fixes parsing of "trailing" tokens when eof() is hit
- puts macro parsing orthogonal to parsing other structure
- general support for parsing of macro definitions

Due to the fix to format trailing tokens, this change also includes a
bunch of fixes to the c-index tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171556 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 23:34:14 +00:00
Dmitri Gribenko e60729a17c Testcase overriding-ftemplate-comments.cpp: use [[@LINE]] to make it less fragile.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168213 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-16 22:34:07 +00:00
Dmitri Gribenko 6b2d7c7386 Un-XFAIL some tests for comment to XML conversion. This reverts r166151 and
fixes the tests for builds without libxml2.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166179 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18 14:33:01 +00:00
Fariborz Jahanian 07c90ede80 XFAIL these tests until I can figure out what is going on on
other platforms.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166151 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17 23:25:40 +00:00
Fariborz Jahanian 1bfb00dabf [Doc parsing]: This patch adds <Declaration> tag to
XML comment for declarations which pretty-prints
declaration. I had to XFAIL one test annotate-comments.cpp.
This test is currently unmaintainable as written.
Dmitri G., can you see what we can do about this test.
We should change this test such that adding a new tag does not wreck
havoc to the test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166130 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17 21:58:03 +00:00
Fariborz Jahanian 88d285cc0f Fixes location of overriding declaration with no comment
of their own.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165972 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 20:57:52 +00:00
Fariborz Jahanian 6553c686cb structured document comment: patch to provide comment for overriding function
template when comment is comming from overridden declaration. 
// rdar://12378793


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165953 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 18:58:50 +00:00