summaryrefslogtreecommitdiff
path: root/include/llvm/IR/Module.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/IR/Module.h')
-rw-r--r--include/llvm/IR/Module.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/include/llvm/IR/Module.h b/include/llvm/IR/Module.h
index cb500ffe7cb6a..b30a9a3d1abf2 100644
--- a/include/llvm/IR/Module.h
+++ b/include/llvm/IR/Module.h
@@ -340,10 +340,6 @@ public:
Constant *getOrInsertFunction(StringRef Name, Type *RetTy, ...)
END_WITH_NULL;
- Constant *getOrInsertTargetIntrinsic(StringRef Name,
- FunctionType *Ty,
- AttributeSet AttributeList);
-
/// getFunction - Look up the specified function in the module symbol table.
/// If it does not exist, return null.
Function *getFunction(StringRef Name) const;
@@ -356,15 +352,22 @@ public:
/// symbol table. If it does not exist, return null. If AllowInternal is set
/// to true, this function will return types that have InternalLinkage. By
/// default, these types are not returned.
- GlobalVariable *getGlobalVariable(StringRef Name,
- bool AllowInternal = false) const;
+ const GlobalVariable *getGlobalVariable(StringRef Name,
+ bool AllowInternal = false) const {
+ return const_cast<Module *>(this)->getGlobalVariable(Name, AllowInternal);
+ }
+
+ GlobalVariable *getGlobalVariable(StringRef Name, bool AllowInternal = false);
/// getNamedGlobal - Return the global variable in the module with the
/// specified name, of arbitrary type. This method returns null if a global
/// with the specified name is not found.
- GlobalVariable *getNamedGlobal(StringRef Name) const {
+ GlobalVariable *getNamedGlobal(StringRef Name) {
return getGlobalVariable(Name, true);
}
+ const GlobalVariable *getNamedGlobal(StringRef Name) const {
+ return const_cast<Module *>(this)->getNamedGlobal(Name);
+ }
/// getOrInsertGlobal - Look up the specified global in the module symbol
/// table.
@@ -388,7 +391,7 @@ public:
/// @name Named Metadata Accessors
/// @{
- /// getNamedMetadata - Return the NamedMDNode in the module with the
+ /// getNamedMetadata - Return the first NamedMDNode in the module with the
/// specified name. This method returns null if a NamedMDNode with the
/// specified name is not found.
NamedMDNode *getNamedMetadata(const Twine &Name) const;
@@ -409,6 +412,10 @@ public:
/// getModuleFlagsMetadata - Returns the module flags in the provided vector.
void getModuleFlagsMetadata(SmallVectorImpl<ModuleFlagEntry> &Flags) const;
+ /// Return the corresponding value if Key appears in module flags, otherwise
+ /// return null.
+ Value *getModuleFlag(StringRef Key) const;
+
/// getModuleFlagsMetadata - Returns the NamedMDNode in the module that
/// represents module-level flags. This method returns null if there are no
/// module-level flags.