16 Commits

Author SHA1 Message Date
Rahul Joshi
63aa8cf6be
[NFC][Clang][TableGen] Fix file header comments (#116491) 2024-11-17 07:54:10 -08:00
Kazu Hirata
a8a1e9033a
[TableGen] Remove unused includes (NFC) (#116168)
Identified with misc-include-cleaner.
2024-11-14 07:55:34 -08:00
Rahul Joshi
0e948bfd31
[NFC][clang][TableGen] Remove redundant llvm:: namespace qualifier (#108627)
Remove llvm:: from .cpp files, and add "using namespace llvm" if needed.
2024-09-16 06:35:34 -07:00
Rahul Joshi
3c9db3a627
[clang][TableGen] Change ASTProperties Emitter to use const RecordKeeper (#108274)
Change ASTProperties Emitter to use const RecordKeeper.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-12 18:37:41 -07:00
Rahul Joshi
c98d6c2e42
[NFC] Reformat ClangASTPropertiesEmitter ASTPropsEmitter class (#108275) 2024-09-11 15:29:02 -07:00
Shao-Ce SUN
b0e28eb832
[llvm][tblgen] Add Source Filename for emitSourceFileHeader (#65744)
I think this is very helpful for reading generated `.inc` files.
2023-09-26 13:40:56 +08:00
Kazu Hirata
6ad0788c33 [clang] Use std::optional instead of llvm::Optional (NFC)
This patch replaces (llvm::|)Optional< with std::optional<.  I'll post
a separate patch to remove #include "llvm/ADT/Optional.h".

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2023-01-14 12:31:01 -08:00
Kazu Hirata
a1580d7b59 [clang] Add #include <optional> (NFC)
This patch adds #include <optional> to those files containing
llvm::Optional<...> or Optional<...>.

I'll post a separate patch to actually replace llvm::Optional with
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2023-01-14 11:07:21 -08:00
Kazu Hirata
dccfaddc6b [clang] Use StringRef::contains (NFC) 2021-10-21 08:58:19 -07:00
Varun Gandhi
37e83bc6db [NFC] Move readAPValue/writeAPValue up the inheritance hierarchy
The implementation for (de)serialization of APValues can be shared
between Clang and Swift, so we prefer pushing the methods up
the inheritance hierarchy, instead of having the methods live in
ASTReader/ASTWriter. Fixes rdar://72592937.

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D94196
2021-01-06 16:44:50 -08:00
John McCall
b699fe8b95 Forward {read,write}SomeEnumType to {read,write}Enum instead of
directly to {read,write}UInt32.

This will be useful for textual formats.  NFC.
2019-12-16 13:34:00 -05:00
John McCall
6887ccfcf2 Add the ability for properties to be conditional on other properties.
This will be required by TemplateName.
2019-12-16 13:34:00 -05:00
John McCall
256ec99644 Add the ability to declare helper variables when reading
properties from a value.

This is useful when the properties of a case are actually
read out of a specific structure, as with TemplateName.
2019-12-16 13:34:00 -05:00
John McCall
efd0dfbd70 Add the ability to use property-based serialization for "cased" types.
This patch doesn't actually use this serialization for anything,
but follow-ups will move the current handling of various standard
types over to this.
2019-12-16 13:33:59 -05:00
John McCall
00bc76eddd Move Basic{Reader,Writer} emission into ASTPropsEmitter; NFC.
I'm going to introduce some uses of the property read/write methods.
2019-12-16 13:33:59 -05:00
John McCall
6404bd2362 Abstract serialization: TableGen "basic" reader/writer CRTP
classes that serialize basic values
2019-12-14 00:16:48 -05:00