diff options
author | Marcello Maggioni <hayarms@gmail.com> | 2018-08-20 19:23:45 +0000 |
---|---|---|
committer | Marcello Maggioni <hayarms@gmail.com> | 2018-08-20 19:23:45 +0000 |
commit | 5ca4128b45fb32c51c9b59ffca24dd3c9465fb2f (patch) | |
tree | 8ef3596fb661146125a84a6568385865269326de /llvm/lib/CodeGen/PseudoSourceValue.cpp | |
parent | 66555a7bed88aca313f194e57a4c8ebc547ef268 (diff) | |
download | bcm5719-llvm-5ca4128b45fb32c51c9b59ffca24dd3c9465fb2f.tar.gz bcm5719-llvm-5ca4128b45fb32c51c9b59ffca24dd3c9465fb2f.zip |
[PSV] Update API to be able to use TargetCustom without UB.
getTargetCustom() requires values for "Kind" in the constructor
that are not in the PSVKind enum. Passing a value that is not inside
an enum as an argument to a constructor of the type of the enum is
UB. Changing to the underlying type of the enum would solve the UB
Differential Revision: https://reviews.llvm.org/D50909
llvm-svn: 340200
Diffstat (limited to 'llvm/lib/CodeGen/PseudoSourceValue.cpp')
-rw-r--r-- | llvm/lib/CodeGen/PseudoSourceValue.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/PseudoSourceValue.cpp b/llvm/lib/CodeGen/PseudoSourceValue.cpp index 86fd8745052..6ca8d86e3f8 100644 --- a/llvm/lib/CodeGen/PseudoSourceValue.cpp +++ b/llvm/lib/CodeGen/PseudoSourceValue.cpp @@ -25,7 +25,7 @@ static const char *const PSVNames[] = { "Stack", "GOT", "JumpTable", "ConstantPool", "FixedStack", "GlobalValueCallEntry", "ExternalSymbolCallEntry"}; -PseudoSourceValue::PseudoSourceValue(PSVKind Kind, const TargetInstrInfo &TII) +PseudoSourceValue::PseudoSourceValue(unsigned Kind, const TargetInstrInfo &TII) : Kind(Kind) { AddressSpace = TII.getAddressSpaceForPseudoSourceKind(Kind); } @@ -81,7 +81,7 @@ void FixedStackPseudoSourceValue::printCustom(raw_ostream &OS) const { } CallEntryPseudoSourceValue::CallEntryPseudoSourceValue( - PSVKind Kind, const TargetInstrInfo &TII) + unsigned Kind, const TargetInstrInfo &TII) : PseudoSourceValue(Kind, TII) {} bool CallEntryPseudoSourceValue::isConstant(const MachineFrameInfo *) const { |