[llvm] 949f564 - [IR] Use default member initialization in GlobalValue (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 6 16:36:49 PST 2022


Author: Kazu Hirata
Date: 2022-02-06T16:36:29-08:00
New Revision: 949f56465bfe119174febe3be37668c88ec6da7c

URL: https://github.com/llvm/llvm-project/commit/949f56465bfe119174febe3be37668c88ec6da7c
DIFF: https://github.com/llvm/llvm-project/commit/949f56465bfe119174febe3be37668c88ec6da7c.diff

LOG: [IR] Use default member initialization in GlobalValue (NFC)

Added: 
    

Modified: 
    llvm/include/llvm/IR/GlobalValue.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/GlobalValue.h b/llvm/include/llvm/IR/GlobalValue.h
index 1818f2a8f3ccb..f704b1c9e7954 100644
--- a/llvm/include/llvm/IR/GlobalValue.h
+++ b/llvm/include/llvm/IR/GlobalValue.h
@@ -79,8 +79,7 @@ class GlobalValue : public Constant {
         ValueType(Ty), Visibility(DefaultVisibility),
         UnnamedAddrVal(unsigned(UnnamedAddr::None)),
         DllStorageClass(DefaultStorageClass), ThreadLocal(NotThreadLocal),
-        HasLLVMReservedName(false), IsDSOLocal(false), HasPartition(false),
-        IntID((Intrinsic::ID)0U), Parent(nullptr) {
+        HasLLVMReservedName(false), IsDSOLocal(false), HasPartition(false) {
     setLinkage(Linkage);
     setName(Name);
   }
@@ -153,7 +152,7 @@ class GlobalValue : public Constant {
   /// Subclasses can use it to store their intrinsic ID, if they have one.
   ///
   /// This is stored here to save space in Function on 64-bit hosts.
-  Intrinsic::ID IntID;
+  Intrinsic::ID IntID = (Intrinsic::ID)0U;
 
   unsigned getGlobalValueSubClassData() const {
     return SubClassData;
@@ -163,7 +162,7 @@ class GlobalValue : public Constant {
     SubClassData = V;
   }
 
-  Module *Parent;             // The containing module.
+  Module *Parent = nullptr; // The containing module.
 
   // Used by SymbolTableListTraits.
   void setParent(Module *parent) {


        


More information about the llvm-commits mailing list