[PATCH] D96740: IR: Rename Metadata::ImplicitCode to SubclassData1, NFC
Duncan P. N. Exon Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 15 17:51:12 PST 2021
dexonsmith created this revision.
dexonsmith added reviewers: aprantl, calixte.
dexonsmith requested review of this revision.
Herald added a project: LLVM.
Metadata::ImplicitCode is a bit shaved off of Metadata::Storage,
currently only in use by the subclass DILocation. However, the bit isn't
reserved for that purpose. Rename it `SubclassData1` to make it clear
that it has nothing to do with Metadata itself (and other subclasses are
free to use it).
As a drive-by, remove an old TODO about exposing bits to subclasses
(looks like that has mostly been done).
No functionality change here.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D96740
Files:
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/include/llvm/IR/Metadata.h
Index: llvm/include/llvm/IR/Metadata.h
===================================================================
--- llvm/include/llvm/IR/Metadata.h
+++ llvm/include/llvm/IR/Metadata.h
@@ -67,10 +67,8 @@
/// Storage flag for non-uniqued, otherwise unowned, metadata.
unsigned char Storage : 7;
- // TODO: expose remaining bits to subclasses.
-
- unsigned char ImplicitCode : 1;
+ unsigned char SubclassData1 : 1;
unsigned short SubclassData16 = 0;
unsigned SubclassData32 = 0;
@@ -82,7 +80,7 @@
protected:
Metadata(unsigned ID, StorageType Storage)
- : SubclassID(ID), Storage(Storage), ImplicitCode(false) {
+ : SubclassID(ID), Storage(Storage), SubclassData1(false) {
static_assert(sizeof(*this) == 8, "Metadata fields poorly packed");
}
Index: llvm/include/llvm/IR/DebugInfoMetadata.h
===================================================================
--- llvm/include/llvm/IR/DebugInfoMetadata.h
+++ llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -1643,8 +1643,8 @@
/// written explicitly by the user (e.g. cleanup stuff in C++ put on a closing
/// bracket). It's useful for code coverage to not show a counter on "empty"
/// lines.
- bool isImplicitCode() const { return ImplicitCode; }
- void setImplicitCode(bool ImplicitCode) { this->ImplicitCode = ImplicitCode; }
+ bool isImplicitCode() const { return SubclassData1; }
+ void setImplicitCode(bool ImplicitCode) { SubclassData1 = ImplicitCode; }
DIFile *getFile() const { return getScope()->getFile(); }
StringRef getFilename() const { return getScope()->getFilename(); }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96740.323853.patch
Type: text/x-patch
Size: 1591 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210216/7c5a5c35/attachment.bin>
More information about the llvm-commits
mailing list