mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
s/ModAttrBehavior/ModFlagBehavior/g to be consistent with how module flags are named elsewhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150679 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -177,13 +177,13 @@ public:
|
|||||||
/// is an error for two (or more) llvm.module.flags with the
|
/// is an error for two (or more) llvm.module.flags with the
|
||||||
/// same ID to have the Override behavior but different
|
/// same ID to have the Override behavior but different
|
||||||
/// values.
|
/// values.
|
||||||
enum ModAttrBehavior { Error = 1, Warning = 2, Require = 3, Override = 4 };
|
enum ModFlagBehavior { Error = 1, Warning = 2, Require = 3, Override = 4 };
|
||||||
|
|
||||||
struct ModuleFlagEntry {
|
struct ModuleFlagEntry {
|
||||||
ModAttrBehavior Behavior;
|
ModFlagBehavior Behavior;
|
||||||
MDString *Key;
|
MDString *Key;
|
||||||
Value *Val;
|
Value *Val;
|
||||||
ModuleFlagEntry(ModAttrBehavior B, MDString *K, Value *V)
|
ModuleFlagEntry(ModFlagBehavior B, MDString *K, Value *V)
|
||||||
: Behavior(B), Key(K), Val(V) {}
|
: Behavior(B), Key(K), Val(V) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -425,8 +425,8 @@ public:
|
|||||||
/// addModuleFlag - Add a module-level flag to the module-level flags
|
/// addModuleFlag - Add a module-level flag to the module-level flags
|
||||||
/// metadata. It will create the module-level flags named metadata if it
|
/// metadata. It will create the module-level flags named metadata if it
|
||||||
/// doesn't already exist.
|
/// doesn't already exist.
|
||||||
void addModuleFlag(ModAttrBehavior Behavior, StringRef Key, Value *Val);
|
void addModuleFlag(ModFlagBehavior Behavior, StringRef Key, Value *Val);
|
||||||
void addModuleFlag(ModAttrBehavior Behavior, StringRef Key, uint32_t Val);
|
void addModuleFlag(ModFlagBehavior Behavior, StringRef Key, uint32_t Val);
|
||||||
void addModuleFlag(MDNode *Node);
|
void addModuleFlag(MDNode *Node);
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
@@ -339,7 +339,7 @@ getModuleFlagsMetadata(SmallVectorImpl<ModuleFlagEntry> &Flags) const {
|
|||||||
ConstantInt *Behavior = cast<ConstantInt>(Flag->getOperand(0));
|
ConstantInt *Behavior = cast<ConstantInt>(Flag->getOperand(0));
|
||||||
MDString *Key = cast<MDString>(Flag->getOperand(1));
|
MDString *Key = cast<MDString>(Flag->getOperand(1));
|
||||||
Value *Val = Flag->getOperand(2);
|
Value *Val = Flag->getOperand(2);
|
||||||
Flags.push_back(ModuleFlagEntry(ModAttrBehavior(Behavior->getZExtValue()),
|
Flags.push_back(ModuleFlagEntry(ModFlagBehavior(Behavior->getZExtValue()),
|
||||||
Key, Val));
|
Key, Val));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -361,7 +361,7 @@ NamedMDNode *Module::getOrInsertModuleFlagsMetadata() {
|
|||||||
/// addModuleFlag - Add a module-level flag to the module-level flags
|
/// addModuleFlag - Add a module-level flag to the module-level flags
|
||||||
/// metadata. It will create the module-level flags named metadata if it doesn't
|
/// metadata. It will create the module-level flags named metadata if it doesn't
|
||||||
/// already exist.
|
/// already exist.
|
||||||
void Module::addModuleFlag(ModAttrBehavior Behavior, StringRef Key,
|
void Module::addModuleFlag(ModFlagBehavior Behavior, StringRef Key,
|
||||||
Value *Val) {
|
Value *Val) {
|
||||||
Type *Int32Ty = Type::getInt32Ty(Context);
|
Type *Int32Ty = Type::getInt32Ty(Context);
|
||||||
Value *Ops[3] = {
|
Value *Ops[3] = {
|
||||||
@@ -369,7 +369,7 @@ void Module::addModuleFlag(ModAttrBehavior Behavior, StringRef Key,
|
|||||||
};
|
};
|
||||||
getOrInsertModuleFlagsMetadata()->addOperand(MDNode::get(Context, Ops));
|
getOrInsertModuleFlagsMetadata()->addOperand(MDNode::get(Context, Ops));
|
||||||
}
|
}
|
||||||
void Module::addModuleFlag(ModAttrBehavior Behavior, StringRef Key,
|
void Module::addModuleFlag(ModFlagBehavior Behavior, StringRef Key,
|
||||||
uint32_t Val) {
|
uint32_t Val) {
|
||||||
Type *Int32Ty = Type::getInt32Ty(Context);
|
Type *Int32Ty = Type::getInt32Ty(Context);
|
||||||
addModuleFlag(Behavior, Key, ConstantInt::get(Int32Ty, Val));
|
addModuleFlag(Behavior, Key, ConstantInt::get(Int32Ty, Val));
|
||||||
|
Reference in New Issue
Block a user