reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

Declarations

include/llvm/Analysis/MemoryBuiltins.h
   41 class GlobalVariable;
include/llvm/Analysis/ValueLatticeUtils.h
   20 class GlobalVariable;
include/llvm/CodeGen/AsmPrinter.h
   49 class GlobalVariable;
include/llvm/CodeGen/WinEHFuncInfo.h
   29 class GlobalVariable;
include/llvm/ExecutionEngine/ExecutionEngine.h
   48 class GlobalVariable;
include/llvm/ExecutionEngine/Orc/ExecutionUtils.h
   33 class GlobalVariable;
include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
   41 class GlobalVariable;
include/llvm/IR/AutoUpgrade.h
   25   class GlobalVariable;
include/llvm/IR/DataLayout.h
   43 class GlobalVariable;
include/llvm/IR/SymbolTableListTraits.h
   38 class GlobalVariable;
include/llvm/IR/Value.h
   42 class GlobalVariable;
include/llvm/IR/ValueSymbolTable.h
   28 class GlobalVariable;
include/llvm/ProfileData/InstrProf.h
   49 class GlobalVariable;
include/llvm/Transforms/IPO/WholeProgramDevirt.h
   31 class GlobalVariable;
include/llvm/Transforms/Scalar/ConstantHoisting.h
   58 class GlobalVariable;
include/llvm/Transforms/Utils/CtorUtils.h
   20 class GlobalVariable;
include/llvm/Transforms/Utils/ModuleUtils.h
   26 class GlobalVariable;
include/llvm/Transforms/Utils/ValueMapper.h
   26 class GlobalVariable;
lib/CodeGen/AsmPrinter/CodeViewDebug.h
   45 class GlobalVariable;
lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
   38 class GlobalVariable;
lib/Target/ARM/ARMConstantPoolValue.h
   29 class GlobalVariable;
lib/Transforms/InstCombine/InstCombineInternal.h
   59 class GlobalVariable;
tools/bugpoint/BugDriver.h
   31 class GlobalVariable;
tools/clang/lib/CodeGen/CGCUDARuntime.h
   22 class GlobalVariable;
tools/clang/lib/CodeGen/CGOpenMPRuntime.h
   32 class GlobalVariable;
tools/clang/lib/CodeGen/SanitizerMetadata.h
   20 class GlobalVariable;
tools/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h
   33 class GlobalVariable;

References

examples/BrainF/BrainF.cpp
  146     GlobalVariable *aberrormsg = new GlobalVariable(
  146     GlobalVariable *aberrormsg = new GlobalVariable(
include/llvm/ADT/ArrayRef.h
  108         const ArrayRef<U *> &A,
  110            std::is_convertible<U *const *, T const *>::value>::type * = nullptr)
  118       const SmallVectorTemplateCommon<U *, DummyT> &Vec,
  120           std::is_convertible<U *const *, T const *>::value>::type * = nullptr)
  127     ArrayRef(const std::vector<U *, A> &Vec,
  129                  std::is_convertible<U *const *, T const *>::value>::type* = 0)
include/llvm/ADT/DenseMapInfo.h
   39   static inline T* getEmptyKey() {
   41     Val <<= PointerLikeTypeTraits<T*>::NumLowBitsAvailable;
   45   static inline T* getTombstoneKey() {
   47     Val <<= PointerLikeTypeTraits<T*>::NumLowBitsAvailable;
   51   static unsigned getHashValue(const T *PtrVal) {
   56   static bool isEqual(const T *LHS, const T *RHS) { return LHS == RHS; }
   56   static bool isEqual(const T *LHS, const T *RHS) { return LHS == RHS; }
include/llvm/ADT/STLExtras.h
 1014       std::is_base_of<T, U>::value && are_base_of<T, Ts...>::value;
 1014       std::is_base_of<T, U>::value && are_base_of<T, Ts...>::value;
include/llvm/ADT/ilist.h
   41   static void deleteNode(NodeTy *V) { delete V; }
   65   void addNodeToList(NodeTy *) {}
   66   void removeNodeFromList(NodeTy *) {}
   82 struct ilist_node_traits : ilist_alloc_traits<NodeTy>,
   83                            ilist_callback_traits<NodeTy> {};
   89 struct ilist_traits : public ilist_node_traits<NodeTy> {};
   96 template <class T> T &make();
  106   static Yes &test(U *I, decltype(I->getNext(&make<NodeT>())) * = 0);
  136   static Yes &test(U *I, decltype(I->createNode(make<NodeT>())) * = 0);
  144   static const bool value = HasGetNext<TraitsT, NodeT>::value ||
  146                             HasCreateNode<TraitsT, NodeT>::value;
  389     : public iplist_impl<simple_ilist<T, Options...>, ilist_traits<T>> {
  389     : public iplist_impl<simple_ilist<T, Options...>, ilist_traits<T>> {
include/llvm/ADT/ilist_node.h
  150           typename ilist_detail::compute_node_options<T, Options...>::type> {
include/llvm/ADT/ilist_node_options.h
  108   typedef T value_type;
  109   typedef T *pointer;
  110   typedef T &reference;
  111   typedef const T *const_pointer;
  112   typedef const T &const_reference;
  122   typedef node_options<T, extract_sentinel_tracking<Options...>::value,
include/llvm/ADT/simple_ilist.h
   79     : ilist_detail::compute_node_options<T, Options...>::type::list_base_type,
   81           typename ilist_detail::compute_node_options<T, Options...>::type> {
   85       typename ilist_detail::compute_node_options<T, Options...>::type;
include/llvm/Analysis/GlobalsModRef.h
  117   bool AnalyzeIndirectGlobalMemory(GlobalVariable *GV);
include/llvm/Analysis/MemoryBuiltins.h
  268   SizeOffsetType visitGlobalVariable(GlobalVariable &GV);
include/llvm/Analysis/ObjCARCAnalysisUtils.h
  224     if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(Pointer)) {
  224     if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(Pointer)) {
include/llvm/Analysis/ValueLatticeUtils.h
   36 bool canTrackGlobalVariableInterprocedurally(GlobalVariable *GV);
include/llvm/CodeGen/AsmPrinter.h
  126   using GOTEquivUsePair = std::pair<const GlobalVariable *, unsigned>;
  344   virtual void EmitGlobalVariable(const GlobalVariable *GV);
  348   bool EmitSpecialLLVMGlobal(const GlobalVariable *GV);
include/llvm/CodeGen/WinEHFuncInfo.h
   68   GlobalVariable *TypeDescriptor;
include/llvm/ExecutionEngine/ExecutionEngine.h
  137   virtual char *getMemoryForGV(const GlobalVariable *GV);
  218   virtual GlobalVariable *FindGlobalVariableNamed(StringRef Name, bool AllowInternal = false);
  402   virtual void *getOrEmitGlobalVariable(const GlobalVariable *GV) {
  502   void EmitGlobalVariable(const GlobalVariable *GV);
include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
  454     for (auto &GV : SrcM.globals())
  500     for (auto &GV : SrcM.globals())
  646       if (auto *GV = dyn_cast<GlobalVariable>(V))
  646       if (auto *GV = dyn_cast<GlobalVariable>(V))
  656         auto *StubPtr = createImplPointer(*F->getType(), *M,
  672         return new GlobalVariable(*M, Ty, false, GlobalValue::ExternalLinkage,
include/llvm/ExecutionEngine/Orc/ExecutionUtils.h
   65   CtorDtorIterator(const GlobalVariable *GV, bool End);
include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
  417 GlobalVariable *createImplPointer(PointerType &PT, Module &M, const Twine &Name,
  465 GlobalVariable *cloneGlobalVariableDecl(Module &Dst, const GlobalVariable &GV,
  465 GlobalVariable *cloneGlobalVariableDecl(Module &Dst, const GlobalVariable &GV,
  476 void moveGlobalVariableInitializer(GlobalVariable &OrigGV,
  479                                    GlobalVariable *NewGV = nullptr);
include/llvm/IR/AutoUpgrade.h
   51   GlobalVariable *UpgradeGlobalVariable(GlobalVariable *GV);
   51   GlobalVariable *UpgradeGlobalVariable(GlobalVariable *GV);
include/llvm/IR/Constants.h
  459   static typename std::enable_if<are_base_of<Constant, Csts...>::value,
  461   get(StructType *T, Csts *... Vs) {
include/llvm/IR/DataLayout.h
  566   unsigned getPreferredAlignment(const GlobalVariable *GV) const;
  572   unsigned getPreferredAlignmentLog(const GlobalVariable *GV) const;
include/llvm/IR/GlobalVariable.h
   41 class GlobalVariable : public GlobalObject, public ilist_node<GlobalVariable> {
   62                  const Twine &Name = "", GlobalVariable *InsertBefore = nullptr,
   65   GlobalVariable(const GlobalVariable &) = delete;
   66   GlobalVariable &operator=(const GlobalVariable &) = delete;
   66   GlobalVariable &operator=(const GlobalVariable &) = delete;
  165   void copyAttributesFrom(const GlobalVariable *Src);
  258   public OptionalOperandTraits<GlobalVariable> {
include/llvm/IR/IRBuilder.h
  329   GlobalVariable *CreateGlobalString(StringRef Str, const Twine &Name = "",
 1878     GlobalVariable *GV = CreateGlobalString(Str, Name, AddressSpace);
include/llvm/IR/IntrinsicInst.h
  828     GlobalVariable *getName() const {
  829       return cast<GlobalVariable>(
  868     GlobalVariable *getName() const {
  869       return cast<GlobalVariable>(
include/llvm/IR/Module.h
   71   using GlobalListType = SymbolTableList<GlobalVariable>;
  391   GlobalVariable *getGlobalVariable(StringRef Name) const {
  395   GlobalVariable *getGlobalVariable(StringRef Name, bool AllowInternal) const;
  397   GlobalVariable *getGlobalVariable(StringRef Name,
  406   const GlobalVariable *getNamedGlobal(StringRef Name) const {
  409   GlobalVariable *getNamedGlobal(StringRef Name) {
  420                     function_ref<GlobalVariable *()> CreateGlobalCallback);
  904 GlobalVariable *collectUsedGlobalVariables(const Module &M,
include/llvm/IR/OperandTraits.h
   31   static Use *op_begin(SubClass* U) {
   33         !std::is_polymorphic<SubClass>::value,
   37   static Use *op_end(SubClass* U) {
   53 struct OptionalOperandTraits : public FixedNumOperandTraits<SubClass, ARITY> {
include/llvm/IR/SymbolTableListTraits.h
   66 class SymbolTableListTraits : public ilist_alloc_traits<ValueSubClass> {
   67   using ListTy = SymbolTableList<ValueSubClass>;
   68   using iterator = typename simple_ilist<ValueSubClass>::iterator;
   70       typename SymbolTableListParentType<ValueSubClass>::type;
   95   void addNodeToList(ValueSubClass *V);
   96   void removeNodeFromList(ValueSubClass *V);
  113     : public iplist_impl<simple_ilist<T>, SymbolTableListTraits<T>> {};
  113     : public iplist_impl<simple_ilist<T>, SymbolTableListTraits<T>> {};
include/llvm/IR/User.h
  127   template <int Idx, typename U> static Use &OpFrom(const U *that) {
  129       ? OperandTraits<U>::op_end(const_cast<U*>(that))[Idx]
  130       : OperandTraits<U>::op_begin(const_cast<U*>(that))[Idx];
include/llvm/IR/Value.h
  899     return isa<GlobalVariable>(Val) || isa<Function>(Val);
include/llvm/LTO/legacy/LTOModule.h
  201   void addObjCClass(const GlobalVariable *clgv);
  204   void addObjCCategory(const GlobalVariable *clgv);
  207   void addObjCClassRef(const GlobalVariable *clgv);
include/llvm/ProfileData/InstrProf.h
  183 GlobalVariable *createPGOFuncNameVar(Function &F, StringRef PGOFuncName);
  189 GlobalVariable *createPGOFuncNameVar(Module &M,
  194 StringRef getPGOFuncNameVarInitializer(GlobalVariable *NameVar);
  215 Error collectPGOFuncNameStrings(ArrayRef<GlobalVariable *> NameVars,
include/llvm/Support/Casting.h
   57   static inline bool doit(const From &Val) {
   58     return To::classof(&Val);
   66   static inline bool doit(const From &) { return true; }
   77     return isa_impl<To, From>::doit(Val);
   92     return isa_impl<To, From>::doit(*Val);
  104   static inline bool doit(const From *Val) {
  106     return isa_impl<To, From>::doit(*Val);
  106     return isa_impl<To, From>::doit(*Val);
  122     return isa_impl_wrap<To, SimpleFrom,
  132     return isa_impl_cl<To,FromTy>::doit(Val);
  142   return isa_impl_wrap<X, const Y,
  165   using ret_type = To &;       // Normal case, return Ty&
  168   using ret_type = const To &; // Normal case, return Ty&
  172   using ret_type = To *;       // Pointer arg case, return Ty*
  176   using ret_type = const To *; // Constant pointer arg case, return const Ty*
  198   using ret_type = typename cast_retty<To, SimpleFrom>::ret_type;
  204   using ret_type = typename cast_retty_impl<To,FromTy>::ret_type;
  210       To, From, typename simplify_type<From>::SimpleType>::ret_type;
  218   static typename cast_retty<To, From>::ret_type doit(From &Val) {
  219     return cast_convert_val<To, SimpleFrom,
  227   static typename cast_retty<To, FromTy>::ret_type doit(const FromTy &Val) {
  228     typename cast_retty<To, FromTy>::ret_type Res2
  248                                typename cast_retty<X, const Y>::ret_type>::type
  252       X, const Y, typename simplify_type<const Y>::SimpleType>::doit(Val);
  256 inline typename cast_retty<X, Y>::ret_type cast(Y &Val) {
  258   return cast_convert_val<X, Y,
  263 inline typename cast_retty<X, Y *>::ret_type cast(Y *Val) {
  263 inline typename cast_retty<X, Y *>::ret_type cast(Y *Val) {
  263 inline typename cast_retty<X, Y *>::ret_type cast(Y *Val) {
  265   return cast_convert_val<X, Y*,
  265   return cast_convert_val<X, Y*,
  266                           typename simplify_type<Y*>::SimpleType>::doit(Val);
  305 LLVM_NODISCARD inline typename cast_retty<X, Y *>::ret_type
  309   return cast<X>(Val);
  331                             typename cast_retty<X, const Y>::ret_type>::type
  333   return isa<X>(Val) ? cast<X>(Val) : nullptr;
  333   return isa<X>(Val) ? cast<X>(Val) : nullptr;
  337 LLVM_NODISCARD inline typename cast_retty<X, Y>::ret_type dyn_cast(Y &Val) {
  342 LLVM_NODISCARD inline typename cast_retty<X, Y *>::ret_type dyn_cast(Y *Val) {
  342 LLVM_NODISCARD inline typename cast_retty<X, Y *>::ret_type dyn_cast(Y *Val) {
  342 LLVM_NODISCARD inline typename cast_retty<X, Y *>::ret_type dyn_cast(Y *Val) {
  343   return isa<X>(Val) ? cast<X>(Val) : nullptr;
  343   return isa<X>(Val) ? cast<X>(Val) : nullptr;
  366 LLVM_NODISCARD inline typename cast_retty<X, Y *>::ret_type
  368   return (Val && isa<X>(Val)) ? cast<X>(Val) : nullptr;
  368   return (Val && isa<X>(Val)) ? cast<X>(Val) : nullptr;
include/llvm/Support/PointerLikeTypeTraits.h
   56   static inline void *getAsVoidPointer(T *P) { return P; }
   57   static inline T *getFromVoidPointer(void *P) { return static_cast<T *>(P); }
   59   enum { NumLowBitsAvailable = detail::ConstantLog2<alignof(T)>::value };
   91   typedef PointerLikeTypeTraits<T *> NonConst;
   93   static inline const void *getAsVoidPointer(const T *P) {
   96   static inline const T *getFromVoidPointer(const void *P) {
include/llvm/Transforms/IPO/GlobalDCE.h
   47   DenseMap<Metadata *, SmallSet<std::pair<GlobalVariable *, uint64_t>, 4>>
include/llvm/Transforms/IPO/WholeProgramDevirt.h
   90   GlobalVariable *GV;
include/llvm/Transforms/Instrumentation.h
   41 GlobalVariable *createPrivateGlobalForString(Module &M, StringRef Str,
include/llvm/Transforms/Instrumentation/AddressSanitizer.h
   54   Entry get(GlobalVariable *G) const {
   71   DenseMap<GlobalVariable *, Entry> Entries;
include/llvm/Transforms/Instrumentation/InstrProfiling.h
   52     GlobalVariable *RegionCounters = nullptr;
   53     GlobalVariable *DataVar = nullptr;
   59   DenseMap<GlobalVariable *, PerFunctionProfileData> ProfileDataMap;
   61   std::vector<GlobalVariable *> ReferencedNames;
   62   GlobalVariable *NamesVar;
   98   void lowerCoverageData(GlobalVariable *CoverageNamesVar);
  104   GlobalVariable *getOrCreateRegionCounters(InstrProfIncrementInst *Inc);
include/llvm/Transforms/Scalar/ConstantHoisting.h
  159   using GVCandVecMapType = MapVector<GlobalVariable *, ConstCandVecType>;
  165   using GVInfoVecMapType = MapVector<GlobalVariable *, ConstInfoVecType>;
  194   void findBaseConstants(GlobalVariable *BaseGV);
  199   bool emitBaseConstants(GlobalVariable *BaseGV);
include/llvm/Transforms/Utils/Evaluator.h
   92   const SmallPtrSetImpl<GlobalVariable*> &getInvariants() const {
  116   SmallVector<std::unique_ptr<GlobalVariable>, 32> AllocaTmps;
  120   SmallPtrSet<GlobalVariable*, 8> Invariants;
include/llvm/Transforms/Utils/SanitizerStats.h
   44   GlobalVariable *ModuleStatsGV;
include/llvm/Transforms/Utils/ValueMapper.h
  177   void scheduleMapGlobalInitializer(GlobalVariable &GV, Constant &Init,
  179   void scheduleMapAppendingVariable(GlobalVariable &GV, Constant *InitPrefix,
lib/Analysis/BasicAliasAnalysis.cpp
  672     if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
  672     if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
 1284         isa<GlobalVariable>(DecompObject.Base)) ||
lib/Analysis/CaptureTracking.cpp
  372       if (LI && isa<GlobalVariable>(LI->getPointerOperand()))
lib/Analysis/ConstantFolding.cpp
  556   auto *GV = dyn_cast<GlobalVariable>(GVal);
  556   auto *GV = dyn_cast<GlobalVariable>(GVal);
  624   if (auto *GV = dyn_cast<GlobalVariable>(C))
  624   if (auto *GV = dyn_cast<GlobalVariable>(C))
  638     if (auto *GV = dyn_cast<GlobalVariable>(CE->getOperand(0))) {
  638     if (auto *GV = dyn_cast<GlobalVariable>(CE->getOperand(0))) {
  687   if (auto *GV = dyn_cast<GlobalVariable>(GetUnderlyingObject(CE, DL))) {
  687   if (auto *GV = dyn_cast<GlobalVariable>(GetUnderlyingObject(CE, DL))) {
lib/Analysis/GlobalsModRef.cpp
  300   for (GlobalVariable &GV : M.globals())
  403 bool GlobalsAAResult::AnalyzeIndirectGlobalMemory(GlobalVariable *GV) {
  733       auto *GVar = dyn_cast<GlobalVariable>(GV);
  734       auto *InputGVar = dyn_cast<GlobalVariable>(InputGV);
  859     if (GlobalVariable *GV = dyn_cast<GlobalVariable>(LI->getOperand(0)))
  859     if (GlobalVariable *GV = dyn_cast<GlobalVariable>(LI->getOperand(0)))
  863     if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(LI->getOperand(0)))
  863     if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(LI->getOperand(0)))
lib/Analysis/InstructionSimplify.cpp
 2384         (isa<AllocaInst>(RHS) || isa<GlobalVariable>(RHS))) {
lib/Analysis/LazyCallGraph.cpp
  192   for (GlobalVariable &GV : M.globals())
lib/Analysis/Lint.cpp
  435     if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(UnderlyingObject))
  435     if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(UnderlyingObject))
  476     } else if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Base)) {
  476     } else if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Base)) {
lib/Analysis/Loads.cpp
  450       if ((isa<AllocaInst>(StrippedPtr) || isa<GlobalVariable>(StrippedPtr)) &&
  451           (isa<AllocaInst>(StorePtr) || isa<GlobalVariable>(StorePtr)) &&
lib/Analysis/LoopUnrollAnalyzer.cpp
  102   auto *GV = dyn_cast<GlobalVariable>(AddressIt->second.Base);
  102   auto *GV = dyn_cast<GlobalVariable>(AddressIt->second.Base);
lib/Analysis/MemoryBuiltins.cpp
  599   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
  599   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
  762 SizeOffsetType ObjectSizeOffsetVisitor::visitGlobalVariable(GlobalVariable &GV){
  901              isa<GlobalVariable>(V)) {
lib/Analysis/ModuleSummaryAnalysis.cpp
  528                                const GlobalVariable &V, const Module &M,
  552                                        const GlobalVariable &V,
  569                                    const GlobalVariable &V,
  756   for (const GlobalVariable &G : M.globals()) {
lib/Analysis/ScalarEvolution.cpp
 7505   GlobalVariable *GV = dyn_cast<GlobalVariable>(GEP->getOperand(0));
 7505   GlobalVariable *GV = dyn_cast<GlobalVariable>(GEP->getOperand(0));
lib/Analysis/ValueLatticeUtils.cpp
   27 bool llvm::canTrackGlobalVariableInterprocedurally(GlobalVariable *GV) {
lib/Analysis/ValueTracking.cpp
 3505   const GlobalVariable *GV = dyn_cast<GlobalVariable>(V);
 3505   const GlobalVariable *GV = dyn_cast<GlobalVariable>(V);
lib/AsmParser/LLParser.cpp
  174     } else if (auto *GV = dyn_cast<GlobalVariable>(V)) {
  174     } else if (auto *GV = dyn_cast<GlobalVariable>(V)) {
  531     GlobalVariable::UnnamedAddr &UnnamedAddr) {
  569   GlobalVariable::ThreadLocalMode TLM;
  570   GlobalVariable::UnnamedAddr UnnamedAddr;
  598   GlobalVariable::ThreadLocalMode TLM;
  599   GlobalVariable::UnnamedAddr UnnamedAddr;
  875                                    GlobalVariable::ThreadLocalMode TLM,
  876                                    GlobalVariable::UnnamedAddr UnnamedAddr) {
 1029                            bool DSOLocal, GlobalVariable::ThreadLocalMode TLM,
 1030                            GlobalVariable::UnnamedAddr UnnamedAddr) {
 1079   GlobalVariable *GV;
 1081     GV = new GlobalVariable(*M, Ty, false, GlobalValue::ExternalLinkage, nullptr,
 1082                             Name, nullptr, GlobalVariable::NotThreadLocal,
 1089     GV = cast<GlobalVariable>(GVal);
 1370     return new GlobalVariable(*M, PTy->getElementType(), false,
 1372                               nullptr, GlobalVariable::NotThreadLocal,
 1528 bool LLParser::ParseTLSModel(GlobalVariable::ThreadLocalMode &TLM) {
 1533       TLM = GlobalVariable::LocalDynamicTLSModel;
 1536       TLM = GlobalVariable::InitialExecTLSModel;
 1539       TLM = GlobalVariable::LocalExecTLSModel;
 1551 bool LLParser::ParseOptionalThreadLocal(GlobalVariable::ThreadLocalMode &TLM) {
 1552   TLM = GlobalVariable::NotThreadLocal;
 1556   TLM = GlobalVariable::GeneralDynamicTLSModel;
 3274         FwdRef = new GlobalVariable(*M, Type::getInt8Ty(Context), false,
lib/AsmParser/LLParser.h
  267     bool ParseTLSModel(GlobalVariable::ThreadLocalMode &TLM);
  268     bool ParseOptionalThreadLocal(GlobalVariable::ThreadLocalMode &TLM);
  269     bool ParseOptionalUnnamedAddr(GlobalVariable::UnnamedAddr &UnnamedAddr);
  326                      GlobalVariable::ThreadLocalMode TLM,
  327                      GlobalVariable::UnnamedAddr UnnamedAddr);
  331                              GlobalVariable::ThreadLocalMode TLM,
  332                              GlobalVariable::UnnamedAddr UnnamedAddr);
lib/Bitcode/Reader/BitcodeReader.cpp
  503   std::vector<std::pair<GlobalVariable *, unsigned>> GlobalInits;
 1018 static GlobalVariable::ThreadLocalMode getDecodedThreadLocalMode(unsigned Val) {
 1020     case 0: return GlobalVariable::NotThreadLocal;
 1022     case 1: return GlobalVariable::GeneralDynamicTLSModel;
 1023     case 2: return GlobalVariable::LocalDynamicTLSModel;
 1024     case 3: return GlobalVariable::InitialExecTLSModel;
 1025     case 4: return GlobalVariable::LocalExecTLSModel;
 1029 static GlobalVariable::UnnamedAddr getDecodedUnnamedAddrType(unsigned Val) {
 1032     case 0: return GlobalVariable::UnnamedAddr::None;
 1033     case 1: return GlobalVariable::UnnamedAddr::Global;
 1034     case 2: return GlobalVariable::UnnamedAddr::Local;
 2230   std::vector<std::pair<GlobalVariable *, unsigned>> GlobalInitWorklist;
 2981   std::vector<std::pair<GlobalVariable *, GlobalVariable *>> UpgradedVariables;
 2981   std::vector<std::pair<GlobalVariable *, GlobalVariable *>> UpgradedVariables;
 2982   for (GlobalVariable &GV : TheModule->globals())
 2983     if (GlobalVariable *Upgraded = UpgradeGlobalVariable(&GV))
 3130   GlobalVariable::ThreadLocalMode TLM = GlobalVariable::NotThreadLocal;
 3130   GlobalVariable::ThreadLocalMode TLM = GlobalVariable::NotThreadLocal;
 3142   GlobalVariable *NewGV =
 3143       new GlobalVariable(*TheModule, Ty, isConstant, Linkage, nullptr, Name,
lib/Bitcode/Reader/MetadataLoader.cpp
  513     for (auto &GV : TheModule.globals()) {
 1737       GlobalVariable *Attach = nullptr;
 1739         if (auto *GV = dyn_cast<GlobalVariable>(CMD->getValue())) {
 1739         if (auto *GV = dyn_cast<GlobalVariable>(CMD->getValue())) {
lib/Bitcode/Writer/BitcodeWriter.cpp
  215   void writeModuleLevelReferences(const GlobalVariable &V,
  366   void writeGlobalVariableMetadataAttachment(const GlobalVariable &GV);
 1053     case GlobalVariable::NotThreadLocal:         return 0;
 1054     case GlobalVariable::GeneralDynamicTLSModel: return 1;
 1055     case GlobalVariable::LocalDynamicTLSModel:   return 2;
 1056     case GlobalVariable::InitialExecTLSModel:    return 3;
 1057     case GlobalVariable::LocalExecTLSModel:      return 4;
 1261   for (const GlobalVariable &GV : M.globals()) {
 2126   for (const GlobalVariable &GV : M.globals())
 3681     const GlobalVariable &V, SmallVector<uint64_t, 64> &NameVals,
 3854   for (const GlobalVariable &G : M.globals())
 4570   for (const GlobalVariable &GV : M.globals()) {
lib/Bitcode/Writer/ValueEnumerator.cpp
  112   for (const GlobalVariable &G : M.globals())
  143   for (const GlobalVariable &G : M.globals())
  293   for (const GlobalVariable &G : M.globals())
  301   for (const GlobalVariable &G : M.globals())
  327   for (const GlobalVariable &GV : M.globals())
  348   for (const GlobalVariable &GV : M.globals()) {
  380   for (const GlobalVariable &GV : M.globals()) {
lib/CodeGen/Analysis.cpp
  161   GlobalVariable *Var = dyn_cast<GlobalVariable>(V);
  161   GlobalVariable *Var = dyn_cast<GlobalVariable>(V);
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  164   if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV))
  164   if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV))
  449 void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
 1227   if (isa<GlobalVariable>(C))
 1242 static bool isGOTEquivalentCandidate(const GlobalVariable *GV,
 1271   for (const auto &G : M.globals()) {
 1288   SmallVector<const GlobalVariable *, 8> FailedCandidates;
 1290     const GlobalVariable *GV = I.second.first;
 1396   for (const auto &G : M.globals())
 1578     if (const auto *LU = M.getNamedGlobal("llvm.used")) {
 1927 bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
 2655   const GlobalVariable *GV = Result.first;
lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
 2981   DenseMap<const DIGlobalVariableExpression *, const GlobalVariable *>
 2983   for (const GlobalVariable &GV : MMI->getModule()->globals()) {
 3003       const auto *GV = GlobalMap.lookup(GVE);
 3044     const GlobalVariable *GV = CVGV.GVInfo.get<const GlobalVariable *>();
 3044     const GlobalVariable *GV = CVGV.GVInfo.get<const GlobalVariable *>();
 3078   if (const GlobalVariable *GV =
 3079           CVGV.GVInfo.dyn_cast<const GlobalVariable *>()) {
lib/CodeGen/AsmPrinter/CodeViewDebug.h
  104     PointerUnion<const GlobalVariable *, const DIExpression *> GVInfo;
lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  183     const GlobalVariable *Global = GE.Var;
lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
  125     const GlobalVariable *Var;
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  947   for (const GlobalVariable &Global : M->globals()) {
lib/CodeGen/CodeGenPrepare.cpp
 1820       GlobalVariable *GV;
 1821       if ((GV = dyn_cast<GlobalVariable>(Val)) && GV->canIncreaseAlignment() &&
lib/CodeGen/GlobalMerge.cpp
  158     bool doMerge(SmallVectorImpl<GlobalVariable*> &Globals,
  163     bool doMerge(const SmallVectorImpl<GlobalVariable *> &Globals,
  170     bool isMustKeepGlobalVariable(const GlobalVariable *GV) const {
  182     SmallPtrSet<const GlobalVariable *, 16> MustKeepGlobalVariables;
  218 bool GlobalMerge::doMerge(SmallVectorImpl<GlobalVariable*> &Globals,
  295     GlobalVariable *GV = Globals[GI];
  436 bool GlobalMerge::doMerge(const SmallVectorImpl<GlobalVariable *> &Globals,
  515     auto *MergedGV = new GlobalVariable(
  515     auto *MergedGV = new GlobalVariable(
  517         GlobalVariable::NotThreadLocal, AddrSpace);
  565   const GlobalVariable *GV = M.getGlobalVariable(Name);
  572     if (const GlobalVariable *G =
  573         dyn_cast<GlobalVariable>(InitList->getOperand(i)->stripPointerCasts()))
  589         if (const GlobalVariable *GV =
  590                 dyn_cast<GlobalVariable>(U->stripPointerCasts()))
  604   DenseMap<std::pair<unsigned, StringRef>, SmallVector<GlobalVariable *, 16>>
  610   for (auto &GV : M.globals()) {
lib/CodeGen/LowerEmuTLS.cpp
   39   bool addEmuTlsVar(Module &M, const GlobalVariable *GV);
   41                                     const GlobalVariable *from,
   42                                     GlobalVariable *to) {
   74   SmallVector<const GlobalVariable*, 8> TlsVars;
   75   for (const auto &G : M.globals()) {
   84 bool LowerEmuTLS::addEmuTlsVar(Module &M, const GlobalVariable *GV) {
   89   GlobalVariable *EmuTlsVar = M.getNamedGlobal(EmuTlsVarName);
  120   EmuTlsVar = cast<GlobalVariable>(
  137   GlobalVariable *EmuTlsTmplVar = nullptr;
  140     EmuTlsTmplVar = dyn_cast_or_null<GlobalVariable>(
lib/CodeGen/SelectionDAG/TargetLowering.cpp
 6833   GlobalVariable *EmuTlsVar = VariableModule->getNamedGlobal(EmuTlsVarName);
lib/CodeGen/ShadowStackGCLowering.cpp
   53   GlobalVariable *Head = nullptr;
  145   Constant *GV = new GlobalVariable(*F.getParent(), FrameMap->getType(), true,
  146                                     GlobalVariable::InternalLinkage, FrameMap,
  210     Head = new GlobalVariable(
lib/CodeGen/TargetLoweringBase.cpp
 1684       dyn_cast_or_null<GlobalVariable>(M->getNamedValue(UnsafeStackPtrVar));
 1695     UnsafeStackPtr = new GlobalVariable(
 1782     new GlobalVariable(M, Type::getInt8PtrTy(M.getContext()), false,
 1783                        GlobalVariable::ExternalLinkage,
lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  564   const GlobalVariable *GV = dyn_cast<GlobalVariable>(GO);
  564   const GlobalVariable *GV = dyn_cast<GlobalVariable>(GO);
  650         cast<GlobalVariable>(GO));
 1002           cast<GlobalVariable>(GO)) < 32)
 1010           cast<GlobalVariable>(GO)) < 32)
 1411        (isa<GlobalVariable>(GV) && TM.getDataSections())))
 1588   if (!isa<GlobalObject>(LHS) || !isa<GlobalVariable>(RHS) ||
 1591       cast<GlobalVariable>(RHS)->hasInitializer() || RHS->hasSection())
lib/CodeGen/WasmEHPrepare.cpp
  100   GlobalVariable *LPadContextGV = nullptr; // __wasm_lpad_context
  222   LPadContextGV = cast<GlobalVariable>(
lib/CodeGen/WinEHPrepare.cpp
  152       HT.TypeDescriptor = cast<GlobalVariable>(TypeInfo->stripPointerCasts());
lib/ExecutionEngine/ExecutionEngine.cpp
  101   GVMemoryBlock(const GlobalVariable *GV)
  107   static char *Create(const GlobalVariable *GV, const DataLayout& TD) {
  126 char *ExecutionEngine::getMemoryForGV(const GlobalVariable *GV) {
  165 GlobalVariable *ExecutionEngine::FindGlobalVariableNamed(StringRef Name, bool AllowInternal) {
  167     GlobalVariable *GV = Modules[i]->getGlobalVariable(Name,AllowInternal);
  373   GlobalVariable *GV = module.getNamedGlobal(Name);
  583   if (GlobalVariable *GVar =
  584           const_cast<GlobalVariable *>(dyn_cast<GlobalVariable>(GV)))
  912     else if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(C))
  912     else if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(C))
 1198       for (const auto &GV : M.globals()) {
 1228     for (const auto &GV : M.globals()) {
 1271     for (const auto &GV : M.globals()) {
 1288 void ExecutionEngine::EmitGlobalVariable(const GlobalVariable *GV) {
lib/ExecutionEngine/MCJIT/MCJIT.cpp
  306       GlobalVariable *G = M->getGlobalVariable(DemangledName);
  470 GlobalVariable *MCJIT::FindGlobalVariableNamedInModulePtrSet(StringRef Name,
  475     GlobalVariable *GV = (*I)->getGlobalVariable(Name, AllowInternal);
  495 GlobalVariable *MCJIT::FindGlobalVariableNamed(StringRef Name, bool AllowInternal) {
  496   GlobalVariable *GV = FindGlobalVariableNamedInModulePtrSet(
lib/ExecutionEngine/MCJIT/MCJIT.h
  201   GlobalVariable *FindGlobalVariableNamedInModulePtrSet(StringRef Name,
  229   GlobalVariable *FindGlobalVariableNamed(StringRef Name,
lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
   29     } else if (isa<GlobalVariable>(GV)) {
   30       cast<GlobalVariable>(GV).setInitializer(nullptr);
   45       } else if (isa<GlobalVariable>(Aliasee)) {
   46         auto *G = cloneGlobalVariableDecl(*A.getParent(),
   47                                           *cast<GlobalVariable>(Aliasee));
  223     else if (isa<GlobalVariable>(GV))
lib/ExecutionEngine/Orc/ExecutionUtils.cpp
   22 CtorDtorIterator::CtorDtorIterator(const GlobalVariable *GV, bool End)
   79   const GlobalVariable *CtorsList = M.getNamedGlobal("llvm.global_ctors");
   85   const GlobalVariable *DtorsList = M.getNamedGlobal("llvm.global_dtors");
lib/ExecutionEngine/Orc/IndirectionUtils.cpp
  228 GlobalVariable* createImplPointer(PointerType &PT, Module &M,
  230   auto IP = new GlobalVariable(M, &PT, false, GlobalValue::ExternalLinkage,
  323 GlobalVariable* cloneGlobalVariableDecl(Module &Dst, const GlobalVariable &GV,
  323 GlobalVariable* cloneGlobalVariableDecl(Module &Dst, const GlobalVariable &GV,
  325   GlobalVariable *NewGV = new GlobalVariable(
  325   GlobalVariable *NewGV = new GlobalVariable(
  335 void moveGlobalVariableInitializer(GlobalVariable &OrigGV,
  338                                    GlobalVariable *NewGV) {
  341     NewGV = cast<GlobalVariable>(VMap[&OrigGV]);
lib/ExecutionEngine/Orc/Speculation.cpp
   78     auto SpeclAddr = new GlobalVariable(
   95           auto SpeculatorGuard = new GlobalVariable(
lib/IR/AsmWriter.cpp
  139   for (const GlobalVariable &G : M->globals()) {
  197       !isa<GlobalVariable>(V) && !isa<Function>(V) && !isa<BasicBlock>(V);
  296   for (const GlobalVariable &G : M->globals())
  304   for (const GlobalVariable &G : M->globals())
  875   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
  875   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
  933   for (const GlobalVariable &Var : TheModule->globals()) {
 2402   void printGlobal(const GlobalVariable *GV);
 2629   for (const GlobalVariable &GV : M->globals()) {
 3212 static void PrintThreadLocalModel(GlobalVariable::ThreadLocalMode TLM,
 3215     case GlobalVariable::NotThreadLocal:
 3217     case GlobalVariable::GeneralDynamicTLSModel:
 3220     case GlobalVariable::LocalDynamicTLSModel:
 3223     case GlobalVariable::InitialExecTLSModel:
 3226     case GlobalVariable::LocalExecTLSModel:
 3232 static StringRef getUnnamedAddrEncoding(GlobalVariable::UnnamedAddr UA) {
 3234   case GlobalVariable::UnnamedAddr::None:
 3236   case GlobalVariable::UnnamedAddr::Local:
 3238   case GlobalVariable::UnnamedAddr::Global:
 3250   if (isa<GlobalVariable>(GO))
 3262 void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
 4312     if (const GlobalVariable *V = dyn_cast<GlobalVariable>(GV))
 4312     if (const GlobalVariable *V = dyn_cast<GlobalVariable>(GV))
lib/IR/AutoUpgrade.cpp
  837 GlobalVariable *llvm::UpgradeGlobalVariable(GlobalVariable *GV) {
  837 GlobalVariable *llvm::UpgradeGlobalVariable(GlobalVariable *GV) {
  864   return new GlobalVariable(NewInit->getType(), false, GV->getLinkage(),
 4061   for (auto &GV : M.globals()) {
lib/IR/ConstantFold.cpp
 1504     if (const auto *GVar = dyn_cast<GlobalVariable>(GV)) {
 1504     if (const auto *GVar = dyn_cast<GlobalVariable>(GV)) {
 2463     if (auto *GV = dyn_cast<GlobalVariable>(C))
 2463     if (auto *GV = dyn_cast<GlobalVariable>(C))
lib/IR/Core.cpp
 1225   } else if (const auto *GV = dyn_cast<GlobalVariable>(unwrap(Val))) {
 1225   } else if (const auto *GV = dyn_cast<GlobalVariable>(unwrap(Val))) {
 1249   } else if (const auto *GV = dyn_cast<GlobalVariable>(unwrap(Val))) {
 1249   } else if (const auto *GV = dyn_cast<GlobalVariable>(unwrap(Val))) {
 1272   } else if (const auto *GV = dyn_cast<GlobalVariable>(unwrap(Val))) {
 1272   } else if (const auto *GV = dyn_cast<GlobalVariable>(unwrap(Val))) {
 1954   case GlobalVariable::UnnamedAddr::None:
 1956   case GlobalVariable::UnnamedAddr::Local:
 1958   case GlobalVariable::UnnamedAddr::Global:
 1969     return GV->setUnnamedAddr(GlobalVariable::UnnamedAddr::None);
 1971     return GV->setUnnamedAddr(GlobalVariable::UnnamedAddr::Local);
 1973     return GV->setUnnamedAddr(GlobalVariable::UnnamedAddr::Global);
 2069   return wrap(new GlobalVariable(*unwrap(M), unwrap(Ty), false,
 2076   return wrap(new GlobalVariable(*unwrap(M), unwrap(Ty), false,
 2078                                  nullptr, GlobalVariable::NotThreadLocal,
 2103   GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
 2103   GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
 2111   GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
 2111   GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
 2119   unwrap<GlobalVariable>(GlobalVar)->eraseFromParent();
 2123   GlobalVariable* GV = unwrap<GlobalVariable>(GlobalVar);
 2123   GlobalVariable* GV = unwrap<GlobalVariable>(GlobalVar);
 2130   unwrap<GlobalVariable>(GlobalVar)
 2135   return unwrap<GlobalVariable>(GlobalVar)->isThreadLocal();
 2139   unwrap<GlobalVariable>(GlobalVar)->setThreadLocal(IsThreadLocal != 0);
 2143   return unwrap<GlobalVariable>(GlobalVar)->isConstant();
 2147   unwrap<GlobalVariable>(GlobalVar)->setConstant(IsConstant != 0);
 2151   switch (unwrap<GlobalVariable>(GlobalVar)->getThreadLocalMode()) {
 2152   case GlobalVariable::NotThreadLocal:
 2154   case GlobalVariable::GeneralDynamicTLSModel:
 2156   case GlobalVariable::LocalDynamicTLSModel:
 2158   case GlobalVariable::InitialExecTLSModel:
 2160   case GlobalVariable::LocalExecTLSModel:
 2168   GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
 2168   GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
 2172     GV->setThreadLocalMode(GlobalVariable::NotThreadLocal);
 2175     GV->setThreadLocalMode(GlobalVariable::GeneralDynamicTLSModel);
 2178     GV->setThreadLocalMode(GlobalVariable::LocalDynamicTLSModel);
 2181     GV->setThreadLocalMode(GlobalVariable::InitialExecTLSModel);
 2184     GV->setThreadLocalMode(GlobalVariable::LocalExecTLSModel);
 2190   return unwrap<GlobalVariable>(GlobalVar)->isExternallyInitialized();
 2194   unwrap<GlobalVariable>(GlobalVar)->setExternallyInitialized(IsExtInit);
lib/IR/DataLayout.cpp
  837 unsigned DataLayout::getPreferredAlignment(const GlobalVariable *GV) const {
  875 unsigned DataLayout::getPreferredAlignmentLog(const GlobalVariable *GV) const {
lib/IR/DebugInfo.cpp
  370   for (auto &GV : M.globals()) {
  615   for (auto &GV : M.globals())
lib/IR/Globals.cpp
  233   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(this))
  233   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(this))
  325   if (auto *Var = dyn_cast<GlobalVariable>(this))
  341                    OperandTraits<GlobalVariable>::op_begin(this),
  357                                const Twine &Name, GlobalVariable *Before,
  361                    OperandTraits<GlobalVariable>::op_begin(this),
  411 void GlobalVariable::copyAttributesFrom(const GlobalVariable *Src) {
lib/IR/IRBuilder.cpp
   42 GlobalVariable *IRBuilderBase::CreateGlobalString(StringRef Str,
   47   auto *GV = new GlobalVariable(M, StrConstant->getType(), true,
   47   auto *GV = new GlobalVariable(M, StrConstant->getType(), true,
   49                                 nullptr, GlobalVariable::NotThreadLocal,
lib/IR/Module.cpp
  149     Function *New = Function::Create(Ty, GlobalVariable::ExternalLinkage,
  189 GlobalVariable *Module::getGlobalVariable(StringRef Name,
  191   if (GlobalVariable *Result =
  192       dyn_cast_or_null<GlobalVariable>(getNamedValue(Name)))
  206     function_ref<GlobalVariable *()> CreateGlobalCallback) {
  208   GlobalVariable *GV = dyn_cast_or_null<GlobalVariable>(getNamedValue(Name));
  208   GlobalVariable *GV = dyn_cast_or_null<GlobalVariable>(getNamedValue(Name));
  227     return new GlobalVariable(*this, Ty, false, GlobalVariable::ExternalLinkage,
  227     return new GlobalVariable(*this, Ty, false, GlobalVariable::ExternalLinkage,
  443   for (GlobalVariable &GV : globals())
  598 GlobalVariable *llvm::collectUsedGlobalVariables(
  601   GlobalVariable *GV = M.getGlobalVariable(Name);
lib/IR/SymbolTableListTraitsImpl.h
   95       ValueSubClass &V = *first;
lib/IR/TypeFinder.cpp
   35   for (const auto &G : M.globals()) {
lib/IR/Value.cpp
  663   } else if (auto *GV = dyn_cast<GlobalVariable>(this)) {
  689       if (auto *GVar = dyn_cast<GlobalVariable>(GO)) {
lib/IR/Verifier.cpp
  374     for (const GlobalVariable &GV : M.globals())
  400   void visitGlobalVariable(const GlobalVariable &GV);
  574     const GlobalVariable *GVar = dyn_cast<GlobalVariable>(&GV);
  574     const GlobalVariable *GVar = dyn_cast<GlobalVariable>(&GV);
  620 void Verifier::visitGlobalVariable(const GlobalVariable &GV) {
 4290     auto *GV = dyn_cast<GlobalVariable>(InfoArg);
 4290     auto *GV = dyn_cast<GlobalVariable>(InfoArg);
lib/LTO/LTO.cpp
  681   for (GlobalVariable &GV : M.globals())
  961     GlobalVariable *OldGV = RegularLTO.CombinedModule->getNamedGlobal(I.first);
  970     auto *GV = new GlobalVariable(*RegularLTO.CombinedModule, Ty, false,
  970     auto *GV = new GlobalVariable(*RegularLTO.CombinedModule, Ty, false,
lib/LTO/LTOCodeGenerator.cpp
  404   for (auto &GV : TheModule.globals())
  454     for (auto &GV : MergedModule->globals())
lib/LTO/LTOModule.cpp
  250     if (GlobalVariable *gvn = dyn_cast<GlobalVariable>(op)) {
  250     if (GlobalVariable *gvn = dyn_cast<GlobalVariable>(op)) {
  264 void LTOModule::addObjCClass(const GlobalVariable *clgv) {
  298 void LTOModule::addObjCCategory(const GlobalVariable *clgv) {
  321 void LTOModule::addObjCClassRef(const GlobalVariable *clgv) {
  379   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(v)) {
  379   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(v)) {
  424     const GlobalVariable *gv = dyn_cast<GlobalVariable>(def);
  424     const GlobalVariable *gv = dyn_cast<GlobalVariable>(def);
  604     if (isa<GlobalVariable>(GV)) {
lib/LTO/UpdateCompilerUsed.cpp
   37     for (GlobalVariable &GV : TheModule.globals())
lib/Linker/IRMover.cpp
  474   Expected<Constant *> linkAppendingVarProto(GlobalVariable *DstGV,
  475                                              const GlobalVariable *SrcGV);
  488   void linkGlobalVariable(GlobalVariable &Dst, GlobalVariable &Src);
  488   void linkGlobalVariable(GlobalVariable &Dst, GlobalVariable &Src);
  500   GlobalVariable *copyGlobalVariableProto(const GlobalVariable *SGVar);
  500   GlobalVariable *copyGlobalVariableProto(const GlobalVariable *SGVar);
  594   } else if (auto *V = dyn_cast<GlobalVariable>(New)) {
  594   } else if (auto *V = dyn_cast<GlobalVariable>(New)) {
  622 GlobalVariable *IRLinker::copyGlobalVariableProto(const GlobalVariable *SGVar) {
  622 GlobalVariable *IRLinker::copyGlobalVariableProto(const GlobalVariable *SGVar) {
  626   GlobalVariable *NewDGV =
  627       new GlobalVariable(DstM, TypeMap.get(SGVar->getValueType()),
  688   if (auto *SGVar = dyn_cast<GlobalVariable>(SGV)) {
  700       NewGV = new GlobalVariable(
  715     if (isa<GlobalVariable>(SGV) || SGV->isDeclaration())
  840 IRLinker::linkAppendingVarProto(GlobalVariable *DstGV,
  841                                 const GlobalVariable *SrcGV) {
  918   GlobalVariable *NG = new GlobalVariable(
  918   GlobalVariable *NG = new GlobalVariable(
  985     return linkAppendingVarProto(cast_or_null<GlobalVariable>(DGV),
  986                                  cast<GlobalVariable>(SGV));
 1048 void IRLinker::linkGlobalVariable(GlobalVariable &Dst, GlobalVariable &Src) {
 1048 void IRLinker::linkGlobalVariable(GlobalVariable &Dst, GlobalVariable &Src) {
 1092   if (auto *GVar = dyn_cast<GlobalVariable>(&Src)) {
 1092   if (auto *GVar = dyn_cast<GlobalVariable>(&Src)) {
 1093     linkGlobalVariable(cast<GlobalVariable>(Dst), *GVar);
lib/Linker/LinkModules.cpp
   65                        const GlobalVariable *&GVar);
  131                                    const GlobalVariable *&GVar) {
  141   GVar = dyn_cast_or_null<GlobalVariable>(GVal);
  186     const GlobalVariable *DstGV;
  187     const GlobalVariable *SrcGV;
  345     auto *DGVar = dyn_cast<GlobalVariable>(DGV);
  345     auto *DGVar = dyn_cast<GlobalVariable>(DGV);
  346     auto *SGVar = dyn_cast<GlobalVariable>(&GV);
  346     auto *SGVar = dyn_cast<GlobalVariable>(&GV);
  436   } else if (auto *Var = dyn_cast<GlobalVariable>(&GV)) {
  436   } else if (auto *Var = dyn_cast<GlobalVariable>(&GV)) {
  447           new GlobalVariable(M, Ty.getElementType(), /*isConstant*/ false,
  492     GlobalVariable &GV = *I++;
  501   for (GlobalVariable &GV : SrcM->globals())
  518   for (GlobalVariable &GV : SrcM->globals())
lib/Object/ModuleSymbolTable.cpp
  195   if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV)) {
  195   if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV)) {
  215   else if (auto *Var = dyn_cast<GlobalVariable>(GV)) {
  215   else if (auto *Var = dyn_cast<GlobalVariable>(GV)) {
lib/ProfileData/InstrProf.cpp
  305 GlobalVariable *createPGOFuncNameVar(Module &M,
  322       new GlobalVariable(M, Value->getType(), true, Linkage, Value,
  332 GlobalVariable *createPGOFuncNameVar(Function &F, StringRef PGOFuncName) {
  419 StringRef getPGOFuncNameVarInitializer(GlobalVariable *NameVar) {
  426 Error collectPGOFuncNameStrings(ArrayRef<GlobalVariable *> NameVars,
  429   for (auto *NameVar : NameVars) {
 1139   auto IRLevelVersionVariable = new GlobalVariable(
 1156   GlobalVariable *ProfileNameVar = new GlobalVariable(
 1156   GlobalVariable *ProfileNameVar = new GlobalVariable(
lib/Target/AArch64/AArch64PromoteConstant.cpp
   97     GlobalVariable *GV = nullptr;
  196   void insertDefinitions(Function &F, GlobalVariable &GV,
  474   PC.GV = new GlobalVariable(
  476       "_PromotedConst", nullptr, GlobalVariable::NotThreadLocal);
  485                                                GlobalVariable &PromotedGV,
lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp
  101   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(Base)) {
  101   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(Base)) {
lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp
  119   for (GlobalVariable &GV : M.globals()) {
lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
  288 void AMDGPUAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
lib/Target/AMDGPU/AMDGPUAsmPrinter.h
  134   void EmitGlobalVariable(const GlobalVariable *GV) override;
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
 1184   const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV);
 1184   const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV);
lib/Target/AMDGPU/AMDGPUOpenCLEnqueuedBlockLowering.cpp
  120       auto *GV = new GlobalVariable(
  120       auto *GV = new GlobalVariable(
lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
  182       GlobalVariable *GVar = dyn_cast<GlobalVariable>(ConstExpr->getOperand(0));
  182       GlobalVariable *GVar = dyn_cast<GlobalVariable>(ConstExpr->getOperand(0));
  251             GlobalVariable *GV =
  252                 dyn_cast<GlobalVariable>(ConstExpr->getOperand(0));
  437               GlobalVariable *GV =
  438                   dyn_cast<GlobalVariable>(ConstExpr->getOperand(0));
lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
  650   for (GlobalVariable &GV : Mod->globals()) {
  796   GlobalVariable *GV = new GlobalVariable(
  796   GlobalVariable *GV = new GlobalVariable(
  801       GlobalVariable::NotThreadLocal,
lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
  171             (!isa<GlobalVariable>(GEP->getPointerOperand()) &&
lib/Target/ARM/ARMAsmPrinter.cpp
   96 void ARMAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
  876     for (const auto *GV : ACPC->promotedGlobals()) {
lib/Target/ARM/ARMAsmPrinter.h
   62   SmallPtrSet<const GlobalVariable*,2> PromotedGlobals;
   66   SmallPtrSet<const GlobalVariable*,2> EmittedPromotedGlobalLabels;
  101   void EmitGlobalVariable(const GlobalVariable *GV) override;
lib/Target/ARM/ARMConstantPoolValue.cpp
  140 ARMConstantPoolConstant::ARMConstantPoolConstant(const GlobalVariable *GV,
  154 ARMConstantPoolConstant::Create(const GlobalVariable *GVar,
  211   for (const auto *GV : GVars)
lib/Target/ARM/ARMConstantPoolValue.h
  145   SmallPtrSet<const GlobalVariable*, 1> GVars;
  159   ARMConstantPoolConstant(const GlobalVariable *GV, const Constant *Init);
  165   static ARMConstantPoolConstant *Create(const GlobalVariable *GV,
  179   using promoted_iterator = SmallPtrSet<const GlobalVariable *, 1>::iterator;
lib/Target/ARM/ARMFastISel.cpp
  551   const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV);
  551   const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV);
 2190   GlobalValue *GV = new GlobalVariable(M, Type::getInt32Ty(*Context), false,
lib/Target/ARM/ARMISelLowering.cpp
 2997     auto GV = new GlobalVariable(
 2998                     *M, T, /*isConstant=*/true, GlobalVariable::InternalLinkage, C,
 3339   auto *GVar = dyn_cast<GlobalVariable>(GV);
 3418   if (const auto *V = dyn_cast<GlobalVariable>(GV))
 3418   if (const auto *V = dyn_cast<GlobalVariable>(GV))
lib/Target/ARM/ARMMachineFunctionInfo.h
  129   SmallPtrSet<const GlobalVariable*,2> PromotedGlobals;
  241   void markGlobalAsPromotedToConstantPool(const GlobalVariable *GV) {
  244   SmallPtrSet<const GlobalVariable*, 2>& getGlobalsPromotedToConstantPool() {
lib/Target/BPF/BPFAbstractMemberAccess.cpp
  133   std::map<std::string, GlobalVariable *> GEPGlobals;
  850   GlobalVariable *GV;
  859     GV = new GlobalVariable(M, VarType, false, GlobalVariable::ExternalLinkage,
  859     GV = new GlobalVariable(M, VarType, false, GlobalVariable::ExternalLinkage,
lib/Target/BPF/BPFISelDAGToDAG.cpp
  342   const GlobalVariable *V = dyn_cast<GlobalVariable>(Node->getGlobal());
  342   const GlobalVariable *V = dyn_cast<GlobalVariable>(Node->getGlobal());
lib/Target/BPF/BPFMISimplifyPatchable.cpp
  112           auto *GVar = dyn_cast<GlobalVariable>(GVal);
lib/Target/BPF/BTFDebug.cpp
  991     auto *GVar = dyn_cast<GlobalVariable>(GVal);
 1057   for (const GlobalVariable &Global : M->globals()) {
 1128       auto *GVar = dyn_cast<GlobalVariable>(GVal);
lib/Target/Hexagon/HexagonTargetObjectFile.cpp
  208   const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GO);
  208   const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GO);
  395     const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GO);
  395     const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GO);
lib/Target/Lanai/LanaiTargetObjectFile.cpp
   76   const auto *GVA = dyn_cast<GlobalVariable>(GO);
   76   const auto *GVA = dyn_cast<GlobalVariable>(GO);
lib/Target/Mips/MipsFastISel.cpp
  417   const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV);
  417   const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV);
lib/Target/Mips/MipsTargetObjectFile.cpp
  105   const GlobalVariable *GVA = dyn_cast<GlobalVariable>(GO);
  105   const GlobalVariable *GVA = dyn_cast<GlobalVariable>(GO);
lib/Target/NVPTX/NVPTXAsmPrinter.cpp
  100                          DenseSet<const GlobalVariable *> &Globals) {
  101   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
  101   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
  116 VisitGlobalVariableForEmission(const GlobalVariable *GV,
  117                                SmallVectorImpl<const GlobalVariable *> &Order,
  118                                DenseSet<const GlobalVariable *> &Visited,
  119                                DenseSet<const GlobalVariable *> &Visiting) {
  129   DenseSet<const GlobalVariable *> Others;
  133   for (DenseSet<const GlobalVariable *>::iterator I = Others.begin(),
  620   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
  620   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
  633   if (const GlobalVariable *othergv = dyn_cast<GlobalVariable>(U)) {
  633   if (const GlobalVariable *othergv = dyn_cast<GlobalVariable>(U)) {
  663 static bool canDemoteGlobalVar(const GlobalVariable *gv, Function const *&f) {
  758 static bool isEmptyXXStructor(GlobalVariable *GV) {
  823   SmallVector<const GlobalVariable *, 8> Globals;
  824   DenseSet<const GlobalVariable *> GVVisited;
  825   DenseSet<const GlobalVariable *> GVVisiting;
  828   for (const GlobalVariable &I : M.globals())
  905   GlobalVariable **gv_array = new GlobalVariable *[n];
  905   GlobalVariable **gv_array = new GlobalVariable *[n];
  968       if (isa<GlobalVariable>(V)) {
  969         const GlobalVariable *GVar = cast<GlobalVariable>(V);
  969         const GlobalVariable *GVar = cast<GlobalVariable>(V);
  995 void NVPTXAsmPrinter::printModuleLevelGV(const GlobalVariable *GVar,
 1123       std::vector<const GlobalVariable *> temp;
 1251   std::vector<const GlobalVariable *> &gvars = localDecls[f];
 1322 void NVPTXAsmPrinter::emitPTXGlobalVariable(const GlobalVariable *GVar,
lib/Target/NVPTX/NVPTXAsmPrinter.h
  217   void printModuleLevelGV(const GlobalVariable *GVar, raw_ostream &O,
  256   std::map<const Function *, std::vector<const GlobalVariable *>> localDecls;
  258   void emitPTXGlobalVariable(const GlobalVariable *GVar, raw_ostream &O);
lib/Target/NVPTX/NVPTXAssignValidGlobalNames.cpp
   53   for (GlobalVariable &GV : M.globals()) {
lib/Target/NVPTX/NVPTXGenericToNVVM.cpp
   55   typedef ValueMap<GlobalVariable *, GlobalVariable *> GVMapTy;
   55   typedef ValueMap<GlobalVariable *, GlobalVariable *> GVMapTy;
   79     GlobalVariable *GV = &*I++;
   83       GlobalVariable *NewGV = new GlobalVariable(
   83       GlobalVariable *NewGV = new GlobalVariable(
  133     GlobalVariable *GV = I->first;
  134     GlobalVariable *NewGV = I->second;
  166   if (isa<GlobalVariable>(C)) {
  172     GVMapTy::iterator I = GVMap.find(cast<GlobalVariable>(C));
  174       GlobalVariable *GV = I->second;
lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
  712     if (auto *GV = dyn_cast<const GlobalVariable>(V))
lib/Target/NVPTX/NVVMReflect.cpp
  143     if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(Operand)) {
  143     if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(Operand)) {
lib/Target/PowerPC/PPCAsmPrinter.cpp
  172   void EmitGlobalVariable(const GlobalVariable *GV) override;
 1738 void PPCAIXAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
lib/Target/PowerPC/PPCTargetObjectFile.cpp
   41     const auto *GVar = dyn_cast<GlobalVariable>(GO);
   41     const auto *GVar = dyn_cast<GlobalVariable>(GO);
lib/Target/RISCV/RISCVTargetObjectFile.cpp
   42   const GlobalVariable *GVA = dyn_cast<GlobalVariable>(GO);
   42   const GlobalVariable *GVA = dyn_cast<GlobalVariable>(GO);
lib/Target/Target.cpp
  127   return unwrap(TD)->getPreferredAlignment(unwrap<GlobalVariable>(GlobalVar));
lib/Target/TargetLoweringObjectFile.cpp
   70 static bool isSuitableForBSS(const GlobalVariable *GV) {
  153   const auto *GVar = cast<GlobalVariable>(GO);
  153   const auto *GVar = cast<GlobalVariable>(GO);
  252   if (auto *GVar = dyn_cast<GlobalVariable>(GO)) {
lib/Target/TargetMachine.cpp
   79   case GlobalVariable::NotThreadLocal:
   82   case GlobalVariable::GeneralDynamicTLSModel:
   84   case GlobalVariable::LocalDynamicTLSModel:
   86   case GlobalVariable::InitialExecTLSModel:
   88   case GlobalVariable::LocalExecTLSModel:
  132       GV->isDeclarationForLinker() && isa<GlobalVariable>(GV))
  190         GV && Options.MCOptions.MCPIECopyRelocations && isa<GlobalVariable>(GV);
lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
  135   for (const auto &G : M.globals()) {
lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
  233   GlobalVariable *ThrewGV = nullptr;
  234   GlobalVariable *ThrewValueGV = nullptr;
  314 static GlobalVariable *getGlobalVariableI32(Module &M, IRBuilder<> &IRB,
  317   auto *GV =
  318       dyn_cast<GlobalVariable>(M.getOrInsertGlobal(Name, IRB.getInt32Ty()));
  987             if (auto *GV = dyn_cast<GlobalVariable>(LI->getPointerOperand()))
  987             if (auto *GV = dyn_cast<GlobalVariable>(LI->getPointerOperand()))
  998             if (auto *GV = dyn_cast<GlobalVariable>(SI->getPointerOperand()))
  998             if (auto *GV = dyn_cast<GlobalVariable>(SI->getPointerOperand()))
lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp
   63   GlobalVariable *GV = M.getGlobalVariable("llvm.global_dtors");
  122     GlobalVariable *Handle = new GlobalVariable(
  122     GlobalVariable *Handle = new GlobalVariable(
  124         GlobalVariable::ExternalWeakLinkage, nullptr, "__dso_handle");
  125     Handle->setVisibility(GlobalVariable::HiddenVisibility);
lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
  265     for (auto &GV : M.globals()) {
lib/Target/X86/X86FastISel.cpp
 1061     if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV))
 1061     if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV))
lib/Target/X86/X86ISelLowering.cpp
18191     if (GV->getThreadLocalMode() == GlobalVariable::LocalExecTLSModel) {
38983       if (GlobalVariable *GV = dyn_cast<GlobalVariable>(GEP->getOperand(0))) {
38983       if (GlobalVariable *GV = dyn_cast<GlobalVariable>(GEP->getOperand(0))) {
lib/Target/XCore/XCoreAsmPrinter.cpp
   74     void emitArrayBound(MCSymbol *Sym, const GlobalVariable *GV);
   75     void EmitGlobalVariable(const GlobalVariable *GV) override;
   88 void XCoreAsmPrinter::emitArrayBound(MCSymbol *Sym, const GlobalVariable *GV) {
  107 void XCoreAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
lib/Target/XCore/XCoreISelLowering.cpp
  256   const auto *GVar = dyn_cast<GlobalVariable>(GV);
  256   const auto *GVar = dyn_cast<GlobalVariable>(GV);
lib/Target/XCore/XCoreLowerThreadLocal.cpp
   48     bool lowerGlobal(GlobalVariable *GV);
  160 static bool rewriteNonInstructionUses(GlobalVariable *GV, Pass *P) {
  179 bool XCoreLowerThreadLocal::lowerGlobal(GlobalVariable *GV) {
  195   GlobalVariable *NewGV =
  196     new GlobalVariable(*M, NewType, GV->isConstant(), GV->getLinkage(),
  198                        GlobalVariable::NotThreadLocal,
  225   SmallVector<GlobalVariable *, 16> ThreadLocalGlobals;
  226   for (GlobalVariable &GV : M.globals())
lib/Transforms/Coroutines/CoroEarly.cpp
  132     NoopCoro = new GlobalVariable(M, NoopCoroConst->getType(), /*isConstant=*/true,
  133                                 GlobalVariable::PrivateLinkage, NoopCoroConst,
lib/Transforms/Coroutines/CoroInstr.h
  164     auto *GV = dyn_cast<GlobalVariable>(getRawInfo());
  164     auto *GV = dyn_cast<GlobalVariable>(getRawInfo());
lib/Transforms/Coroutines/CoroSplit.cpp
  831   auto *GV = new GlobalVariable(*M, ConstVal->getType(), /*isConstant=*/true,
  831   auto *GV = new GlobalVariable(*M, ConstVal->getType(), /*isConstant=*/true,
  832                                 GlobalVariable::PrivateLinkage, ConstVal,
lib/Transforms/IPO/CalledValuePropagation.cpp
  136       if (auto *GV = dyn_cast<GlobalVariable>(Key.getPointer())) {
  136       if (auto *GV = dyn_cast<GlobalVariable>(Key.getPointer())) {
  318     if (auto *GV = dyn_cast<GlobalVariable>(I.getPointerOperand())) {
  318     if (auto *GV = dyn_cast<GlobalVariable>(I.getPointerOperand())) {
  333     auto *GV = dyn_cast<GlobalVariable>(I.getPointerOperand());
  333     auto *GV = dyn_cast<GlobalVariable>(I.getPointerOperand());
lib/Transforms/IPO/ConstantMerge.cpp
   45 static void FindUsedValues(GlobalVariable *LLVMUsed,
   58 static bool IsBetterCanonical(const GlobalVariable &A,
   59                               const GlobalVariable &B) {
   69 static bool hasMetadataOtherThanDebugLoc(const GlobalVariable *GV) {
   78 static void copyDebugLocMetadata(const GlobalVariable *From,
   79                                  GlobalVariable *To) {
   86 static unsigned getAlignment(GlobalVariable *GV) {
   94 isUnmergeableGlobal(GlobalVariable *GV,
  104 static CanMerge makeMergeable(GlobalVariable *Old, GlobalVariable *New) {
  104 static CanMerge makeMergeable(GlobalVariable *Old, GlobalVariable *New) {
  115 static void replace(Module &M, GlobalVariable *Old, GlobalVariable *New) {
  115 static void replace(Module &M, GlobalVariable *Old, GlobalVariable *New) {
  141   DenseMap<Constant *, GlobalVariable *> CMap;
  143   SmallVector<std::pair<GlobalVariable *, GlobalVariable *>, 32>
  143   SmallVector<std::pair<GlobalVariable *, GlobalVariable *>, 32>
  157       GlobalVariable *GV = &*GVI++;
  184       GlobalVariable *&Slot = CMap[Init];
  203       GlobalVariable *GV = &*GVI++;
  219       GlobalVariable *Slot = Found->second;
  236       GlobalVariable *Old = SameContentReplacements[i].first;
  237       GlobalVariable *New = SameContentReplacements[i].second;
lib/Transforms/IPO/ElimAvailExtern.cpp
   36   for (GlobalVariable &GV : M.globals()) {
lib/Transforms/IPO/ExtractGV.cpp
  142               new GlobalVariable(M, Ty, false, GlobalValue::ExternalLinkage,
lib/Transforms/IPO/FunctionImport.cpp
  917   } else if (GlobalVariable *V = dyn_cast<GlobalVariable>(&GV)) {
  917   } else if (GlobalVariable *V = dyn_cast<GlobalVariable>(&GV)) {
  931           new GlobalVariable(*GV.getParent(), GV.getValueType(),
 1002   for (auto &GV : TheModule.globals())
 1065   for (auto &GV : M.globals())
 1129     for (GlobalVariable &GV : SrcModule->globals()) {
lib/Transforms/IPO/GlobalDCE.cpp
  168   for (GlobalVariable &GV : M.globals()) {
  206     GlobalVariable *VTable = VTableInfo.first;
  296   for (GlobalVariable &GV : M.globals())
  355   std::vector<GlobalVariable *> DeadGlobalVars; // Keep track of dead globals
  356   for (GlobalVariable &GV : M.globals())
  414   for (GlobalVariable *GV : DeadGlobalVars)
lib/Transforms/IPO/GlobalOpt.cpp
  110 static bool isLeakCheckerRoot(GlobalVariable *GV) {
  189 CleanupPointerRootUsers(GlobalVariable *GV,
  228       GlobalVariable *MemSrc = dyn_cast<GlobalVariable>(MTI->getSource());
  228       GlobalVariable *MemSrc = dyn_cast<GlobalVariable>(MTI->getSource());
  436 static void transferSRADebugInfo(GlobalVariable *GV, GlobalVariable *NGV,
  436 static void transferSRADebugInfo(GlobalVariable *GV, GlobalVariable *NGV,
  462 static GlobalVariable *SRAGlobal(GlobalVariable *GV, const DataLayout &DL) {
  462 static GlobalVariable *SRAGlobal(GlobalVariable *GV, const DataLayout &DL) {
  471   std::vector<GlobalVariable *> NewGlobals;
  486       GlobalVariable *NGV = new GlobalVariable(STy->getElementType(i), false,
  486       GlobalVariable *NGV = new GlobalVariable(STy->getElementType(i), false,
  487                                                GlobalVariable::InternalLinkage,
  522       GlobalVariable *NGV = new GlobalVariable(STy->getElementType(), false,
  522       GlobalVariable *NGV = new GlobalVariable(STy->getElementType(), false,
  523                                                GlobalVariable::InternalLinkage,
  663 static bool AllUsesOfLoadedValueWillTrapIfNull(const GlobalVariable *GV) {
  751     GlobalVariable *GV, Constant *LV, const DataLayout &DL,
  836 static GlobalVariable *
  837 OptimizeGlobalAddressOfMalloc(GlobalVariable *GV, CallInst *CI, Type *AllocTy,
  852   GlobalVariable *NewGV = new GlobalVariable(
  852   GlobalVariable *NewGV = new GlobalVariable(
  883   GlobalVariable *InitBool =
  884     new GlobalVariable(Type::getInt1Ty(GV->getContext()), false,
  966                                                       const GlobalVariable *GV,
 1013                                           GlobalVariable *GV) {
 1107 static bool AllGlobalLoadUsesSimpleEnoughForHeapSRA(const GlobalVariable *GV,
 1276 static GlobalVariable *PerformHeapAllocSRoA(GlobalVariable *GV, CallInst *CI,
 1276 static GlobalVariable *PerformHeapAllocSRoA(GlobalVariable *GV, CallInst *CI,
 1303     GlobalVariable *NGV = new GlobalVariable(
 1303     GlobalVariable *NGV = new GlobalVariable(
 1365         new LoadInst(cast<GlobalVariable>(FieldGlobals[i])->getValueType(),
 1464   return cast<GlobalVariable>(FieldGlobals[0]);
 1469 static bool tryToOptimizeStoreOfMallocToGlobal(GlobalVariable *GV, CallInst *CI,
 1568 optimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal,
 1606 static bool TryToShrinkGlobalToBoolean(GlobalVariable *GV, Constant *OtherVal) {
 1628   GlobalVariable *NewGV = new GlobalVariable(Type::getInt1Ty(GV->getContext()),
 1628   GlobalVariable *NewGV = new GlobalVariable(Type::getInt1Ty(GV->getContext()),
 1923 processInternalGlobal(GlobalVariable *GV, const GlobalStatus &GS,
 2091   auto *GVar = dyn_cast<GlobalVariable>(&GV);
 2091   auto *GVar = dyn_cast<GlobalVariable>(&GV);
 2359     GlobalVariable *GV = &*GVI++;
 2432   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Addr)) {
 2432   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Addr)) {
 2439   GlobalVariable *GV = cast<GlobalVariable>(CE->getOperand(0));
 2439   GlobalVariable *GV = cast<GlobalVariable>(CE->getOperand(0));
 2485   SmallVector<std::pair<GlobalVariable*, Constant*>, 32> GVs;
 2491     if (auto *GV = dyn_cast<GlobalVariable>(I.first)) {
 2491     if (auto *GV = dyn_cast<GlobalVariable>(I.first)) {
 2522   GlobalVariable *CurrentGV = nullptr;
 2558     GlobalVariable *GV = cast<GlobalVariable>(GEP->getOperand(0));
 2558     GlobalVariable *GV = cast<GlobalVariable>(GEP->getOperand(0));
 2586     for (GlobalVariable *GV : Eval.getInvariants())
 2599 static void setUsedInitializer(GlobalVariable &V,
 2621   GlobalVariable *NV =
 2622       new GlobalVariable(*M, ATy, false, GlobalValue::AppendingLinkage,
 2635   GlobalVariable *UsedV;
 2636   GlobalVariable *CompilerUsedV;
 2924     for (const GlobalVariable &GV : M.globals())
lib/Transforms/IPO/GlobalSplit.cpp
   40 static bool splitGlobal(GlobalVariable &GV) {
   75   std::vector<GlobalVariable *> SplitGlobals(Init->getNumOperands());
   78     auto *SplitGV =
   79         new GlobalVariable(*GV.getParent(), Init->getOperand(I)->getType(),
  154     GlobalVariable &GV = *I;
lib/Transforms/IPO/Internalize.cpp
  161     for (GlobalVariable &GV : M.globals())
  214   for (auto &GV : M.globals()) {
lib/Transforms/IPO/LowerTypeTests.cpp
  248   GlobalVariable *ByteArray;
  249   GlobalVariable *MaskGlobal;
  354     if (GlobalVariable *GV = collectUsedGlobalVariables(M, Used, false))
  356     if (GlobalVariable *GV = collectUsedGlobalVariables(M, CompilerUsed, true))
  483   void moveInitializerToModuleConstructor(GlobalVariable *GV);
  485                                  SmallSetVector<GlobalVariable *, 8> &Out);
  593   auto ByteArrayGlobal = new GlobalVariable(
  595   auto MaskGlobal = new GlobalVariable(M, Int8Ty, /*isConstant=*/true,
  632       new GlobalVariable(M, ByteArrayConst->getType(), /*isConstant=*/true,
  829     auto *GV = cast<GlobalVariable>(G->getGlobal());
  829     auto *GV = cast<GlobalVariable>(G->getGlobal());
  858   auto *CombinedGlobal =
  859       new GlobalVariable(M, NewInit->getType(), /*isConstant=*/true,
  870     GlobalVariable *GV = cast<GlobalVariable>(Globals[I]->getGlobal());
  870     GlobalVariable *GV = cast<GlobalVariable>(Globals[I]->getGlobal());
  966     if (auto *GV = dyn_cast<GlobalVariable>(C))
  966     if (auto *GV = dyn_cast<GlobalVariable>(C))
  983     auto *GV = cast<GlobalVariable>(C->stripPointerCasts());
  983     auto *GV = cast<GlobalVariable>(C->stripPointerCasts());
 1060       RealF->setVisibility(GlobalVariable::HiddenVisibility);
 1174   if (isa<GlobalVariable>(GO) && GO->hasSection())
 1249     GlobalVariable *GV) {
 1276     Constant *C, SmallSetVector<GlobalVariable *, 8> &Out) {
 1278     if (auto *GV = dyn_cast<GlobalVariable>(U))
 1278     if (auto *GV = dyn_cast<GlobalVariable>(U))
 1290   SmallSetVector<GlobalVariable *, 8> GlobalVarUsers;
 1545           F->setVisibility(GlobalVariable::HiddenVisibility);
 1635       Globals.empty() || isa<GlobalVariable>(Globals[0]->getGlobal());
 1640       if (IsGlobalSet != isa<GlobalVariable>(Globals[Offset]->getGlobal()))
 1904               GlobalVariable::ExternalLinkage,
 1943     if (isa<GlobalVariable>(GO) && GO.isDeclarationForLinker())
lib/Transforms/IPO/StripDeadPrototypes.cpp
   45     GlobalVariable *GV = &*I++;
lib/Transforms/IPO/StripSymbols.cpp
  146   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
  146   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
  190 static void findUsedValues(GlobalVariable *LLVMUsed,
  279     if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
  279     if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
  318   for (GlobalVariable &GV : M.globals()) {
lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
  166     GlobalVariable &GV = *I++;
  253   for (GlobalVariable &GV : M.globals())
  281         if (auto *GVar = dyn_cast_or_null<GlobalVariable>(GV->getBaseObject()))
  305     if (auto *GVar = dyn_cast_or_null<GlobalVariable>(GV->getBaseObject()))
lib/Transforms/IPO/WholeProgramDevirt.cpp
  781   DenseMap<GlobalVariable *, VTableBits *> GVToBits;
  784   for (GlobalVariable &GV : M.globals()) {
 1263   auto *GV = dyn_cast<GlobalVariable>(C);
 1263   auto *GV = dyn_cast<GlobalVariable>(C);
 1276   auto *GV = cast<GlobalVariable>(C->stripPointerCasts());
 1276   auto *GV = cast<GlobalVariable>(C->stripPointerCasts());
 1513       new GlobalVariable(M, NewInit->getType(), B.GV->isConstant(),
 1514                          GlobalVariable::PrivateLinkage, NewInit, "", B.GV);
 1924   for (GlobalVariable &GV : M.globals())
lib/Transforms/InstCombine/InstCombineCalls.cpp
 1826       if (GlobalVariable *GVSrc = dyn_cast<GlobalVariable>(MMI->getSource()))
 1826       if (GlobalVariable *GVSrc = dyn_cast<GlobalVariable>(MMI->getSource()))
lib/Transforms/InstCombine/InstCombineCompares.cpp
  146                                                         GlobalVariable *GV,
 1838       if (auto *GV = dyn_cast<GlobalVariable>(GEP->getOperand(0)))
 1838       if (auto *GV = dyn_cast<GlobalVariable>(GEP->getOperand(0)))
 3253       if (GlobalVariable *GV = dyn_cast<GlobalVariable>(GEP->getOperand(0)))
 3253       if (GlobalVariable *GV = dyn_cast<GlobalVariable>(GEP->getOperand(0)))
 6060         if (auto *GV = dyn_cast<GlobalVariable>(GEP->getOperand(0)))
 6060         if (auto *GV = dyn_cast<GlobalVariable>(GEP->getOperand(0)))
lib/Transforms/InstCombine/InstCombineInternal.h
  906                                             GlobalVariable *GV, CmpInst &ICI,
lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
   39   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
   39   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
  806     if (GlobalVariable *GV = dyn_cast<GlobalVariable>(P)) {
  806     if (GlobalVariable *GV = dyn_cast<GlobalVariable>(P)) {
lib/Transforms/InstCombine/InstructionCombining.cpp
 2263     return isa<GlobalVariable>(LI->getPointerOperand());
lib/Transforms/Instrumentation/AddressSanitizer.cpp
  652   bool GlobalIsLinkerInitialized(GlobalVariable *G);
  771                              ArrayRef<GlobalVariable *> ExtendedGlobals,
  774                             ArrayRef<GlobalVariable *> ExtendedGlobals,
  778                               ArrayRef<GlobalVariable *> ExtendedGlobals,
  782                                      ArrayRef<GlobalVariable *> ExtendedGlobals,
  785   GlobalVariable *CreateMetadataGlobal(Module &M, Constant *Initializer,
  787   void SetComdatForGlobalMetadata(GlobalVariable *G, GlobalVariable *Metadata,
  787   void SetComdatForGlobalMetadata(GlobalVariable *G, GlobalVariable *Metadata,
  791   bool ShouldInstrumentGlobal(GlobalVariable *G);
 1137     auto *GV = dyn_cast<GlobalVariable>(StrippedV);
 1137     auto *GV = dyn_cast<GlobalVariable>(StrippedV);
 1250 static GlobalVariable *createPrivateGlobalForSourceLoc(Module &M,
 1258   auto GV = new GlobalVariable(M, LocStruct->getType(), true,
 1266 static bool GlobalWasGeneratedByCompiler(GlobalVariable *G) {
 1469 bool AddressSanitizer::GlobalIsLinkerInitialized(GlobalVariable *G) {
 1574     GlobalVariable *G = dyn_cast<GlobalVariable>(GetUnderlyingObject(Addr, DL));
 1574     GlobalVariable *G = dyn_cast<GlobalVariable>(GetUnderlyingObject(Addr, DL));
 1778   GlobalVariable *GV = M.getGlobalVariable("llvm.global_ctors");
 1802 bool ModuleAddressSanitizer::ShouldInstrumentGlobal(GlobalVariable *G) {
 1981     GlobalVariable *G, GlobalVariable *Metadata, StringRef InternalSuffix) {
 1981     GlobalVariable *G, GlobalVariable *Metadata, StringRef InternalSuffix) {
 2017 GlobalVariable *
 2021                      ? GlobalVariable::InternalLinkage
 2022                      : GlobalVariable::PrivateLinkage;
 2023   GlobalVariable *Metadata = new GlobalVariable(
 2023   GlobalVariable *Metadata = new GlobalVariable(
 2040     IRBuilder<> &IRB, Module &M, ArrayRef<GlobalVariable *> ExtendedGlobals,
 2047     GlobalVariable *G = ExtendedGlobals[i];
 2048     GlobalVariable *Metadata =
 2064     IRBuilder<> &IRB, Module &M, ArrayRef<GlobalVariable *> ExtendedGlobals,
 2071     GlobalVariable *G = ExtendedGlobals[i];
 2072     GlobalVariable *Metadata =
 2092   GlobalVariable *RegisteredFlag = new GlobalVariable(
 2092   GlobalVariable *RegisteredFlag = new GlobalVariable(
 2093       M, IntptrTy, false, GlobalVariable::CommonLinkage,
 2095   RegisteredFlag->setVisibility(GlobalVariable::HiddenVisibility);
 2098   GlobalVariable *StartELFMetadata = new GlobalVariable(
 2098   GlobalVariable *StartELFMetadata = new GlobalVariable(
 2099       M, IntptrTy, false, GlobalVariable::ExternalWeakLinkage, nullptr,
 2101   StartELFMetadata->setVisibility(GlobalVariable::HiddenVisibility);
 2102   GlobalVariable *StopELFMetadata = new GlobalVariable(
 2102   GlobalVariable *StopELFMetadata = new GlobalVariable(
 2103       M, IntptrTy, false, GlobalVariable::ExternalWeakLinkage, nullptr,
 2105   StopELFMetadata->setVisibility(GlobalVariable::HiddenVisibility);
 2123     IRBuilder<> &IRB, Module &M, ArrayRef<GlobalVariable *> ExtendedGlobals,
 2135     GlobalVariable *G = ExtendedGlobals[i];
 2136     GlobalVariable *Metadata =
 2144     GlobalVariable *Liveness = new GlobalVariable(
 2144     GlobalVariable *Liveness = new GlobalVariable(
 2145         M, LivenessTy, false, GlobalVariable::InternalLinkage, LivenessBinder,
 2164   GlobalVariable *RegisteredFlag = new GlobalVariable(
 2164   GlobalVariable *RegisteredFlag = new GlobalVariable(
 2165       M, IntptrTy, false, GlobalVariable::CommonLinkage,
 2167   RegisteredFlag->setVisibility(GlobalVariable::HiddenVisibility);
 2180     IRBuilder<> &IRB, Module &M, ArrayRef<GlobalVariable *> ExtendedGlobals,
 2190   auto AllGlobals = new GlobalVariable(
 2191       M, ArrayOfGlobalStructTy, false, GlobalVariable::InternalLinkage,
 2217   SmallVector<GlobalVariable *, 16> GlobalsToChange;
 2219   for (auto &G : M.globals()) {
 2244   SmallVector<GlobalVariable *, 16> NewGlobals(n);
 2251   GlobalVariable *ModuleName = createPrivateGlobalForString(
 2256     GlobalVariable *G = GlobalsToChange[i];
 2264     GlobalVariable *Name = createPrivateGlobalForString(
 2289     GlobalVariable *NewGlobal =
 2290         new GlobalVariable(M, NewTy, G->isConstant(), Linkage, NewInitializer,
 2353       auto *ODRIndicatorSym =
 2354           new GlobalVariable(M, IRB.getInt8Ty(), false, Linkage,
 2387     GlobalVariable *G = NewGlobals[i];
 3146   GlobalVariable *StackDescriptionGlobal =
lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
  719     if (GlobalVariable *G = dyn_cast<GlobalVariable>(ArgTLS))
  719     if (GlobalVariable *G = dyn_cast<GlobalVariable>(ArgTLS))
  720       G->setThreadLocalMode(GlobalVariable::InitialExecTLSModel);
  724     if (GlobalVariable *G = dyn_cast<GlobalVariable>(RetvalTLS))
  724     if (GlobalVariable *G = dyn_cast<GlobalVariable>(RetvalTLS))
  725       G->setThreadLocalMode(GlobalVariable::InitialExecTLSModel);
 1200     if (isa<GlobalVariable>(Obj) && cast<GlobalVariable>(Obj)->isConstant())
 1200     if (isa<GlobalVariable>(Obj) && cast<GlobalVariable>(Obj)->isConstant())
lib/Transforms/Instrumentation/GCOVProfiling.cpp
  116   insertCounterWriteout(ArrayRef<std::pair<GlobalVariable *, MDNode *>>);
  117   Function *insertFlush(ArrayRef<std::pair<GlobalVariable *, MDNode *>>);
  776     SmallVector<std::pair<GlobalVariable *, MDNode *>, 8> CountersBySP;
  801       GlobalVariable *Counters =
  802         new GlobalVariable(*M, CounterTy, false,
  941     ArrayRef<std::pair<GlobalVariable *, MDNode *> > CountersBySP) {
 1017       GlobalVariable *GV = CountersBySP[j].first;
 1032     auto *EmitFunctionCallArgsArrayGV = new GlobalVariable(
 1032     auto *EmitFunctionCallArgsArrayGV = new GlobalVariable(
 1042     auto *EmitArcsCallArgsArrayGV = new GlobalVariable(
 1042     auto *EmitArcsCallArgsArrayGV = new GlobalVariable(
 1076   auto *FileInfoArrayGV = new GlobalVariable(
 1076   auto *FileInfoArrayGV = new GlobalVariable(
 1190 insertFlush(ArrayRef<std::pair<GlobalVariable*, MDNode*> > CountersBySP) {
 1214     GlobalVariable *GV = I.first;
lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
  237   void instrumentGlobal(GlobalVariable *GV, uint8_t Tag);
  423       auto *GV = new GlobalVariable(M, IntptrTy, /*isConstant=*/false,
  423       auto *GV = new GlobalVariable(M, IntptrTy, /*isConstant=*/false,
  426                                     GlobalVariable::InitialExecTLSModel);
  430     ThreadPtrGlobal = cast<GlobalVariable>(C);
 1247 void HWAddressSanitizer::instrumentGlobal(GlobalVariable *GV, uint8_t Tag) {
 1261   auto *NewGV = new GlobalVariable(M, Initializer->getType(), GV->isConstant(),
 1261   auto *NewGV = new GlobalVariable(M, Initializer->getType(), GV->isConstant(),
 1290     auto *Descriptor =
 1291         new GlobalVariable(M, DescriptorTy, true, GlobalValue::PrivateLinkage,
 1352       new GlobalVariable(M, Int8Arr0Ty, true, GlobalVariable::ExternalLinkage,
 1352       new GlobalVariable(M, Int8Arr0Ty, true, GlobalVariable::ExternalLinkage,
 1357       new GlobalVariable(M, Int8Arr0Ty, true, GlobalVariable::ExternalLinkage,
 1357       new GlobalVariable(M, Int8Arr0Ty, true, GlobalVariable::ExternalLinkage,
 1368   auto *Note =
 1369       new GlobalVariable(M, NoteTy, /*isConstantGlobal=*/true,
 1393   auto Dummy = new GlobalVariable(
 1394       M, Int8Arr0Ty, /*isConstantGlobal*/ true, GlobalVariable::PrivateLinkage,
 1402   std::vector<GlobalVariable *> Globals;
 1403   for (GlobalVariable &GV : M.globals()) {
 1427   for (GlobalVariable *GV : Globals) {
lib/Transforms/Instrumentation/InstrOrderFile.cpp
   58   GlobalVariable *OrderFileBuffer;
   59   GlobalVariable *BufferIdx;
   60   GlobalVariable *BitMap;
   82     OrderFileBuffer = new GlobalVariable(M, BufferTy, false, GlobalValue::LinkOnceODRLinkage,
   89     BufferIdx = new GlobalVariable(M, IdxTy, false, GlobalValue::LinkOnceODRLinkage,
   93     BitMap = new GlobalVariable(M, MapTy, false, GlobalValue::PrivateLinkage,
lib/Transforms/Instrumentation/InstrProfiling.cpp
  508   GlobalVariable *CoverageNamesVar =
  584   GlobalVariable *Name = Ind->getName();
  597   GlobalVariable *Name = Ind->getName();
  602   GlobalVariable *DataVar = It->second.DataVar;
  636   GlobalVariable *Counters = getOrCreateRegionCounters(Inc);
  657 void InstrProfiling::lowerCoverageData(GlobalVariable *CoverageNamesVar) {
  664     GlobalVariable *Name = cast<GlobalVariable>(V);
  664     GlobalVariable *Name = cast<GlobalVariable>(V);
  732 GlobalVariable *
  734   GlobalVariable *NamePtr = Inc->getName();
  781   auto *CounterPtr =
  782       new GlobalVariable(*M, CounterTy, false, Linkage,
  803       auto *ValuesVar =
  804           new GlobalVariable(*M, ValuesTy, false, Linkage,
  838   auto *Data = new GlobalVariable(*M, DataTy, false, Linkage,
  838   auto *Data = new GlobalVariable(*M, DataTy, false, Linkage,
  902   auto *VNodesVar = new GlobalVariable(
  902   auto *VNodesVar = new GlobalVariable(
  925   NamesVar = new GlobalVariable(*M, NamesVal->getType(), true,
  937   for (auto *NamePtr : ReferencedNames)
  958       Function::Create(RuntimeRegisterTy, GlobalVariable::ExternalLinkage,
  971         Function::Create(NamesRegisterTy, GlobalVariable::ExternalLinkage,
  992   auto *Var =
  993       new GlobalVariable(*M, Int32Ty, false, GlobalValue::ExternalLinkage,
lib/Transforms/Instrumentation/Instrumentation.cpp
   60 GlobalVariable *llvm::createPrivateGlobalForString(Module &M, StringRef Str,
   66   GlobalVariable *GV =
   67       new GlobalVariable(M, StrConst->getType(), true,
lib/Transforms/Instrumentation/MemorySanitizer.cpp
  682 static GlobalVariable *createPrivateNonConstGlobalForString(Module &M,
  685   return new GlobalVariable(M, StrConst->getType(), /*isConstant=*/false,
  750     return new GlobalVariable(M, Ty, false, GlobalVariable::ExternalLinkage,
  750     return new GlobalVariable(M, Ty, false, GlobalVariable::ExternalLinkage,
  752                               GlobalVariable::InitialExecTLSModel);
  949         return new GlobalVariable(
  956         return new GlobalVariable(M, IRB.getInt32Ty(), true,
lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  313   GlobalVariable *FuncNameVar = nullptr;
  330                          GlobalVariable *FNV, uint64_t FHash) {
  538   GlobalVariable *FuncNameVar;
 1453   for (GlobalVariable &GV : M.globals())
lib/Transforms/Instrumentation/SanitizerCoverage.cpp
  206   GlobalVariable *CreateFunctionLocalArrayInSection(size_t NumElements,
  209   GlobalVariable *CreatePCArray(Function &F, ArrayRef<BasicBlock *> AllBlocks);
  234   GlobalVariable *SanCovLowestStack;
  244   GlobalVariable *FunctionGuardArray;  // for trace-pc-guard.
  245   GlobalVariable *Function8bitCounterArray;  // for inline-8bit-counters.
  246   GlobalVariable *FunctionPCsArray;  // for pc-table.
  305   GlobalVariable *SecStart =
  306       new GlobalVariable(M, Ty, false, GlobalVariable::ExternalLinkage, nullptr,
  306       new GlobalVariable(M, Ty, false, GlobalVariable::ExternalLinkage, nullptr,
  309   GlobalVariable *SecEnd =
  310       new GlobalVariable(M, Ty, false, GlobalVariable::ExternalLinkage,
  310       new GlobalVariable(M, Ty, false, GlobalVariable::ExternalLinkage,
  431   SanCovLowestStack = dyn_cast<GlobalVariable>(SanCovLowestStackConstant);
  643 GlobalVariable *ModuleSanitizerCoverage::CreateFunctionLocalArrayInSection(
  646   auto Array = new GlobalVariable(
  647       *CurModule, ArrayTy, false, GlobalVariable::PrivateLinkage,
  666 GlobalVariable *
  685   auto *PCArray = CreateFunctionLocalArrayInSection(N * 2, F, IntptrPtrTy,
  773       GlobalVariable *GV = new GlobalVariable(
  773       GlobalVariable *GV = new GlobalVariable(
  774           *CurModule, ArrayOfInt64Ty, false, GlobalVariable::InternalLinkage,
lib/Transforms/Instrumentation/ThreadSanitizer.cpp
  311   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Addr)) {
  311   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Addr)) {
  343   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Addr)) {
  343   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Addr)) {
lib/Transforms/ObjCARC/ObjCARCAPElim.cpp
  145   GlobalVariable *GV = M.getGlobalVariable("llvm.global_ctors");
lib/Transforms/ObjCARC/ObjCARCOpts.cpp
  767       if (auto *GV = dyn_cast<GlobalVariable>(Opnd->stripPointerCasts()))
  767       if (auto *GV = dyn_cast<GlobalVariable>(Opnd->stripPointerCasts()))
 1850       if (const GlobalVariable *GV =
 1851             dyn_cast<GlobalVariable>(
lib/Transforms/Scalar/ConstantHoisting.cpp
  399   GlobalVariable *BaseGV = dyn_cast<GlobalVariable>(ConstExpr->getOperand(0));
  399   GlobalVariable *BaseGV = dyn_cast<GlobalVariable>(ConstExpr->getOperand(0));
  639 void ConstantHoistingPass::findBaseConstants(GlobalVariable *BaseGV) {
  826 bool ConstantHoistingPass::emitBaseConstants(GlobalVariable *BaseGV) {
lib/Transforms/Scalar/LoopIdiomRecognize.cpp
 1022     GlobalVariable *GV = new GlobalVariable(*M, PatternValue->getType(), true,
 1022     GlobalVariable *GV = new GlobalVariable(*M, PatternValue->getType(), true,
lib/Transforms/Scalar/MemCpyOptimizer.cpp
 1150   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(M->getSource()))
 1150   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(M->getSource()))
lib/Transforms/Scalar/NewGVN.cpp
 1079   } else if (isa<Argument>(V) || isa<GlobalVariable>(V)) {
 1961   else if (isa<Argument>(V) || isa<GlobalVariable>(V)) {
lib/Transforms/Scalar/SCCP.cpp
  208   DenseMap<GlobalVariable *, LatticeVal> TrackedGlobals;
  291   void TrackValueOfGlobalVariable(GlobalVariable *GV) {
  382   const DenseMap<GlobalVariable*, LatticeVal> &getTrackedGlobals() {
 1134   if (TrackedGlobals.empty() || !isa<GlobalVariable>(SI.getOperand(1)))
 1137   GlobalVariable *GV = cast<GlobalVariable>(SI.getOperand(1));
 1137   GlobalVariable *GV = cast<GlobalVariable>(SI.getOperand(1));
 1138   DenseMap<GlobalVariable*, LatticeVal>::iterator I = TrackedGlobals.find(GV);
 1174   if (auto *GV = dyn_cast<GlobalVariable>(Ptr)) {
 1174   if (auto *GV = dyn_cast<GlobalVariable>(Ptr)) {
 1177       DenseMap<GlobalVariable*, LatticeVal>::iterator It =
 2041   for (GlobalVariable &G : M.globals()) {
 2215   const DenseMap<GlobalVariable*, LatticeVal> &TG = Solver.getTrackedGlobals();
 2216   for (DenseMap<GlobalVariable*, LatticeVal>::const_iterator I = TG.begin(),
 2218     GlobalVariable *GV = I->first;
lib/Transforms/Utils/CloneModule.cpp
   63     GlobalVariable *GV = new GlobalVariable(*New,
   63     GlobalVariable *GV = new GlobalVariable(*New,
   97         GV = new GlobalVariable(
  123     GlobalVariable *GV = cast<GlobalVariable>(VMap[&*I]);
  123     GlobalVariable *GV = cast<GlobalVariable>(VMap[&*I]);
lib/Transforms/Utils/CtorUtils.cpp
   27 static void removeGlobalCtors(GlobalVariable *GCL, const BitVector &CtorsToRemove) {
   47   GlobalVariable *NGV =
   48       new GlobalVariable(CA->getType(), GCL->isConstant(), GCL->getLinkage(),
   65 static std::vector<Function *> parseGlobalCtors(GlobalVariable *GV) {
   80 static GlobalVariable *findGlobalCtors(Module &M) {
   81   GlobalVariable *GV = M.getGlobalVariable("llvm.global_ctors");
  118   GlobalVariable *GlobalCtors = findGlobalCtors(M);
lib/Transforms/Utils/Evaluator.cpp
  137   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C))
  137   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C))
  144         isa<GlobalVariable>(CE->getOperand(0)) &&
  146       GlobalVariable *GV = cast<GlobalVariable>(CE->getOperand(0));
  146       GlobalVariable *GV = cast<GlobalVariable>(CE->getOperand(0));
  167                isa<GlobalVariable>(CE->getOperand(0))) {
  170       return cast<GlobalVariable>(CE->getOperand(0))->hasUniqueInitializer();
  206   auto *GV = dyn_cast<GlobalVariable>(C);
  206   auto *GV = dyn_cast<GlobalVariable>(C);
  225   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(P)) {
  225   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(P)) {
  472       AllocaTmps.push_back(std::make_unique<GlobalVariable>(
  529           if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Ptr)) {
  529           if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Ptr)) {
lib/Transforms/Utils/FunctionImportUtils.cpp
  242     if (GlobalVariable *V = dyn_cast<GlobalVariable>(&GV)) {
  242     if (GlobalVariable *V = dyn_cast<GlobalVariable>(&GV)) {
  292   for (GlobalVariable &GV : M.globals())
lib/Transforms/Utils/GlobalStatus.cpp
   63   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
   63   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
  109           if (const GlobalVariable *GV =
  110                   dyn_cast<GlobalVariable>(SI->getOperand(1))) {
lib/Transforms/Utils/ModuleUtils.cpp
   32   if (GlobalVariable *GVCtor = M.getNamedGlobal(Array)) {
   59   (void)new GlobalVariable(M, NewInit->getType(), false,
   72   GlobalVariable *GV = M.getGlobalVariable(Name);
   96   GV = new llvm::GlobalVariable(M, ATy, false, GlobalValue::AppendingLinkage,
  225     for (GlobalVariable &GV : M.globals())
  266   for (auto &GV : M->globals())
lib/Transforms/Utils/NameAnonGlobals.cpp
   46     for (auto &GV : TheModule.globals()) {
lib/Transforms/Utils/SanitizerStats.cpp
   28   ModuleStatsGV = new GlobalVariable(*M, EmptyModuleStatsTy, false,
   83   auto NewModuleStatsGV = new GlobalVariable(
lib/Transforms/Utils/SimplifyCFG.cpp
 4970   GlobalVariable *Array = nullptr;
 5082   Array = new GlobalVariable(M, ArrayTy, /*isConstant=*/true,
 5083                              GlobalVariable::PrivateLinkage, Initializer,
lib/Transforms/Utils/SimplifyLibCalls.cpp
  701           (GEP->isInBounds() && isa<GlobalVariable>(GEP->getOperand(0)) &&
 2319   GlobalVariable *GV = dyn_cast<GlobalVariable>(LI->getPointerOperand());
 2319   GlobalVariable *GV = dyn_cast<GlobalVariable>(LI->getPointerOperand());
lib/Transforms/Utils/SplitModule.cpp
   69              isa<GlobalVariable>(U)) {
  256     for (GlobalVariable &GV : M->globals())
lib/Transforms/Utils/SymbolRewriter.cpp
  135   if (ValueType *S = (M.*Get)(Source)) {
  179   for (auto &C : (M.*Iterator)()) {
  217                               GlobalVariable, &Module::getGlobalVariable>;
  238                              GlobalVariable, &Module::getGlobalVariable,
lib/Transforms/Utils/VNCoercion.cpp
  312   GlobalVariable *GV = dyn_cast<GlobalVariable>(GetUnderlyingObject(Src, DL));
  312   GlobalVariable *GV = dyn_cast<GlobalVariable>(GetUnderlyingObject(Src, DL));
lib/Transforms/Utils/ValueMapper.cpp
   73     GlobalVariable *GV;
   77     GlobalVariable *GV;
  158   void scheduleMapGlobalInitializer(GlobalVariable &GV, Constant &Init,
  160   void scheduleMapAppendingVariable(GlobalVariable &GV, Constant *InitPrefix,
  171   void mapGlobalInitializer(GlobalVariable &GV, Constant &Init);
  172   void mapAppendingVariable(GlobalVariable &GV, Constant *InitPrefix,
  955 void Mapper::mapAppendingVariable(GlobalVariable &GV, Constant *InitPrefix,
  995 void Mapper::scheduleMapGlobalInitializer(GlobalVariable &GV, Constant &Init,
 1008 void Mapper::scheduleMapAppendingVariable(GlobalVariable &GV,
 1118 void ValueMapper::scheduleMapGlobalInitializer(GlobalVariable &GV,
 1124 void ValueMapper::scheduleMapAppendingVariable(GlobalVariable &GV,
tools/bugpoint/BugDriver.cpp
  251 void llvm::PrintGlobalVariableList(const std::vector<GlobalVariable *> &GVs) {
tools/bugpoint/BugDriver.h
  289 void PrintGlobalVariableList(const std::vector<GlobalVariable *> &GVs);
  294 void DeleteGlobalInitializer(GlobalVariable *GV);
tools/bugpoint/CrashDebugger.cpp
  123 class ReduceCrashingGlobalInitializers : public ListReducer<GlobalVariable *> {
  131   Expected<TestResult> doTest(std::vector<GlobalVariable *> &Prefix,
  132                               std::vector<GlobalVariable *> &Kept) override {
  140   bool TestGlobalVariables(std::vector<GlobalVariable *> &GVs);
  145     std::vector<GlobalVariable *> &GVs) {
  151   std::set<GlobalVariable *> GVSet;
  154     GlobalVariable *CMGV = cast<GlobalVariable>(VMap[GVs[i]]);
  154     GlobalVariable *CMGV = cast<GlobalVariable>(VMap[GVs[i]]);
  165   for (GlobalVariable &I : M->globals())
  212   auto *UsedVar = M->getGlobalVariable(Name, true);
  959   for (GlobalVariable &GV : M->globals()) {
  983   std::vector<GlobalVariable *> GVs;
  984   for (GlobalVariable &GV : OrigM.globals())
tools/bugpoint/ExtractFunction.cpp
   50 Function *globalInitUsesExternalBA(GlobalVariable *GV) {
  207 void llvm::DeleteGlobalInitializer(GlobalVariable *GV) {
  249   GlobalVariable *GV = M1->getNamedGlobal(GlobalName);
  289     new GlobalVariable(*M1, M1Init->getType(), false,
  300     new GlobalVariable(*M2, M2Init->getType(), false,
  339   for (GlobalVariable &I : M->globals()) {
  340     GlobalVariable *GV = cast<GlobalVariable>(NewVMap[&I]);
  340     GlobalVariable *GV = cast<GlobalVariable>(NewVMap[&I]);
tools/bugpoint/Miscompilation.cpp
  845         GlobalVariable *funcName = new GlobalVariable(
  845         GlobalVariable *funcName = new GlobalVariable(
  865           GlobalVariable *Cache = new GlobalVariable(
  865           GlobalVariable *Cache = new GlobalVariable(
tools/clang/include/clang/CodeGen/ConstantInitBuilder.h
   53     llvm::GlobalVariable *Dummy;
   56     SelfReference(llvm::GlobalVariable *dummy) : Dummy(dummy) {}
   77   llvm::GlobalVariable *createGlobal(llvm::Constant *initializer,
   87   void setGlobalInitializer(llvm::GlobalVariable *GV,
   90   void resolveSelfReferences(llvm::GlobalVariable *GV);
  369   llvm::GlobalVariable *finishAndCreateGlobal(As &&...args) {
  378   void finishAndSetAsInitializer(llvm::GlobalVariable *global) {
tools/clang/include/clang/CodeGen/ConstantInitFuture.h
   74   void installInGlobal(llvm::GlobalVariable *global);
tools/clang/lib/CodeGen/Address.h
  108 template <class U> inline U cast(CodeGen::Address addr) {
tools/clang/lib/CodeGen/BackendUtil.cpp
 1603   GlobalVariable *Used = collectUsedGlobalVariables(*M, UsedGlobals, true);
 1636   llvm::GlobalVariable *GV = new llvm::GlobalVariable(
 1636   llvm::GlobalVariable *GV = new llvm::GlobalVariable(
 1642   if (llvm::GlobalVariable *Old =
 1659     GV = new llvm::GlobalVariable(*M, CmdConstant->getType(), true,
 1665     if (llvm::GlobalVariable *Old =
 1681   auto *NewUsed = new GlobalVariable(
 1681   auto *NewUsed = new GlobalVariable(
tools/clang/lib/CodeGen/CGBlocks.cpp
  272   llvm::GlobalVariable *global =
 1436   llvm::GlobalVariable *literal = fields.finishAndCreateGlobal(
 1438       /*constant*/ !IsWindows, llvm::GlobalVariable::InternalLinkage, AddrSpace);
 1455     auto *InitVar = new llvm::GlobalVariable(CGM.getModule(), Init->getType(),
 1455     auto *InitVar = new llvm::GlobalVariable(CGM.getModule(), Init->getType(),
tools/clang/lib/CodeGen/CGBuiltin.cpp
 3517     if (llvm::GlobalVariable *GV =
tools/clang/lib/CodeGen/CGCUDANV.cpp
   51     llvm::GlobalVariable *Var;
   59   llvm::GlobalVariable *GpuBinaryHandle = nullptr;
   87     llvm::GlobalVariable *GV =
   88         cast<llvm::GlobalVariable>(ConstStr.getPointer());
  126   void registerDeviceVar(const VarDecl *VD, llvm::GlobalVariable &Var,
  446     llvm::GlobalVariable *Var = Info.Var;
  561       FatBinStr = new llvm::GlobalVariable(
  565         llvm::GlobalVariable::NotThreadLocal);
  566       cast<llvm::GlobalVariable>(FatBinStr)->setSection(FatbinConstantName);
  605   llvm::GlobalVariable *FatbinWrapper = Values.finishAndCreateGlobal(
  626     GpuBinaryHandle = new llvm::GlobalVariable(
  669     GpuBinaryHandle = new llvm::GlobalVariable(
tools/clang/lib/CodeGen/CGCUDARuntime.h
   58   virtual void registerDeviceVar(const VarDecl *VD, llvm::GlobalVariable &Var,
tools/clang/lib/CodeGen/CGCXXABI.h
  233   virtual llvm::GlobalVariable *getThrowInfo(QualType T) { return nullptr; }
  415   virtual llvm::GlobalVariable *getAddrOfVTable(const CXXRecordDecl *RD,
  550                                llvm::GlobalVariable *DeclPtr,
tools/clang/lib/CodeGen/CGDebugInfo.cpp
 4358     StringRef LinkageName, llvm::GlobalVariable *Var, llvm::DIScope *DContext) {
 4381 void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var,
tools/clang/lib/CodeGen/CGDebugInfo.h
  464   void EmitGlobalVariable(llvm::GlobalVariable *GV, const VarDecl *Decl);
  637                          llvm::GlobalVariable *Var, llvm::DIScope *DContext);
tools/clang/lib/CodeGen/CGDecl.cpp
  250   llvm::GlobalVariable *GV = new llvm::GlobalVariable(
  250   llvm::GlobalVariable *GV = new llvm::GlobalVariable(
  252       nullptr, llvm::GlobalVariable::NotThreadLocal, TargetAS);
  312 llvm::GlobalVariable *
  314                                                llvm::GlobalVariable *GV) {
  338     llvm::GlobalVariable *OldGV = GV;
  340     GV = new llvm::GlobalVariable(CGM.getModule(), Init->getType(),
  398   llvm::GlobalVariable *var =
  399     cast<llvm::GlobalVariable>(addr->stripPointerCasts());
 1100   llvm::GlobalVariable *&CacheEntry = InitializerConstants[&D];
 1104     llvm::GlobalVariable *InsertBefore = nullptr;
 1114     llvm::GlobalVariable *GV = new llvm::GlobalVariable(
 1114     llvm::GlobalVariable *GV = new llvm::GlobalVariable(
tools/clang/lib/CodeGen/CGDeclCXX.cpp
  284                                          llvm::GlobalVariable *DeclPtr,
  416                                           llvm::GlobalVariable *GV,
  419   llvm::GlobalVariable *PtrArray = new llvm::GlobalVariable(
  419   llvm::GlobalVariable *PtrArray = new llvm::GlobalVariable(
  432                                             llvm::GlobalVariable *Addr,
  471   llvm::GlobalVariable *COMDATKey =
  637                                                  llvm::GlobalVariable *Addr,
tools/clang/lib/CodeGen/CGException.cpp
  264       if (llvm::GlobalVariable *GV = dyn_cast<llvm::GlobalVariable>(Val))
  264       if (llvm::GlobalVariable *GV = dyn_cast<llvm::GlobalVariable>(Val))
  274         if (llvm::GlobalVariable *GV =
  275             cast<llvm::GlobalVariable>((*II)->stripPointerCasts()))
tools/clang/lib/CodeGen/CGExpr.cpp
  389           auto *GV = new llvm::GlobalVariable(
  389           auto *GV = new llvm::GlobalVariable(
  432     if (auto *Var = dyn_cast<llvm::GlobalVariable>(Object.getPointer())) {
  432     if (auto *Var = dyn_cast<llvm::GlobalVariable>(Object.getPointer())) {
  489   if (auto *Var = dyn_cast<llvm::GlobalVariable>(
  489   if (auto *Var = dyn_cast<llvm::GlobalVariable>(
 2822   auto *GV = new llvm::GlobalVariable(
 2822   auto *GV = new llvm::GlobalVariable(
 2824       /*isConstant=*/true, llvm::GlobalVariable::PrivateLinkage, Descriptor);
 2906                           cast<llvm::GlobalVariable>(FilenameGV.getPointer()));
 3074       auto *InfoPtr =
 3075           new llvm::GlobalVariable(CGM.getModule(), Info->getType(), false,
 3076                                    llvm::GlobalVariable::PrivateLinkage, Info);
 3135     auto *InfoPtr =
 3136         new llvm::GlobalVariable(CGM.getModule(), Info->getType(), false,
 3137                                  llvm::GlobalVariable::PrivateLinkage, Info);
tools/clang/lib/CodeGen/CGExprAgg.cpp
  499       auto GV = new llvm::GlobalVariable(
  503           /* InsertBefore= */ nullptr, llvm::GlobalVariable::NotThreadLocal,
tools/clang/lib/CodeGen/CGExprCXX.cpp
  528     llvm::GlobalVariable *NullVariable = new llvm::GlobalVariable(
  528     llvm::GlobalVariable *NullVariable = new llvm::GlobalVariable(
  530         /*isConstant=*/true, llvm::GlobalVariable::PrivateLinkage,
tools/clang/lib/CodeGen/CGExprConstant.cpp
  888   if (llvm::GlobalVariable *Addr =
  903   auto GV = new llvm::GlobalVariable(CGM.getModule(), C->getType(),
  907                                      llvm::GlobalVariable::NotThreadLocal,
 1418   auto global = new llvm::GlobalVariable(CGM.getModule(), CGM.Int8Ty, true,
 1423                                          llvm::GlobalVariable::NotThreadLocal,
 1448     llvm::DenseMap<llvm::Constant*, llvm::GlobalVariable*> PlaceholderAddresses;
 1451     llvm::DenseMap<llvm::GlobalVariable*, llvm::Constant*> Locations;
 1461                                            llvm::GlobalVariable*>> addresses)
 1529     void setLocation(llvm::GlobalVariable *placeholder) {
 1566 void ConstantEmitter::finalize(llvm::GlobalVariable *global) {
 2153 llvm::GlobalVariable *CodeGenModule::getAddrOfConstantCompoundLiteralIfEmitted(
 2159     const CompoundLiteralExpr *CLE, llvm::GlobalVariable *GV) {
tools/clang/lib/CodeGen/CGGPUBuiltin.cpp
   40       VprintfFuncType, llvm::GlobalVariable::ExternalLinkage, "vprintf", &M);
tools/clang/lib/CodeGen/CGObjCGNU.cpp
  218     auto *ConstStr = TheModule.getGlobalVariable(name);
  221       auto *GV = new llvm::GlobalVariable(TheModule, value->getType(), true,
  221       auto *GV = new llvm::GlobalVariable(TheModule, value->getType(), true,
  532   llvm::GlobalVariable *ObjCIvarOffsetVariable(const ObjCInterfaceDecl *ID,
 1009       isa = new llvm::GlobalVariable(TheModule, IdTy, /* isConstant */false,
 1062       auto *Buffer = new llvm::GlobalVariable(TheModule, C->getType(),
 1062       auto *Buffer = new llvm::GlobalVariable(TheModule, C->getType(),
 1094     auto *ObjCStrGV =
 1205   llvm::GlobalVariable *GetClassVar(StringRef Name, bool isWeak=false) {
 1207     auto *ClassSymbol = TheModule.getNamedGlobal(SymbolName);
 1210     ClassSymbol = new llvm::GlobalVariable(TheModule,
 1218       ClassSymbol->setInitializer(new llvm::GlobalVariable(TheModule,
 1292     auto *GV = TheModule.getGlobalVariable(Name);
 1295       GV = new llvm::GlobalVariable(TheModule, ProtocolTy, false,
 1316       auto GV = new llvm::GlobalVariable(TheModule, ProtocolPtrTy,
 1354     auto *OldGV = TheModule.getGlobalVariable(SymName);
 1364       Protocol = new llvm::GlobalVariable(TheModule, ProtocolTy,
 1406     auto *GV = ProtocolBuilder.finishAndCreateGlobal(SymName,
 1435     auto *TypesGlobal = TheModule.getGlobalVariable(TypesVarName);
 1439       auto *GV = new llvm::GlobalVariable(TheModule, Init->getType(),
 1439       auto *GV = new llvm::GlobalVariable(TheModule, Init->getType(),
 1459     if (auto *GV = TheModule.getNamedGlobal(SelVarName))
 1466     auto *GV = SelBuilder.finishAndCreateGlobal(SelVarName,
 1492         auto *Sym = new llvm::GlobalVariable(TheModule, emptyStruct,
 1492         auto *Sym = new llvm::GlobalVariable(TheModule, emptyStruct,
 1505     auto *Start = new llvm::GlobalVariable(TheModule, PtrTy,
 1505     auto *Start = new llvm::GlobalVariable(TheModule, PtrTy,
 1510     auto *Stop = new llvm::GlobalVariable(TheModule, PtrTy,
 1510     auto *Stop = new llvm::GlobalVariable(TheModule, PtrTy,
 1541     auto *InitStruct = InitStructBuilder.finishAndCreateGlobal(".objc_init",
 1553     auto *InitVar = new llvm::GlobalVariable(TheModule, LoadFunction->getType(),
 1553     auto *InitVar = new llvm::GlobalVariable(TheModule, LoadFunction->getType(),
 1577       auto *Cat = cast<llvm::GlobalVariable>(C->stripPointerCasts());
 1577       auto *Cat = cast<llvm::GlobalVariable>(C->stripPointerCasts());
 1643         auto *global = TheModule.getGlobalVariable(lateInit.first);
 1652       auto *InitVar = new llvm::GlobalVariable(CGM.getModule(), Init->getType(), 
 1652       auto *InitVar = new llvm::GlobalVariable(CGM.getModule(), Init->getType(), 
 1677     llvm::GlobalVariable *IvarOffsetPointer = TheModule.getNamedGlobal(Name);
 1679       IvarOffsetPointer = new llvm::GlobalVariable(TheModule, IntTy, false,
 1748     auto *metaclass = metaclassFields.finishAndCreateGlobal(
 1765         SuperClass = new llvm::GlobalVariable(TheModule, PtrTy, false,
 1838         llvm::GlobalVariable *OffsetVar = TheModule.getGlobalVariable(OffsetName);
 1842           OffsetVar = new llvm::GlobalVariable(TheModule, IntTy,
 1925     auto *classStruct =
 1929     auto *classRefSymbol = GetClassVar(className);
 1972     auto classInitRef = new llvm::GlobalVariable(TheModule,
 2075     llvm::GlobalVariable *ClassSymbol = TheModule.getGlobalVariable(SymbolName);
 2077       ClassSymbol = new llvm::GlobalVariable(TheModule, LongTy, false,
 2107   llvm::GlobalVariable *ClassSymbol = TheModule.getGlobalVariable(symbolName);
 2109     ClassSymbol = new llvm::GlobalVariable(TheModule, LongTy, false,
 2113   new llvm::GlobalVariable(TheModule, ClassSymbol->getType(), true,
 2292   if (auto *ClassSymbol = dyn_cast<llvm::GlobalVariable>(Value))
 2292   if (auto *ClassSymbol = dyn_cast<llvm::GlobalVariable>(Value))
 2300     if (auto *ClassSymbol = dyn_cast<llvm::GlobalVariable>(Value)) {
 2300     if (auto *ClassSymbol = dyn_cast<llvm::GlobalVariable>(Value)) {
 2397         new llvm::GlobalVariable(CGM.getModule(), PtrToInt8Ty,
 2424   auto *Vtable = TheModule.getGlobalVariable(vtableName);
 2426     Vtable = new llvm::GlobalVariable(TheModule, PtrToInt8Ty, true,
 2471     isa = new llvm::GlobalVariable(TheModule, IdTy, /* isConstant */false,
 2970   llvm::GlobalVariable *ClassRef = TheModule.getNamedGlobal(ClassSym);
 3394   if (auto *symbol = TheModule.getGlobalVariable(classSymbolName)) {
 3397     new llvm::GlobalVariable(TheModule, LongTy, false,
 3448       llvm::GlobalVariable *OffsetVar = TheModule.getGlobalVariable(OffsetName);
 3456         OffsetVar = new llvm::GlobalVariable(TheModule, Int32Ty,
 3479   llvm::GlobalVariable *IvarOffsetArray =
 3551           cast<llvm::GlobalVariable>(IvarList)->getValueType(), IvarList,
 3554       llvm::GlobalVariable *offset = TheModule.getNamedGlobal(Name);
 3563         new llvm::GlobalVariable(TheModule, offsetValue->getType(),
 3626     llvm::GlobalVariable *fileStatics = [&] {
 3660   llvm::GlobalVariable *selectorList = [&] {
 3721   llvm::GlobalVariable *symtab = [&] {
 4022 llvm::GlobalVariable *CGObjCGNU::ObjCIvarOffsetVariable(
 4029   llvm::GlobalVariable *IvarOffsetPointer = TheModule.getNamedGlobal(Name);
 4031     IvarOffsetPointer = new llvm::GlobalVariable(TheModule,
 4087       auto GV = new llvm::GlobalVariable(TheModule, IntTy,
tools/clang/lib/CodeGen/CGObjCMac.cpp
  861   llvm::StringMap<llvm::GlobalVariable*> ClassNames;
  864   llvm::DenseMap<Selector, llvm::GlobalVariable*> MethodVarNames;
  871   llvm::StringMap<llvm::GlobalVariable*> MethodVarTypes;
  878   llvm::DenseMap<IdentifierInfo*, llvm::GlobalVariable*> PropertyNames;
  881   llvm::DenseMap<IdentifierInfo*, llvm::GlobalVariable*> ClassReferences;
  884   llvm::DenseMap<Selector, llvm::GlobalVariable*> SelectorReferences;
  889   llvm::DenseMap<IdentifierInfo*, llvm::GlobalVariable*> Protocols;
  920   llvm::StringMap<llvm::GlobalVariable *> NSConstantStringMap;
 1050   llvm::GlobalVariable *CreateMetadataVar(Twine Name,
 1054   llvm::GlobalVariable *CreateMetadataVar(Twine Name,
 1059   llvm::GlobalVariable *CreateCStringLiteral(StringRef Name,
 1398   llvm::GlobalVariable* ObjCEmptyCacheVar;
 1402   llvm::DenseMap<IdentifierInfo*, llvm::GlobalVariable*> SuperClassReferences;
 1405   llvm::DenseMap<IdentifierInfo*, llvm::GlobalVariable*> MetaClassReferences;
 1408   llvm::DenseMap<IdentifierInfo*, llvm::GlobalVariable*> EHTypeReferences;
 1430   llvm::GlobalVariable * BuildClassRoTInitializer(unsigned flags,
 1434   llvm::GlobalVariable *BuildClassObject(const ObjCInterfaceDecl *CI,
 1501                                   llvm::GlobalVariable *Entry);
 1527   llvm::GlobalVariable * ObjCIvarOffsetVariable(
 1828                                       llvm::GlobalVariable *C, unsigned idx0,
 1857 static llvm::GlobalVariable *
 1863   auto *GV = Builder.finishAndCreateGlobal(
 1940 static llvm::StringMapEntry<llvm::GlobalVariable *> &
 1941 GetConstantStringEntry(llvm::StringMap<llvm::GlobalVariable *> &Map,
 1984   llvm::StringMapEntry<llvm::GlobalVariable *> &Entry =
 1987   if (auto *C = Entry.second)
 2016   auto *GV = new llvm::GlobalVariable(CGM.getModule(), C->getType(), isConstant,
 2016   auto *GV = new llvm::GlobalVariable(CGM.getModule(), C->getType(), isConstant,
 2031                                     llvm::GlobalVariable::PrivateLinkage);
 2859   auto *Entry = CreateCStringLiteral(BitMap, ObjCLabelType::ClassName,
 3046   llvm::GlobalVariable *Entry = Protocols[PD->getIdentifier()];
 3093   llvm::GlobalVariable *&Entry = Protocols[PD->getIdentifier()];
 3099     Entry = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ProtocolTy,
 3208   llvm::GlobalVariable *GV =
 3312   llvm::GlobalVariable *GV =
 3333   llvm::GlobalVariable *GV =
 3406   llvm::GlobalVariable *GV =
 3604   llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name, true);
 3667   llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name, true);
 3694   llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name, true);
 3696     GV = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ClassTy, false,
 3707   llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name, true);
 3710     GV = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ClassTy, false,
 3822   llvm::GlobalVariable *GV;
 3949     llvm::GlobalVariable *GV = CreateMetadataVar(prefix + name, values, section,
 3966   llvm::GlobalVariable *GV = CreateMetadataVar(prefix + name, values, section,
 3989 llvm::GlobalVariable *CGObjCCommonMac::CreateMetadataVar(Twine Name,
 3996   llvm::GlobalVariable *GV =
 4005 llvm::GlobalVariable *CGObjCCommonMac::CreateMetadataVar(Twine Name,
 4013   llvm::GlobalVariable *GV =
 4014       new llvm::GlobalVariable(CGM.getModule(), Ty, false, LT, Init, Name);
 4023 llvm::GlobalVariable *
 4058   llvm::GlobalVariable *GV =
 4059       new llvm::GlobalVariable(CGM.getModule(), Value->getType(),
 5069         DefinedClasses[i]->setLinkage(llvm::GlobalVariable::ExternalLinkage);
 5078   llvm::GlobalVariable *GV = CreateMetadataVar(
 5088   llvm::GlobalVariable *&Entry = ClassReferences[II];
 5127   llvm::GlobalVariable *&Entry = SelectorReferences[Sel];
 5142     llvm::GlobalVariable *&Entry = ClassNames[RuntimeName];
 5397   auto *Entry = CGObjC.CreateCStringLiteral(
 5492   llvm::GlobalVariable *&Entry = MethodVarNames[Sel];
 5508   llvm::GlobalVariable *&Entry = MethodVarTypes[TypeStr];
 5519   llvm::GlobalVariable *&Entry = MethodVarTypes[TypeStr];
 5527   llvm::GlobalVariable *&Entry = PropertyNames[Ident];
 5562     llvm::GlobalVariable *global = entry.second;
 6074   llvm::GlobalVariable *GV =
 6075     new llvm::GlobalVariable(CGM.getModule(), Init->getType(), false, LT, Init,
 6095         DefinedClasses[i]->setLinkage(llvm::GlobalVariable::ExternalLinkage);
 6096         DefinedMetaClasses[i]->setLinkage(llvm::GlobalVariable::ExternalLinkage);
 6200 llvm::GlobalVariable * CGObjCNonFragileABIMac::BuildClassRoTInitializer(
 6296 llvm::GlobalVariable *
 6315   llvm::GlobalVariable *GV =
 6316     cast<llvm::GlobalVariable>(GetClassGlobal(CI, isMetaclass, ForDefinition));
 6375         new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.CacheTy, false,
 6385           new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ImpnfABITy, false,
 6436   llvm::GlobalVariable *CLASS_RO_GV =
 6439   llvm::GlobalVariable *MetaTClass =
 6479   llvm::GlobalVariable *ClassMD =
 6520   llvm::GlobalVariable *PTGV = CGM.getModule().getGlobalVariable(ProtocolName);
 6523   PTGV = new llvm::GlobalVariable(CGM.getModule(), Init->getType(), false,
 6604   llvm::GlobalVariable *GCATV =
 6715   llvm::GlobalVariable *GV = finishAndCreateGlobal(values, prefix + name, CGM);
 6722 llvm::GlobalVariable *
 6730   llvm::GlobalVariable *IvarOffsetGV = CGM.getModule().getGlobalVariable(Name);
 6733         new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.IvarOffsetVarTy,
 6758   llvm::GlobalVariable *IvarOffsetGV = ObjCIvarOffsetVariable(ID, Ivar);
 6856   llvm::GlobalVariable *GV = finishAndCreateGlobal(
 6864   llvm::GlobalVariable *&Entry = Protocols[PD->getIdentifier()];
 6874     Entry = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ProtocolnfABITy,
 6906   llvm::GlobalVariable *Entry = Protocols[PD->getIdentifier()];
 6982   llvm::GlobalVariable *PTGV =
 6983     new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ProtocolnfABIPtrTy,
 7018   llvm::GlobalVariable *GV =
 7071     llvm::GlobalVariable *GV = ObjCIvarOffsetVariable(Interface, Ivar);
 7177   llvm::GlobalVariable *messageRef
 7265   llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name);
 7267     auto *NewGV = new llvm::GlobalVariable(ObjCTypes.ClassnfABITy, false, L,
 7267     auto *NewGV = new llvm::GlobalVariable(ObjCTypes.ClassnfABITy, false, L,
 7305                                            llvm::GlobalVariable *Entry) {
 7321   llvm::GlobalVariable *&Entry = ClassReferences[II];
 7336     Entry = new llvm::GlobalVariable(
 7369   llvm::GlobalVariable *&Entry = SuperClassReferences[ID->getIdentifier()];
 7375     Entry = new llvm::GlobalVariable(
 7394   llvm::GlobalVariable * &Entry = MetaClassReferences[ID->getIdentifier()];
 7399     Entry = new llvm::GlobalVariable(
 7487   llvm::GlobalVariable *&Entry = SelectorReferences[Sel];
 7496     Entry = new llvm::GlobalVariable(
 7633     auto *IDEHType = CGM.getModule().getGlobalVariable("OBJC_EHTYPE_id");
 7636           new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.EHTypeTy, false,
 7686   llvm::GlobalVariable * &Entry = EHTypeReferences[ID->getIdentifier()];
 7699       Entry = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.EHTypeTy,
 7711   auto *VTableGV = CGM.getModule().getGlobalVariable(VTableName);
 7714         new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.Int8PtrTy, false,
tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp
  830     auto *GV = new llvm::GlobalVariable(
  830     auto *GV = new llvm::GlobalVariable(
 1319     auto *GV = dyn_cast<llvm::GlobalVariable>(Data.getValue());
 1319     auto *GV = dyn_cast<llvm::GlobalVariable>(Data.getValue());
 1541 static llvm::GlobalVariable *
 2696       auto *GV = cast<llvm::GlobalVariable>(Ptr);
 2696       auto *GV = cast<llvm::GlobalVariable>(Ptr);
 2875                                                      llvm::GlobalVariable *Addr,
 2933       Ctor = new llvm::GlobalVariable(
 2972       Dtor = new llvm::GlobalVariable(
 3146   return Elem.second = new llvm::GlobalVariable(
 4027   auto *Str = new llvm::GlobalVariable(
 4027   auto *Str = new llvm::GlobalVariable(
 4038   llvm::GlobalVariable *Entry = createGlobalStruct(
 6526     OutlinedFnID = new llvm::GlobalVariable(
 8608       auto *SizesArrayGbl = new llvm::GlobalVariable(
 8608       auto *SizesArrayGbl = new llvm::GlobalVariable(
 8624     auto *MapTypesArrayGbl = new llvm::GlobalVariable(
 8624     auto *MapTypesArrayGbl = new llvm::GlobalVariable(
 9717         auto *GVAddrRef = cast<llvm::GlobalVariable>(AddrRef);
 9717         auto *GVAddrRef = cast<llvm::GlobalVariable>(AddrRef);
tools/clang/lib/CodeGen/CGOpenMPRuntime.h
 1185                                               llvm::GlobalVariable *Addr,
tools/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
 1178     KernelStaticGlobalized = new llvm::GlobalVariable(
 1308     KernelStaticGlobalized = new llvm::GlobalVariable(
 1383   auto *GVMode =
 1384       new llvm::GlobalVariable(CGM.getModule(), CGM.Int8Ty, /*isConstant=*/true,
 2221         auto *UseSharedMemory = new llvm::GlobalVariable(
 2221         auto *UseSharedMemory = new llvm::GlobalVariable(
 2232         auto *StaticGlobalized = new llvm::GlobalVariable(
 2232         auto *StaticGlobalized = new llvm::GlobalVariable(
 2235         auto *RecSize = new llvm::GlobalVariable(
 2235         auto *RecSize = new llvm::GlobalVariable(
 3209   llvm::GlobalVariable *TransferMedium =
 3214     TransferMedium = new llvm::GlobalVariable(
 3215         M, Ty, /*isConstant=*/false, llvm::GlobalVariable::CommonLinkage,
 3217         /*InsertBefore=*/nullptr, llvm::GlobalVariable::NotThreadLocal,
 4363       KernelTeamsReductionPtr = new llvm::GlobalVariable(
 4752       auto *GV = new llvm::GlobalVariable(
 4752       auto *GV = new llvm::GlobalVariable(
 4764       auto *GV = new llvm::GlobalVariable(
 4764       auto *GV = new llvm::GlobalVariable(
 4777       auto *GV = new llvm::GlobalVariable(
 4777       auto *GV = new llvm::GlobalVariable(
 5125       auto *GV = new llvm::GlobalVariable(
 5125       auto *GV = new llvm::GlobalVariable(
 5155       auto *GV = new llvm::GlobalVariable(
 5155       auto *GV = new llvm::GlobalVariable(
 5190     auto *GV = new llvm::GlobalVariable(
 5190     auto *GV = new llvm::GlobalVariable(
tools/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.h
  476     llvm::GlobalVariable *UseSharedMemory = nullptr;
  477     llvm::GlobalVariable *RecSize = nullptr;
  478     llvm::GlobalVariable *Buffer = nullptr;
  484   llvm::GlobalVariable *KernelTeamsReductionPtr = nullptr;
  492   llvm::GlobalVariable *KernelStaticGlobalized = nullptr;
tools/clang/lib/CodeGen/CGStmt.cpp
 1056     auto *SLocPtr =
 1057         new llvm::GlobalVariable(CGM.getModule(), SLoc->getType(), false,
 1058                                  llvm::GlobalVariable::PrivateLinkage, SLoc);
tools/clang/lib/CodeGen/CGVTT.cpp
   20 static llvm::GlobalVariable *
   24                    llvm::GlobalVariable::LinkageTypes Linkage,
   41 CodeGenVTables::EmitVTTDefinition(llvm::GlobalVariable *VTT,
   42                                   llvm::GlobalVariable::LinkageTypes Linkage,
   50   SmallVector<llvm::GlobalVariable *, 8> VTables;
   63     llvm::GlobalVariable *VTable = VTables[i->VTableIndex];
  105 llvm::GlobalVariable *CodeGenVTables::GetAddrOfVTT(const CXXRecordDecl *RD) {
  123   llvm::GlobalVariable *GV = CGM.CreateOrReplaceCXXRuntimeVariable(
tools/clang/lib/CodeGen/CGVTables.cpp
  754 llvm::GlobalVariable *
  758                                    llvm::GlobalVariable::LinkageTypes Linkage,
  785   if (Linkage == llvm::GlobalVariable::AvailableExternallyLinkage)
  786     Linkage = llvm::GlobalVariable::InternalLinkage;
  791   llvm::GlobalVariable *VTable =
  825 llvm::GlobalVariable::LinkageTypes
  828     return llvm::GlobalVariable::InternalLinkage;
  848           return llvm::GlobalVariable::AvailableExternallyLinkage;
  852                    llvm::GlobalVariable::LinkOnceODRLinkage :
  855         return llvm::GlobalVariable::ExternalLinkage;
  859                  llvm::GlobalVariable::LinkOnceODRLinkage :
  864                  llvm::GlobalVariable::WeakODRLinkage :
  877   llvm::GlobalVariable::LinkageTypes DiscardableODRLinkage =
  879   llvm::GlobalVariable::LinkageTypes NonDiscardableODRLinkage =
  886     DiscardableODRLinkage = llvm::GlobalVariable::AvailableExternallyLinkage;
  887     NonDiscardableODRLinkage = llvm::GlobalVariable::AvailableExternallyLinkage;
  902                  ? llvm::GlobalVariable::AvailableExternallyLinkage
  903                  : llvm::GlobalVariable::ExternalLinkage;
 1067                                            llvm::GlobalVariable *VTable,
tools/clang/lib/CodeGen/CGVTables.h
   97   llvm::GlobalVariable *
  100                              llvm::GlobalVariable::LinkageTypes Linkage,
  105   llvm::GlobalVariable *GetAddrOfVTT(const CXXRecordDecl *RD);
  108   void EmitVTTDefinition(llvm::GlobalVariable *VTT,
  109                          llvm::GlobalVariable::LinkageTypes Linkage,
tools/clang/lib/CodeGen/CodeGenFunction.cpp
  509   auto *GV = new llvm::GlobalVariable(CGM.getModule(), Addr->getType(),
  509   auto *GV = new llvm::GlobalVariable(CGM.getModule(), Addr->getType(),
 1668     llvm::GlobalVariable *NullVariable =
 1669       new llvm::GlobalVariable(CGM.getModule(), NullConstant->getType(),
 1671                                llvm::GlobalVariable::PrivateLinkage,
tools/clang/lib/CodeGen/CodeGenFunction.h
 3936   llvm::GlobalVariable *
 3938                                 llvm::GlobalVariable *GV);
 3964   void EmitCXXGuardedInit(const VarDecl &D, llvm::GlobalVariable *DeclPtr,
 3991                                         llvm::GlobalVariable *Addr,
tools/clang/lib/CodeGen/CodeGenModule.cpp
  792     if (GV->isDeclarationForLinker() && isa<llvm::GlobalVariable>(GV) &&
  839   if (auto *Var = dyn_cast<llvm::GlobalVariable>(GV))
  839   if (auto *Var = dyn_cast<llvm::GlobalVariable>(GV))
  873       GV->setDLLStorageClass(llvm::GlobalVariable::DLLImportStorageClass);
  875       GV->setDLLStorageClass(llvm::GlobalVariable::DLLExportStorageClass);
  898 static llvm::GlobalVariable::ThreadLocalMode GetLLVMTLSModel(StringRef S) {
  900       .Case("global-dynamic", llvm::GlobalVariable::GeneralDynamicTLSModel)
  901       .Case("local-dynamic", llvm::GlobalVariable::LocalDynamicTLSModel)
  902       .Case("initial-exec", llvm::GlobalVariable::InitialExecTLSModel)
  903       .Case("local-exec", llvm::GlobalVariable::LocalExecTLSModel);
  906 static llvm::GlobalVariable::ThreadLocalMode GetLLVMTLSModel(
  910     return llvm::GlobalVariable::GeneralDynamicTLSModel;
  912     return llvm::GlobalVariable::LocalDynamicTLSModel;
  914     return llvm::GlobalVariable::InitialExecTLSModel;
  916     return llvm::GlobalVariable::LocalExecTLSModel;
 1711     if (auto *GV = dyn_cast<llvm::GlobalVariable>(GO)) {
 1711     if (auto *GV = dyn_cast<llvm::GlobalVariable>(GO)) {
 1916   auto *GV = new llvm::GlobalVariable(
 1916   auto *GV = new llvm::GlobalVariable(
 2167   auto *gv = new llvm::GlobalVariable(getModule(), Array->getType(), false,
 2167   auto *gv = new llvm::GlobalVariable(getModule(), Array->getType(), false,
 2180   auto *gv =
 2181       new llvm::GlobalVariable(getModule(), s->getType(), true,
 2250 bool CodeGenModule::isInSanitizerBlacklist(llvm::GlobalVariable *GV,
 2368   if (llvm::GlobalVariable *GV = getModule().getNamedGlobal(Name))
 2374   auto *GV = new llvm::GlobalVariable(
 2374   auto *GV = new llvm::GlobalVariable(
 3462   auto *GV = new llvm::GlobalVariable(
 3462   auto *GV = new llvm::GlobalVariable(
 3465       llvm::GlobalVariable::NotThreadLocal, TargetAddrSpace);
 3557               auto *NewGV = cast<llvm::GlobalVariable>(
 3557               auto *NewGV = cast<llvm::GlobalVariable>(
 3614 llvm::GlobalVariable *CodeGenModule::CreateOrReplaceCXXRuntimeVariable(
 3617   llvm::GlobalVariable *GV = getModule().getNamedGlobal(Name);
 3618   llvm::GlobalVariable *OldGV = nullptr;
 3632   GV = new llvm::GlobalVariable(getModule(), Ty, /*isConstant=*/true,
 3772                                        llvm::GlobalVariable *GV) {
 3945   auto *GV = dyn_cast<llvm::GlobalVariable>(Entry);
 3945   auto *GV = dyn_cast<llvm::GlobalVariable>(Entry);
 3964     GV = cast<llvm::GlobalVariable>(
 4054       !llvm::GlobalVariable::isLinkOnceLinkage(Linkage) &&
 4055       !llvm::GlobalVariable::isWeakLinkage(Linkage))
 4060     GV->setDLLStorageClass(llvm::GlobalVariable::DLLImportStorageClass);
 4062     GV->setDLLStorageClass(llvm::GlobalVariable::DLLExportStorageClass);
 4064     GV->setDLLStorageClass(llvm::GlobalVariable::DefaultStorageClass);
 4066   if (Linkage == llvm::GlobalVariable::CommonLinkage) {
 4074       GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage);
 4182       return llvm::GlobalVariable::WeakODRLinkage;
 4184       return llvm::GlobalVariable::WeakAnyLinkage;
 4189       return llvm::GlobalVariable::LinkOnceAnyLinkage;
 4233     return llvm::GlobalVariable::CommonLinkage;
 4240     return llvm::GlobalVariable::WeakODRLinkage;
 4244   return llvm::GlobalVariable::ExternalLinkage;
 4581 static llvm::StringMapEntry<llvm::GlobalVariable *> &
 4582 GetConstantCFStringEntry(llvm::StringMap<llvm::GlobalVariable *> &Map,
 4619   llvm::StringMapEntry<llvm::GlobalVariable *> &Entry =
 4624   if (auto *C = Entry.second)
 4735   auto *GV =
 4736       new llvm::GlobalVariable(getModule(), C->getType(), /*isConstant=*/true,
 4786                                     llvm::GlobalVariable::PrivateLinkage);
 4884 static llvm::GlobalVariable *
 4893   auto *GV = new llvm::GlobalVariable(
 4893   auto *GV = new llvm::GlobalVariable(
 4895       nullptr, llvm::GlobalVariable::NotThreadLocal, AddrSpace);
 4915   llvm::GlobalVariable **Entry = nullptr;
 4978   llvm::GlobalVariable **Entry = nullptr;
 5066   if (Linkage == llvm::GlobalVariable::ExternalLinkage) {
 5072       Linkage = llvm::GlobalVariable::LinkOnceODRLinkage;
 5076       Linkage = llvm::GlobalVariable::InternalLinkage;
 5080   auto *GV = new llvm::GlobalVariable(
 5080   auto *GV = new llvm::GlobalVariable(
 5082       /*InsertBefore=*/nullptr, llvm::GlobalVariable::NotThreadLocal, TargetAS);
 5845 void CodeGenModule::AddVTableTypeMetadata(llvm::GlobalVariable *VTable,
tools/clang/lib/CodeGen/CodeGenModule.h
  367   llvm::DenseMap<const VarDecl*, llvm::GlobalVariable*> InitializerConstants;
  411   llvm::StringMap<llvm::GlobalVariable *> CFConstantStringMap;
  413   llvm::DenseMap<llvm::Constant *, llvm::GlobalVariable *> ConstantStringMap;
  415   llvm::DenseMap<const Decl*, llvm::GlobalVariable*> StaticLocalDeclGuardMap;
  503   llvm::DenseMap<const CompoundLiteralExpr *, llvm::GlobalVariable *>
  622   llvm::GlobalVariable *getStaticLocalDeclGuardAddress(const VarDecl *D) {
  626                                       llvm::GlobalVariable *C) {
  801   llvm::GlobalVariable *
  947   llvm::GlobalVariable *
  953                                         llvm::GlobalVariable *GV);
 1180   llvm::GlobalVariable::LinkageTypes getFunctionLinkage(GlobalDecl GD);
 1188   llvm::GlobalVariable::LinkageTypes getVTableLinkage(const CXXRecordDecl *RD);
 1232   bool isInSanitizerBlacklist(llvm::GlobalVariable *GV, SourceLocation Loc,
 1303                               llvm::GlobalVariable *VTable,
 1331   void AddVTableTypeMetadata(llvm::GlobalVariable *VTable, CharUnits Offset,
 1424                                     llvm::GlobalVariable *Addr,
 1427   void EmitPointerToInitFunc(const VarDecl *VD, llvm::GlobalVariable *Addr,
tools/clang/lib/CodeGen/CodeGenPGO.h
   31   llvm::GlobalVariable *FuncNameVar;
tools/clang/lib/CodeGen/ConstantEmitter.h
   47   llvm::SmallVector<std::pair<llvm::Constant *, llvm::GlobalVariable*>, 4>
   78   void finalize(llvm::GlobalVariable *global);
tools/clang/lib/CodeGen/ConstantInitBuilder.cpp
   38 void ConstantInitFuture::installInGlobal(llvm::GlobalVariable *GV) {
   66 llvm::GlobalVariable *
   73   auto GV = new llvm::GlobalVariable(CGM.getModule(),
   87 void ConstantInitBuilderBase::setGlobalInitializer(llvm::GlobalVariable *GV,
   95 void ConstantInitBuilderBase::resolveSelfReferences(llvm::GlobalVariable *GV) {
  152     new llvm::GlobalVariable(Builder.CGM.getModule(), type, true,
  153                              llvm::GlobalVariable::PrivateLinkage,
tools/clang/lib/CodeGen/CoverageMappingGen.cpp
 1321     llvm::GlobalVariable *NamePtr, StringRef NameValue, uint64_t FuncHash,
 1440   auto CovData = new llvm::GlobalVariable(
 1456     new llvm::GlobalVariable(CGM.getModule(), NamesArrTy, true,
tools/clang/lib/CodeGen/CoverageMappingGen.h
   68   void addFunctionMappingRecord(llvm::GlobalVariable *FunctionName,
tools/clang/lib/CodeGen/ItaniumCXXABI.cpp
   44   llvm::DenseMap<const CXXRecordDecl *, llvm::GlobalVariable *> VTables;
  260   llvm::GlobalVariable *getAddrOfVTable(const CXXRecordDecl *RD,
  315                        llvm::GlobalVariable *DeclPtr,
 1635   llvm::GlobalVariable *VTable = getAddrOfVTable(RD, CharUnits());
 1641   llvm::GlobalVariable::LinkageTypes Linkage = CGM.getVTableLinkage(RD);
 1740 llvm::GlobalVariable *ItaniumCXXABI::getAddrOfVTable(const CXXRecordDecl *RD,
 1744   llvm::GlobalVariable *&VTable = VTables[RD];
 1845   llvm::GlobalVariable *VTT = VTables.GetAddrOfVTT(RD);
 2157     llvm::GlobalVariable *Guard;
 2158     CallGuardAbort(llvm::GlobalVariable *Guard) : Guard(Guard) {}
 2171                                     llvm::GlobalVariable *var,
 2213   llvm::GlobalVariable *guard = CGM.getStaticLocalDeclGuardAddress(&D);
 2224     guard = new llvm::GlobalVariable(CGM.getModule(), guardTy,
 2499     if (!llvm::GlobalVariable::isLinkOnceLinkage(VarLinkage) &&
 2500         !llvm::GlobalVariable::isWeakODRLinkage(VarLinkage))
 2537         llvm::GlobalVariable::isLinkOnceLinkage(Wrapper->getLinkage()) ||
 2538         llvm::GlobalVariable::isWeakODRLinkage(Wrapper->getLinkage()) ||
 2578     llvm::GlobalVariable *Guard = new llvm::GlobalVariable(
 2578     llvm::GlobalVariable *Guard = new llvm::GlobalVariable(
 2580         llvm::GlobalVariable::InternalLinkage,
 2609     llvm::GlobalVariable *Var =
 2610         cast<llvm::GlobalVariable>(CGM.GetGlobalValue(CGM.getMangledName(VD)));
 2661                                     llvm::GlobalVariable::ExternalWeakLinkage,
 2765   llvm::GlobalVariable *
 2766   GetAddrOfTypeName(QualType Ty, llvm::GlobalVariable::LinkageTypes Linkage);
 2850       llvm::GlobalVariable::LinkageTypes Linkage,
 2856 llvm::GlobalVariable *ItaniumRTTIBuilder::GetAddrOfTypeName(
 2857     QualType Ty, llvm::GlobalVariable::LinkageTypes Linkage) {
 2869   llvm::GlobalVariable *GV = CGM.CreateOrReplaceCXXRuntimeVariable(
 2885   llvm::GlobalVariable *GV = CGM.getModule().getNamedGlobal(Name);
 2892     GV = new llvm::GlobalVariable(CGM.getModule(), CGM.Int8PtrTy,
 3276 static llvm::GlobalVariable::LinkageTypes getTypeInfoLinkage(CodeGenModule &CGM,
 3337   llvm::GlobalVariable *OldGV = CGM.getModule().getNamedGlobal(Name);
 3351   llvm::GlobalVariable::LinkageTypes Linkage = getTypeInfoLinkage(CGM, Ty);
 3378       llvm::GlobalVariable::LinkageTypes Linkage,
 3385   llvm::GlobalVariable *TypeName = GetAddrOfTypeName(Ty, Linkage);
 3498   llvm::GlobalVariable *OldGV = M.getNamedGlobal(Name);
 3499   llvm::GlobalVariable *GV =
 3500       new llvm::GlobalVariable(M, Init->getType(),
tools/clang/lib/CodeGen/MicrosoftCXXABI.cpp
   39   SmallVector<llvm::GlobalVariable *, 2> Globals;
  123   llvm::GlobalVariable *getMSCompleteObjectLocator(const CXXRecordDecl *RD,
  265                               llvm::GlobalVariable *VTable);
  291   llvm::GlobalVariable *getAddrOfVTable(const CXXRecordDecl *RD,
  313   llvm::GlobalVariable *
  315                    llvm::GlobalVariable::LinkageTypes Linkage);
  317   llvm::GlobalVariable *
  325     if (auto *VDispMap = CGM.getModule().getNamedGlobal(MangledName))
  354     auto *VDispMap = new llvm::GlobalVariable(
  354     auto *VDispMap = new llvm::GlobalVariable(
  361                              llvm::GlobalVariable *GV) const;
  396                        llvm::GlobalVariable *DeclPtr,
  521   llvm::GlobalVariable *getImageBase() {
  523     if (llvm::GlobalVariable *GV = CGM.getModule().getNamedGlobal(Name))
  526     auto *GV = new llvm::GlobalVariable(CGM.getModule(), CGM.Int8Ty,
  526     auto *GV = new llvm::GlobalVariable(CGM.getModule(), CGM.Int8Ty,
  754   llvm::GlobalVariable *getCatchableTypeArray(QualType T);
  756   llvm::GlobalVariable *getThrowInfo(QualType T) override;
  764   typedef llvm::DenseMap<VFTableIdTy, llvm::GlobalVariable *> VTablesMapTy;
  781     llvm::GlobalVariable *Guard;
  796   llvm::DenseMap<QualType, llvm::GlobalVariable *> CatchableTypeArrays;
 1243     llvm::GlobalVariable *GV = VBGlobals.Globals[I];
 1608                                              llvm::GlobalVariable *VTable) {
 1660     llvm::GlobalVariable *VTable = getAddrOfVTable(RD, Info->FullOffsetInMDC);
 1719 llvm::GlobalVariable *MicrosoftCXXABI::getAddrOfVTable(const CXXRecordDecl *RD,
 1732   llvm::GlobalVariable *&VTable = I->second;
 1788                  ? cast<llvm::GlobalVariable>(
 1790                  : cast<llvm::GlobalVariable>(VFTable);
 1806   VTable = new llvm::GlobalVariable(CGM.getModule(), VTableType,
 1955   llvm::GlobalVariable::LinkageTypes Linkage = CGM.getVTableLinkage(RD);
 2041     llvm::GlobalVariable *GV = VBGlobals.Globals[I];
 2047 llvm::GlobalVariable *
 2049                                   llvm::GlobalVariable::LinkageTypes Linkage) {
 2062   llvm::GlobalVariable *GV = CGM.CreateOrReplaceCXXRuntimeVariable(
 2079                                             llvm::GlobalVariable *GV) const {
 2123     GV->setLinkage(llvm::GlobalVariable::AvailableExternallyLinkage);
 2305     llvm::GlobalVariable *InitFuncPtr = new llvm::GlobalVariable(
 2305     llvm::GlobalVariable *InitFuncPtr = new llvm::GlobalVariable(
 2307         llvm::GlobalVariable::InternalLinkage, InitFunc,
 2318     llvm::GlobalVariable *GV = cast<llvm::GlobalVariable>(
 2318     llvm::GlobalVariable *GV = cast<llvm::GlobalVariable>(
 2351   if (auto *GV = CGM.getModule().getNamedGlobal(VarName))
 2353   auto *GV = new llvm::GlobalVariable(
 2353   auto *GV = new llvm::GlobalVariable(
 2355       /*isConstant=*/false, llvm::GlobalVariable::ExternalLinkage,
 2357       /*InsertBefore=*/nullptr, llvm::GlobalVariable::GeneralDynamicTLSModel);
 2428                                       llvm::GlobalVariable *GV,
 2460   llvm::GlobalVariable *GuardVar = GI ? GI->Guard : nullptr;
 2497         new llvm::GlobalVariable(CGM.getModule(), GuardTy, /*isConstant=*/false,
 3223     if (llvm::GlobalVariable *VDispMap =
 3410 static llvm::GlobalVariable *getTypeInfoVTable(CodeGenModule &CGM) {
 3414   return new llvm::GlobalVariable(CGM.getModule(), CGM.Int8PtrTy,
 3416                                   llvm::GlobalVariable::ExternalLinkage,
 3512   llvm::GlobalVariable *getBaseClassDescriptor(const MSRTTIClass &Classes);
 3513   llvm::GlobalVariable *
 3515   llvm::GlobalVariable *getClassHierarchyDescriptor();
 3516   llvm::GlobalVariable *getCompleteObjectLocator(const VPtrInfo &Info);
 3523   llvm::GlobalVariable::LinkageTypes Linkage;
 3561 llvm::GlobalVariable *MSRTTIBuilder::getClassHierarchyDescriptor() {
 3595   auto CHD = new llvm::GlobalVariable(Module, Type, /*isConstant=*/true, Linkage,
 3601   auto *Bases = getBaseClassArray(Classes);
 3616 llvm::GlobalVariable *
 3632   auto *BCA =
 3633       new llvm::GlobalVariable(Module, ArrType,
 3649 llvm::GlobalVariable *
 3676       new llvm::GlobalVariable(Module, Type, /*isConstant=*/true, Linkage,
 3697 llvm::GlobalVariable *
 3722   auto COL = new llvm::GlobalVariable(Module, Type, /*isConstant=*/true, Linkage,
 3816   if (llvm::GlobalVariable *GV = CGM.getModule().getNamedGlobal(MangledName))
 3836   auto *Var = new llvm::GlobalVariable(
 3836   auto *Var = new llvm::GlobalVariable(
 3847 llvm::GlobalVariable *
 4021   if (llvm::GlobalVariable *GV = CGM.getModule().getNamedGlobal(MangledName))
 4075   auto *GV = new llvm::GlobalVariable(
 4075   auto *GV = new llvm::GlobalVariable(
 4085 llvm::GlobalVariable *MicrosoftCXXABI::getCatchableTypeArray(QualType T) {
 4089   llvm::GlobalVariable *&CTA = CatchableTypeArrays[T];
 4193   CTA = new llvm::GlobalVariable(
 4203 llvm::GlobalVariable *MicrosoftCXXABI::getThrowInfo(QualType T) {
 4209   llvm::GlobalVariable *CTA = getCatchableTypeArray(T);
 4227   if (llvm::GlobalVariable *GV = CGM.getModule().getNamedGlobal(MangledName))
 4262   auto *GV = new llvm::GlobalVariable(
 4262   auto *GV = new llvm::GlobalVariable(
 4283   llvm::GlobalVariable *TI = getThrowInfo(ThrowType);
tools/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
  278     auto *ASTSym = new llvm::GlobalVariable(
  278     auto *ASTSym = new llvm::GlobalVariable(
  279         *M, Ty, /*constant*/ true, llvm::GlobalVariable::InternalLinkage, Data,
tools/clang/lib/CodeGen/SanitizerMetadata.cpp
   29 void SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
   62 void SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
   78 void SanitizerMetadata::disableSanitizerForGlobal(llvm::GlobalVariable *GV) {
tools/clang/lib/CodeGen/SanitizerMetadata.h
   39   void reportGlobalToASan(llvm::GlobalVariable *GV, const VarDecl &D,
   41   void reportGlobalToASan(llvm::GlobalVariable *GV, SourceLocation Loc,
   44   void disableSanitizerForGlobal(llvm::GlobalVariable *GV);
tools/clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp
  174   GlobalVariable *createBinDesc(ArrayRef<ArrayRef<char>> Bufs) {
  176     auto *EntriesB = new GlobalVariable(
  176     auto *EntriesB = new GlobalVariable(
  180     auto *EntriesE = new GlobalVariable(
  180     auto *EntriesE = new GlobalVariable(
  192     auto *DummyEntry = new GlobalVariable(
  192     auto *DummyEntry = new GlobalVariable(
  193         M, DummyInit->getType(), true, GlobalVariable::ExternalLinkage,
  206       auto *Image = new GlobalVariable(M, Data->getType(), /*isConstant*/ true,
  206       auto *Image = new GlobalVariable(M, Data->getType(), /*isConstant*/ true,
  207                                        GlobalVariable::InternalLinkage, Data,
  227     auto *Images =
  228         new GlobalVariable(M, ImagesData->getType(), /*isConstant*/ true,
  242     return new GlobalVariable(M, DescInit->getType(), /*isConstant*/ true,
  247   void createRegisterFunction(GlobalVariable *BinDesc) {
  268   void createUnregisterFunction(GlobalVariable *BinDesc) {
  295     GlobalVariable *Desc = createBinDesc(Binaries);
tools/lldb/source/Expression/IRExecutionUnit.cpp
  385   for (llvm::GlobalVariable &global_var : m_module->getGlobalList()) {
  980   if (llvm::GlobalVariable *global_ctors =
tools/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
  224   GlobalVariable *result_global = dyn_cast<GlobalVariable>(result_value);
  224   GlobalVariable *result_global = dyn_cast<GlobalVariable>(result_value);
  343   GlobalVariable *new_result_global = new GlobalVariable(
  343   GlobalVariable *new_result_global = new GlobalVariable(
  414 bool IRForTarget::RewriteObjCConstString(llvm::GlobalVariable *ns_str,
  415                                          llvm::GlobalVariable *cstr) {
  565       GlobalVariable *nsstring_global =
  566           dyn_cast<GlobalVariable>(nsstring_value);
  647       GlobalVariable *cstr_global = nullptr;
  651         cstr_global = dyn_cast<GlobalVariable>(nsstring_cstr);
  654         cstr_global = dyn_cast<GlobalVariable>(nsstring_cstr);
  736       GlobalVariable *gv = dyn_cast<GlobalVariable>(value_symbol.second);
  736       GlobalVariable *gv = dyn_cast<GlobalVariable>(value_symbol.second);
  759   GlobalVariable *global_variable = dyn_cast<GlobalVariable>(value);
  759   GlobalVariable *global_variable = dyn_cast<GlobalVariable>(value);
  790   GlobalVariable *_objc_selector_references_ =
  791       dyn_cast<GlobalVariable>(load->getPointerOperand());
  812   GlobalVariable *_objc_meth_var_name_ =
  813       dyn_cast<GlobalVariable>(osr_initializer_base);
  920   GlobalVariable *global_variable = dyn_cast<GlobalVariable>(value);
  920   GlobalVariable *global_variable = dyn_cast<GlobalVariable>(value);
  948   GlobalVariable *_objc_class_references_ =
  949       dyn_cast<GlobalVariable>(load->getPointerOperand());
  970   GlobalVariable *_objc_class_name_ =
  971       dyn_cast<GlobalVariable>(ocr_initializer_base);
 1105   GlobalVariable *persistent_global = new GlobalVariable(
 1105   GlobalVariable *persistent_global = new GlobalVariable(
 1200   } else if (GlobalVariable *global_variable =
 1201                  dyn_cast<GlobalVariable>(llvm_value_ptr)) {
 1334   GlobalVariable *global_variable =
 1335       dyn_cast<GlobalVariable>(classlist_reference);
 1436   for (GlobalVariable &global_var : m_module->globals()) {
 1491   GlobalVariable *GV = dyn_cast<GlobalVariable>(Old);
 1491   GlobalVariable *GV = dyn_cast<GlobalVariable>(Old);
 1832       if (GlobalVariable *var = dyn_cast<GlobalVariable>(value))
 1832       if (GlobalVariable *var = dyn_cast<GlobalVariable>(value))
 1887   m_reloc_placeholder = new llvm::GlobalVariable(
 1889       GlobalVariable::InternalLinkage, Constant::getNullValue(int8_ty),
 1891       GlobalVariable::NotThreadLocal /* ThreadLocal */, 0 /* AddressSpace */);
tools/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h
  249   bool RewriteObjCConstString(llvm::GlobalVariable *NSStr,
  250                               llvm::GlobalVariable *CStr);
  477   llvm::GlobalVariable *m_reloc_placeholder; ///< A placeholder that will be
tools/llvm-extract/llvm-extract.cpp
  207     for (auto &GV : M->globals()) {
tools/llvm-reduce/deltas/ReduceGlobalVars.cpp
   23   std::set<GlobalVariable *> GVsToKeep;
   25   for (auto &GV : Program->globals())
   34   std::vector<GlobalVariable *> ToRemove;
   36   for (auto &GV : Program->globals())
   52   for (auto *GV : ToRemove)
   63   for (auto &GV : Program->globals())
tools/llvm-reduce/deltas/ReduceMetadata.cpp
   24 static void getChunkMetadataNodes(T &MDUser, int &I,
   43 static void eraseMetadataIfOutsideChunk(T &MDUser,
   61   for (auto &GV : Program->globals())
   72   for (auto &GV : Program->globals())
  106 static void addMetadataToSet(T &MDUser, std::set<MDNode *> &UnnamedNodes) {
  119   for (auto &GV : Program->globals())
tools/polly/include/polly/CodeGen/LoopGeneratorsKMP.h
  141   GlobalVariable *createSourceLocation();
tools/polly/lib/CodeGen/LoopGeneratorsKMP.cpp
  446 GlobalVariable *ParallelLoopGeneratorKMP::createSourceLocation() {
  448   GlobalVariable *SourceLocDummy = M->getGlobalVariable(LocName);
  469     GlobalVariable *StrVar = new GlobalVariable(
  469     GlobalVariable *StrVar = new GlobalVariable(
  473     SourceLocDummy = new GlobalVariable(
tools/polly/lib/CodeGen/PerfMonitor.cpp
   37   GlobalVariable *GV = M->getGlobalVariable(Name);
   55   GV = new GlobalVariable(*M, Ty, true, GlobalValue::AppendingLinkage,
   57                           GlobalVariable::NotThreadLocal);
   77     *Location = new GlobalVariable(
   79         InitialValue, Name, nullptr, GlobalVariable::InitialExecTLSModel);
tools/verify-uselistorder/verify-uselistorder.cpp
  188   for (const GlobalVariable &G : M.globals())
  198   for (const GlobalVariable &G : M.globals())
  464   for (GlobalVariable &G : M.globals())
  474   for (GlobalVariable &G : M.globals())
unittests/Analysis/BasicAliasAnalysisTest.cpp
   80   auto *GlobalPtr =
   81       cast<GlobalVariable>(M.getOrInsertGlobal("some_global", B.getInt8Ty()));
unittests/Analysis/ScalarEvolutionTest.cpp
   77   Value *V0 = new GlobalVariable(M, Ty, false, GlobalValue::ExternalLinkage, Init, "V0");
   78   Value *V1 = new GlobalVariable(M, Ty, false, GlobalValue::ExternalLinkage, Init, "V1");
   79   Value *V2 = new GlobalVariable(M, Ty, false, GlobalValue::ExternalLinkage, Init, "V2");
unittests/Analysis/SparsePropagation.cpp
  205     auto *GV = dyn_cast<GlobalVariable>(I.getPointerOperand());
  205     auto *GV = dyn_cast<GlobalVariable>(I.getPointerOperand());
  297   GlobalVariable *GV =
  298       new GlobalVariable(M, Builder.getInt64Ty(), false,
  338   GlobalVariable *GV =
  339       new GlobalVariable(M, Builder.getInt64Ty(), false,
unittests/Analysis/ValueTrackingTest.cpp
  941   GlobalVariable *GV = dyn_cast<GlobalVariable>(M->getNamedValue("test"));
  941   GlobalVariable *GV = dyn_cast<GlobalVariable>(M->getNamedValue("test"));
unittests/ExecutionEngine/ExecutionEngineTest.cpp
   40   GlobalVariable *NewExtGlobal(Type *T, const Twine &Name) {
   41     return new GlobalVariable(*M, T, false,  // Not constant.
   52   GlobalVariable *G1 = NewExtGlobal(Type::getInt32Ty(Context), "Global1");
   65   GlobalVariable *G2 = NewExtGlobal(Type::getInt32Ty(Context), "Global1");
   77   GlobalVariable *G1 = NewExtGlobal(Type::getInt32Ty(Context), "Global1");
   87   GlobalVariable *G2 = NewExtGlobal(Type::getInt32Ty(Context), "Global2");
  103   GlobalVariable *G1 = NewExtGlobal(Type::getInt32Ty(Context), "Global1");
  113   GlobalVariable *G2 = NewExtGlobal(Type::getInt32Ty(Context), "Global2");
  121   GlobalVariable *G1 = NewExtGlobal(Type::getInt32Ty(Context), "Global1");
unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp
  204   GlobalVariable *GVA, *GVB, *GVC;
unittests/ExecutionEngine/MCJIT/MCJITTest.cpp
   99   GlobalVariable *GV = insertGlobalInt32(M.get(), "myglob", initialNum);
unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
  128   GlobalVariable *insertGlobalInt32(Module *M,
  133     GlobalVariable *Global = new GlobalVariable(*M,
  133     GlobalVariable *Global = new GlobalVariable(*M,
unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp
   81   GlobalVariable *GV =
   82     new GlobalVariable(*M, Int32Ty, false, GlobalValue::ExternalLinkage,
unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp
   77   GlobalVariable *GV =
   78       new GlobalVariable(*M, Int32Ty, false, GlobalValue::ExternalLinkage,
unittests/IR/ConstantsTest.cpp
  334   Constant *Global = new GlobalVariable(*M, IntTy, false,
  341   GlobalVariable *RefArray =
  342       new GlobalVariable(*M, ArrayTy, false, GlobalValue::ExternalLinkage, A0G);
  354   Constant *G1 = new GlobalVariable(*M, IntTy, false,
  356   Constant *G2 = new GlobalVariable(*M, IntTy, false,
  364   GlobalVariable *Ref =
  365       new GlobalVariable(*M, IntTy, false, GlobalValue::ExternalLinkage, Int1);
  379   auto *Placeholder = new GlobalVariable(
  379   auto *Placeholder = new GlobalVariable(
  384   auto *Ref =
  385       new GlobalVariable(*M, PtrTy, false, GlobalValue::ExternalLinkage, GEP);
  388   auto *Global = new GlobalVariable(*M, PtrTy, false,
  388   auto *Global = new GlobalVariable(*M, PtrTy, false,
  402   GlobalVariable *G = M->getGlobalVariable("g");
  471   auto *G = new GlobalVariable(*M, S, false,
  471   auto *G = new GlobalVariable(*M, S, false,
  574   std::unique_ptr<GlobalVariable> Global(
  575       new GlobalVariable(IntType, true, GlobalValue::ExternalLinkage));
unittests/IR/IRBuilderTest.cpp
   34     GV = new GlobalVariable(*M, Type::getFloatTy(Ctx), true,
   47   GlobalVariable *GV;
  177   GlobalVariable *GVDouble = new GlobalVariable(*M, Type::getDoubleTy(Ctx),
  177   GlobalVariable *GVDouble = new GlobalVariable(*M, Type::getDoubleTy(Ctx),
  588   GlobalVariable *G = new GlobalVariable(*M, Builder.getInt32Ty(), true,
  588   GlobalVariable *G = new GlobalVariable(*M, Builder.getInt32Ty(), true,
unittests/IR/MetadataTest.cpp
  491   std::unique_ptr<GlobalVariable> GV(
  492       new GlobalVariable(Ty, false, GlobalValue::ExternalLinkage));
  730   std::unique_ptr<GlobalVariable> GV(
  731       new GlobalVariable(Ty, false, GlobalValue::ExternalLinkage));
  753   std::unique_ptr<GlobalVariable> GV(
  754       new GlobalVariable(Ty, false, GlobalValue::ExternalLinkage));
  766   std::unique_ptr<GlobalVariable> GV2(
  767       new GlobalVariable(Ty, false, GlobalValue::ExternalLinkage));
 2530   std::unique_ptr<GlobalVariable> GV0(
 2531       new GlobalVariable(Ty, false, GlobalValue::ExternalLinkage));
 2536   std::unique_ptr<GlobalVariable> GV1(
 2537       new GlobalVariable(Ty, false, GlobalValue::ExternalLinkage));
 2591   std::unique_ptr<GlobalVariable> GV0(
 2592       new GlobalVariable(Ty, false, GlobalValue::ExternalLinkage));
 2597   std::unique_ptr<GlobalVariable> GV1(
 2598       new GlobalVariable(Ty, false, GlobalValue::ExternalLinkage));
 2608   std::unique_ptr<GlobalVariable> GV(
 2609       new GlobalVariable(Ty, false, GlobalValue::ExternalLinkage));
unittests/IR/ModuleTest.cpp
   21 bool sortByName(const GlobalVariable &L, const GlobalVariable &R) {
   21 bool sortByName(const GlobalVariable &L, const GlobalVariable &R) {
   25 bool sortByNameReverse(const GlobalVariable &L, const GlobalVariable &R) {
   25 bool sortByNameReverse(const GlobalVariable &L, const GlobalVariable &R) {
   35     (void)new GlobalVariable(M, T, false, L, nullptr, "A");
   36     (void)new GlobalVariable(M, T, false, L, nullptr, "F");
   37     (void)new GlobalVariable(M, T, false, L, nullptr, "G");
   38     (void)new GlobalVariable(M, T, false, L, nullptr, "E");
   39     (void)new GlobalVariable(M, T, false, L, nullptr, "B");
   40     (void)new GlobalVariable(M, T, false, L, nullptr, "H");
   41     (void)new GlobalVariable(M, T, false, L, nullptr, "C");
   42     (void)new GlobalVariable(M, T, false, L, nullptr, "D");
unittests/IR/ValueTest.cpp
   52   GlobalVariable *Dummy0
   53     = new GlobalVariable(*M,
   60                          GlobalVariable::NotThreadLocal,
   74   GlobalVariable *DummyCast0
   75     = new GlobalVariable(*M,
   82                          GlobalVariable::NotThreadLocal,
   98   GlobalVariable *Var =
   99       new GlobalVariable(*M, Int32Ty, true, GlobalValue::ExternalLinkage,
  101                          GlobalVariable::NotThreadLocal, 1);
  140   GlobalVariable *G0 = M->getGlobalVariable("g0");
  142   GlobalVariable *G1 = M->getGlobalVariable("g1");
unittests/IR/VerifierTest.cpp
  126   new GlobalVariable(M, Type::getInt8Ty(C), false,
  173     new GlobalVariable(M, Type::getInt8Ty(C), false,
unittests/Linker/LinkModulesTest.cpp
   42     GV = new GlobalVariable(*M.get(), AT, false /*=isConstant*/,
   67   GlobalVariable *GV;
  104   const GlobalVariable *LinkedGV = LinkedModule->getNamedGlobal("switch.bas");
  163   GlobalVariable *GV =
  164       new GlobalVariable(*InternalM, STy, false /*=isConstant*/,
unittests/Transforms/Utils/CloningTest.cpp
  725     auto GV = new GlobalVariable(
  804   GlobalVariable *NewGV = NewM->getGlobalVariable("gv");
  809   GlobalVariable *NewGV = NewM->getGlobalVariable("gv");
  855   GlobalVariable *NewGV = NewM->getGlobalVariable("gv");
unittests/Transforms/Utils/ValueMapperTest.cpp
   69   std::unique_ptr<GlobalVariable> G0 = std::make_unique<GlobalVariable>(
   69   std::unique_ptr<GlobalVariable> G0 = std::make_unique<GlobalVariable>(
   71   std::unique_ptr<GlobalVariable> G1 = std::make_unique<GlobalVariable>(
   71   std::unique_ptr<GlobalVariable> G1 = std::make_unique<GlobalVariable>(
usr/include/c++/7.4.0/bits/unique_ptr.h
   68         default_delete(const default_delete<_Up>&) noexcept { }
   72       operator()(_Tp* __ptr) const
   74 	static_assert(!is_void<_Tp>::value,
   76 	static_assert(sizeof(_Tp)>0,
  122 	  using type = _Up*;
  137       using pointer = typename _Ptr<_Tp, _Dp>::type;
  161 	typename __uniq_ptr_impl<_Tp, _Up>::_DeleterConstraint::type;
  163       __uniq_ptr_impl<_Tp, _Dp> _M_t;
  166       using pointer	  = typename __uniq_ptr_impl<_Tp, _Dp>::pointer;
  167       using element_type  = _Tp;
  252 	unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
  297           __safe_conversion_up<_Up, _Ep>,
  301 	operator=(unique_ptr<_Up, _Ep>&& __u) noexcept
  811     { typedef unique_ptr<_Tp> __single_object; };
  823     inline typename _MakeUniq<_Tp>::__single_object
  825     { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
usr/include/c++/7.4.0/type_traits
  215     : public __is_void_helper<typename remove_cv<_Tp>::type>::type
  581     : public __or_<is_lvalue_reference<_Tp>,
  582                    is_rvalue_reference<_Tp>>::type
  601     : public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
  601     : public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
  602                           is_void<_Tp>>>::type
  638     : public __or_<is_object<_Tp>, is_reference<_Tp>>::type
  638     : public __or_<is_object<_Tp>, is_reference<_Tp>>::type
 1554     { typedef _Tp     type; };
 1563     { typedef _Tp     type; };
 1574       remove_const<typename remove_volatile<_Tp>::type>::type     type;
 1645     { typedef _Tp&   type; };
 1650     : public __add_lvalue_reference_helper<_Tp>
 1983     { typedef _Up     type; };
utils/unittest/googletest/include/gtest/gtest-printers.h
  407                     T* p, ::std::ostream* os) {
  416     if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
utils/unittest/googletest/include/gtest/gtest.h
 1475       T* rhs) {