llvm.org GIT mirror llvm / 3a163b7
Style update: don't duplicate the function name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208224 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
1 changed file(s) with 64 addition(s) and 70 deletion(s). Raw diff Collapse all Expand all
284284 /// @name Generic Value Accessors
285285 /// @{
286286
287 /// getNamedValue - Return the global value in the module with
288 /// the specified name, of arbitrary type. This method returns null
289 /// if a global with the specified name is not found.
287 /// Return the global value in the module with the specified name, of
288 /// arbitrary type. This method returns null if a global with the specified
289 /// name is not found.
290290 GlobalValue *getNamedValue(StringRef Name) const;
291291
292 /// getMDKindID - Return a unique non-zero ID for the specified metadata kind.
293 /// This ID is uniqued across modules in the current LLVMContext.
292 /// Return a unique non-zero ID for the specified metadata kind. This ID is
293 /// uniqued across modules in the current LLVMContext.
294294 unsigned getMDKindID(StringRef Name) const;
295295
296 /// getMDKindNames - Populate client supplied SmallVector with the name for
297 /// custom metadata IDs registered in this LLVMContext.
296 /// Populate client supplied SmallVector with the name for custom metadata IDs
297 /// registered in this LLVMContext.
298298 void getMDKindNames(SmallVectorImpl &Result) const;
299299
300
300
301301 typedef DenseMap >
302302 NumeredTypesMapTy;
303303
304 /// getTypeByName - Return the type with the specified name, or null if there
305 /// is none by that name.
304 /// Return the type with the specified name, or null if there is none by that
305 /// name.
306306 StructType *getTypeByName(StringRef Name) const;
307307
308308 /// @}
309309 /// @name Function Accessors
310310 /// @{
311311
312 /// getOrInsertFunction - Look up the specified function in the module symbol
313 /// table. Four possibilities:
312 /// Look up the specified function in the module symbol table. Four
313 /// possibilities:
314314 /// 1. If it does not exist, add a prototype for the function and return it.
315315 /// 2. If it exists, and has a local linkage, the existing function is
316316 /// renamed and a new one is inserted.
323323
324324 Constant *getOrInsertFunction(StringRef Name, FunctionType *T);
325325
326 /// getOrInsertFunction - Look up the specified function in the module symbol
327 /// table. If it does not exist, add a prototype for the function and return
328 /// it. This function guarantees to return a constant of pointer to the
329 /// specified function type or a ConstantExpr BitCast of that type if the
330 /// named function has a different type. This version of the method takes a
331 /// null terminated list of function arguments, which makes it easier for
332 /// clients to use.
326 /// Look up the specified function in the module symbol table. If it does not
327 /// exist, add a prototype for the function and return it. This function
328 /// guarantees to return a constant of pointer to the specified function type
329 /// or a ConstantExpr BitCast of that type if the named function has a
330 /// different type. This version of the method takes a null terminated list of
331 /// function arguments, which makes it easier for clients to use.
333332 Constant *getOrInsertFunction(StringRef Name,
334333 AttributeSet AttributeList,
335334 Type *RetTy, ...) END_WITH_NULL;
336335
337 /// getOrInsertFunction - Same as above, but without the attributes.
336 /// Same as above, but without the attributes.
338337 Constant *getOrInsertFunction(StringRef Name, Type *RetTy, ...)
339338 END_WITH_NULL;
340339
341 /// getFunction - Look up the specified function in the module symbol table.
342 /// If it does not exist, return null.
340 /// Look up the specified function in the module symbol table. If it does not
341 /// exist, return null.
343342 Function *getFunction(StringRef Name) const;
344343
345344 /// @}
346345 /// @name Global Variable Accessors
347346 /// @{
348347
349 /// getGlobalVariable - Look up the specified global variable in the module
350 /// symbol table. If it does not exist, return null. If AllowInternal is set
351 /// to true, this function will return types that have InternalLinkage. By
352 /// default, these types are not returned.
348 /// Look up the specified global variable in the module symbol table. If it
349 /// does not exist, return null. If AllowInternal is set to true, this
350 /// function will return types that have InternalLinkage. By default, these
351 /// types are not returned.
353352 const GlobalVariable *getGlobalVariable(StringRef Name,
354353 bool AllowInternal = false) const {
355354 return const_cast(this)->getGlobalVariable(Name, AllowInternal);
357356
358357 GlobalVariable *getGlobalVariable(StringRef Name, bool AllowInternal = false);
359358
360 /// getNamedGlobal - Return the global variable in the module with the
361 /// specified name, of arbitrary type. This method returns null if a global
362 /// with the specified name is not found.
359 /// Return the global variable in the module with the specified name, of
360 /// arbitrary type. This method returns null if a global with the specified
361 /// name is not found.
363362 GlobalVariable *getNamedGlobal(StringRef Name) {
364363 return getGlobalVariable(Name, true);
365364 }
367366 return const_cast(this)->getNamedGlobal(Name);
368367 }
369368
370 /// getOrInsertGlobal - Look up the specified global in the module symbol
371 /// table.
369 /// Look up the specified global in the module symbol table.
372370 /// 1. If it does not exist, add a declaration of the global and return it.
373371 /// 2. Else, the global exists but has the wrong type: return the function
374372 /// with a constantexpr cast to the right type.
380378 /// @name Global Alias Accessors
381379 /// @{
382380
383 /// getNamedAlias - Return the global alias in the module with the
384 /// specified name, of arbitrary type. This method returns null if a global
385 /// with the specified name is not found.
381 /// Return the global alias in the module with the specified name, of
382 /// arbitrary type. This method returns null if a global with the specified
383 /// name is not found.
386384 GlobalAlias *getNamedAlias(StringRef Name) const;
387385
388386 /// @}
389387 /// @name Named Metadata Accessors
390388 /// @{
391389
392 /// getNamedMetadata - Return the first NamedMDNode in the module with the
393 /// specified name. This method returns null if a NamedMDNode with the
394 /// specified name is not found.
390 /// Return the first NamedMDNode in the module with the specified name. This
391 /// method returns null if a NamedMDNode with the specified name is not found.
395392 NamedMDNode *getNamedMetadata(const Twine &Name) const;
396393
397 /// getOrInsertNamedMetadata - Return the named MDNode in the module
398 /// with the specified name. This method returns a new NamedMDNode if a
399 /// NamedMDNode with the specified name is not found.
394 /// Return the named MDNode in the module with the specified name. This method
395 /// returns a new NamedMDNode if a NamedMDNode with the specified name is not
396 /// found.
400397 NamedMDNode *getOrInsertNamedMetadata(StringRef Name);
401398
402 /// eraseNamedMetadata - Remove the given NamedMDNode from this module
403 /// and delete it.
399 /// Remove the given NamedMDNode from this module and delete it.
404400 void eraseNamedMetadata(NamedMDNode *NMD);
405401
406402 /// @}
407403 /// @name Module Flags Accessors
408404 /// @{
409405
410 /// getModuleFlagsMetadata - Returns the module flags in the provided vector.
406 /// Returns the module flags in the provided vector.
411407 void getModuleFlagsMetadata(SmallVectorImpl &Flags) const;
412408
413409 /// Return the corresponding value if Key appears in module flags, otherwise
414410 /// return null.
415411 Value *getModuleFlag(StringRef Key) const;
416412
417 /// getModuleFlagsMetadata - Returns the NamedMDNode in the module that
418 /// represents module-level flags. This method returns null if there are no
419 /// module-level flags.
413 /// Returns the NamedMDNode in the module that represents module-level flags.
414 /// This method returns null if there are no module-level flags.
420415 NamedMDNode *getModuleFlagsMetadata() const;
421416
422 /// getOrInsertModuleFlagsMetadata - Returns the NamedMDNode in the module
423 /// that represents module-level flags. If module-level flags aren't found,
424 /// it creates the named metadata that contains them.
417 /// Returns the NamedMDNode in the module that represents module-level flags.
418 /// If module-level flags aren't found, it creates the named metadata that
419 /// contains them.
425420 NamedMDNode *getOrInsertModuleFlagsMetadata();
426421
427 /// addModuleFlag - Add a module-level flag to the module-level flags
428 /// metadata. It will create the module-level flags named metadata if it
429 /// doesn't already exist.
422 /// Add a module-level flag to the module-level flags metadata. It will create
423 /// the module-level flags named metadata if it doesn't already exist.
430424 void addModuleFlag(ModFlagBehavior Behavior, StringRef Key, Value *Val);
431425 void addModuleFlag(ModFlagBehavior Behavior, StringRef Key, uint32_t Val);
432426 void addModuleFlag(MDNode *Node);
435429 /// @name Materialization
436430 /// @{
437431
438 /// setMaterializer - Sets the GVMaterializer to GVM. This module must not
439 /// yet have a Materializer. To reset the materializer for a module that
440 /// already has one, call MaterializeAllPermanently first. Destroying this
441 /// module will destroy its materializer without materializing any more
442 /// GlobalValues. Without destroying the Module, there is no way to detach or
443 /// destroy a materializer without materializing all the GVs it controls, to
444 /// avoid leaving orphan unmaterialized GVs.
432 /// Sets the GVMaterializer to GVM. This module must not yet have a
433 /// Materializer. To reset the materializer for a module that already has one,
434 /// call MaterializeAllPermanently first. Destroying this module will destroy
435 /// its materializer without materializing any more GlobalValues. Without
436 /// destroying the Module, there is no way to detach or destroy a materializer
437 /// without materializing all the GVs it controls, to avoid leaving orphan
438 /// unmaterialized GVs.
445439 void setMaterializer(GVMaterializer *GVM);
446 /// getMaterializer - Retrieves the GVMaterializer, if any, for this Module.
440 /// Retrieves the GVMaterializer, if any, for this Module.
447441 GVMaterializer *getMaterializer() const { return Materializer.get(); }
448442
449 /// isMaterializable - True if the definition of GV has yet to be materialized
450 /// from the GVMaterializer.
443 /// True if the definition of GV has yet to be materializedfrom the
444 /// GVMaterializer.
451445 bool isMaterializable(const GlobalValue *GV) const;
452 /// isDematerializable - Returns true if this GV was loaded from this Module's
453 /// GVMaterializer and the GVMaterializer knows how to dematerialize the GV.
446 /// Returns true if this GV was loaded from this Module's GVMaterializer and
447 /// the GVMaterializer knows how to dematerialize the GV.
454448 bool isDematerializable(const GlobalValue *GV) const;
455449
456 /// Materialize - Make sure the GlobalValue is fully read. If the module is
457 /// corrupt, this returns true and fills in the optional string with
458 /// information about the problem. If successful, this returns false.
450 /// Make sure the GlobalValue is fully read. If the module is corrupt, this
451 /// returns true and fills in the optional string with information about the
452 /// problem. If successful, this returns false.
459453 bool Materialize(GlobalValue *GV, std::string *ErrInfo = nullptr);
460 /// Dematerialize - If the GlobalValue is read in, and if the GVMaterializer
461 /// supports it, release the memory for the function, and set it up to be
462 /// materialized lazily. If !isDematerializable(), this method is a noop.
454 /// If the GlobalValue is read in, and if the GVMaterializer supports it,
455 /// release the memory for the function, and set it up to be materialized
456 /// lazily. If !isDematerializable(), this method is a noop.
463457 void Dematerialize(GlobalValue *GV);
464458
465459 /// Make sure all GlobalValues in this Module are fully read.