Commit Graph

20 Commits

Author SHA1 Message Date
Nathan Ridge 9cfec72ffe [clang] Refactor AST printing tests to share more infrastructure
Differential Revision: https://reviews.llvm.org/D105457
2021-07-14 19:44:18 -04:00
David Green 40ce58d0ca Revert "[clang] Refactor AST printing tests to share more infrastructure"
This reverts commit 20176bc7dd as some
versions of GCC do not seem to handle the new code very well. They
complain about:

/tmp/ccqUQZyw.s: Assembler messages:
/tmp/ccqUQZyw.s:1151: Error: symbol `_ZNSt14_Function_base13_Base_managerIN5clangUlPKNS1_4StmtEE2_EE10_M_managerERSt9_Any_dataRKS7_St18_Manager_operation' is already defined
/tmp/ccqUQZyw.s:11963: Error: symbol `_ZNSt17_Function_handlerIFbPKN5clang4StmtEENS0_UlS3_E2_EE9_M_invokeERKSt9_Any_dataOS3_' is already defined

This seems like it is some GCC issue, but multiple buildbots (and my
local machine) are all failing because of it.
2021-07-14 04:40:47 +01:00
Nathan Ridge 20176bc7dd [clang] Refactor AST printing tests to share more infrastructure
Differential Revision: https://reviews.llvm.org/D105457
2021-07-13 01:48:30 -04:00
Haojian Wu 6f56599c14 [AST] Fix the PrintQualifiedName for ObjC instance variable in class extension.
Summary:
Similar to property, we print the containing interface decl as the
nested name specifier for ivar; otherwise we will get "::ivar_name".

this would fix an assertion crash in clangd: https://github.com/clangd/clangd/issues/365

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79576
2020-05-19 15:17:36 +02:00
Benjamin Kramer 4e3f4f03f3 [ASTMatchers] StringRef'ify hasName
This was just inconvenient, and we make a copy anyways.
2020-01-29 10:53:08 +01:00
Benjamin Kramer adcd026838 Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with
std::string_view. There should be no functional change here.

This is mostly mechanical from a custom clang-tidy check, with a lot of
manual fixups. It uncovers a lot of minor inefficiencies.

This doesn't actually modify StringRef yet, I'll do that in a follow-up.
2020-01-28 23:25:25 +01:00
Ilya Biryukov 6648223faf Re-land r372863: [AST] Extract Decl::printNestedNameSpecifier helper from Decl::printQualifiedName
Reverted in r372880 due to the test failure.
Also contains a fix that adjusts printQualifiedName to return the same results as before in
case of anonymous function locals and parameters.

llvm-svn: 372889
2019-09-25 15:46:04 +00:00
Ilya Biryukov 71472a3eec Revert r372863: [AST] Extract Decl::printNestedNameSpecifier helper from Decl::printQualifiedName
Reason: causes a test failure, will investigate and re-land with a fix.
llvm-svn: 372880
2019-09-25 14:50:12 +00:00
Ilya Biryukov 1e36ed7fbc [AST] Extract Decl::printNestedNameSpecifier helper from Decl::printQualifiedName
Summary:
To be used in clangd, e.g. in D66647.
Currently the alternative to this function is doing string manipulation on results of `printQualifiedName`, which is
hard-to-impossible to get right in presence of template arguments.

Reviewers: kadircet, aaron.ballman

Reviewed By: kadircet, aaron.ballman

Subscribers: aaron.ballman, usaxena95, cfe-commits

Tags: #clang

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

llvm-svn: 372863
2019-09-25 13:09:10 +00:00
David Goldman 4af5d748ce Fix error in NamedDeclPrinterTest
Caused by D56924, shouldn't use raw string literals in macros.

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

llvm-svn: 357799
2019-04-05 19:17:24 +00:00
David Goldman 19d21854e9 Special case ObjCPropertyDecl for printing
ObjCPropertyDecl should use the category interface as a context similar to what is done for methods.

Previously category methods would be printed as `::property`; now they are printed as `Class::property`.

llvm-svn: 357720
2019-04-04 20:13:22 +00:00
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Sam McCall 34f9d3fe2a [AST] namespace ns { extern "C" { int X; }} prints as "ns::X", not as "X"
llvm-svn: 324081
2018-02-02 13:34:47 +00:00
Paul Robinson f183848ace [AST] Incorrectly qualified unscoped enumeration as template actual parameter.
An unscoped enumeration used as template argument, should not have any
qualified information about its enclosing scope, as its visibility is
global.

In the case of scoped enumerations, they must include information
about their enclosing scope.

Patch by Carlos Alberto Enciso!

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

llvm-svn: 321312
2017-12-21 21:47:22 +00:00
Alexander Kornienko 4f35532dbe Adjust printQualifiedName to handle unscoped enums in a way similar to anonymous namespaces.
Patch by Sterling Augustine!

Differential revision: http://reviews.llvm.org/D14459

llvm-svn: 252488
2015-11-09 16:45:17 +00:00
Alexander Kornienko 34eb20725d Use 'override/final' instead of 'virtual' for overridden methods
Summary:
The patch is generated using clang-tidy misc-use-override check.

This command was used:

  tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
    -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D8926

llvm-svn: 234678
2015-04-11 02:00:23 +00:00
David Blaikie 6beb6aa8f0 Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325)
After post-commit review and community discussion, this seems like a
reasonable direction to continue, making ownership semantics explicit in
the source using the type system.

llvm-svn: 215323
2014-08-10 19:56:51 +00:00
David Blaikie 62a56f39b7 Revert "unique_ptr-ify ownership of ASTConsumers"
This reverts commit r213307.

Reverting to have some on-list discussion/confirmation about the ongoing
direction of smart pointer usage in the LLVM project.

llvm-svn: 213325
2014-07-17 22:34:12 +00:00
David Blaikie a51666a4d6 unique_ptr-ify ownership of ASTConsumers
(after fixing a bug in MultiplexConsumer I noticed the ownership of the
nested consumers was implemented with raw pointers - so this fixes
that... and follows the source back to its origin pushing unique_ptr
ownership up through there too)

llvm-svn: 213307
2014-07-17 20:40:36 +00:00
Richard Smith 46dd5bba44 Take PrintingPolicy::SuppressUnwrittenScope into account when printing the
qualified name of a NamedDecl. Patch by Volodymyr Sapsai!

llvm-svn: 209924
2014-05-30 22:16:51 +00:00