diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-02 18:45:31 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-02 18:46:53 +0000 |
| commit | f722071a9ed9443be9f4847221341fc1d2fb229e (patch) | |
| tree | 6be981d58820746abcc3c21bbbeae2e9b5085b1b /llvm/lib/Target/X86/MCTargetDesc | |
| parent | 2cbb9653d876568fae91f32ae8e19ec4a7e7f274 (diff) | |
| download | bcm5719-llvm-f722071a9ed9443be9f4847221341fc1d2fb229e.tar.gz bcm5719-llvm-f722071a9ed9443be9f4847221341fc1d2fb229e.zip | |
X86_MC::createX86MCSubtargetInfo - X86_MC::ParseX86Triple never returns an empty string. NFCI.
PVS Studio was complaining that the expression '!ArchFS.empty()' is always true.
Diffstat (limited to 'llvm/lib/Target/X86/MCTargetDesc')
| -rw-r--r-- | llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp index 56a7615850c..6f42852512b 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp @@ -290,12 +290,9 @@ void X86_MC::initLLVMToSEHAndCVRegMapping(MCRegisterInfo *MRI) { MCSubtargetInfo *X86_MC::createX86MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS) { std::string ArchFS = X86_MC::ParseX86Triple(TT); - if (!FS.empty()) { - if (!ArchFS.empty()) - ArchFS = (Twine(ArchFS) + "," + FS).str(); - else - ArchFS = FS; - } + assert(!ArchFS.empty() && "Failed to parse X86 triple"); + if (!FS.empty()) + ArchFS = (Twine(ArchFS) + "," + FS).str(); std::string CPUName = CPU; if (CPUName.empty()) |

