mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
- Add a "getOrInsertGlobal" method to the Module class. This acts similarly to
"getOrInsertFunction" in that it either adds a new declaration of the global and returns it, or returns the current one -- optionally casting it to the correct type. - Use the new getOrInsertGlobal in the stack protector code. - Use "splitBasicBlock" in the stack protector code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58727 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -229,6 +229,15 @@ public:
|
||||
return getGlobalVariable(Name, true);
|
||||
}
|
||||
|
||||
/// getOrInsertGlobal - Look up the specified global in the module symbol
|
||||
/// table.
|
||||
/// 1. If it does not exist, add a declaration of the global and return it.
|
||||
/// 2. Else, the global exists but has the wrong type: return the function
|
||||
/// with a constantexpr cast to the right type.
|
||||
/// 3. Finally, if the existing global is the correct delclaration, return
|
||||
/// the existing global.
|
||||
Constant *getOrInsertGlobal(const std::string &Name, const Type *Ty);
|
||||
|
||||
/// @}
|
||||
/// @name Global Alias Accessors
|
||||
/// @{
|
||||
|
Reference in New Issue
Block a user