[llvm] 2b0256e - [MC] Ignore VK_WEAKREF in MCValue::getAccessVariant
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 15 16:07:09 PST 2019
Author: Fangrui Song
Date: 2019-12-15T16:05:46-08:00
New Revision: 2b0256e49bbe5c0dc9c8f4800b1e2f131026cb45
URL: https://github.com/llvm/llvm-project/commit/2b0256e49bbe5c0dc9c8f4800b1e2f131026cb45
DIFF: https://github.com/llvm/llvm-project/commit/2b0256e49bbe5c0dc9c8f4800b1e2f131026cb45.diff
LOG: [MC] Ignore VK_WEAKREF in MCValue::getAccessVariant
MCSymbolRefExpr::getVariantKindForName does not return VK_WEAKREF, so this code path is not exercised. Moreoever, .weakref is probably a feature that nobody uses.
Added:
Modified:
llvm/lib/MC/MCValue.cpp
Removed:
################################################################################
diff --git a/llvm/lib/MC/MCValue.cpp b/llvm/lib/MC/MCValue.cpp
index 81da47b2eced..b6bcec9b2ca0 100644
--- a/llvm/lib/MC/MCValue.cpp
+++ b/llvm/lib/MC/MCValue.cpp
@@ -54,8 +54,5 @@ MCSymbolRefExpr::VariantKind MCValue::getAccessVariant() const {
if (!A)
return MCSymbolRefExpr::VK_None;
- MCSymbolRefExpr::VariantKind Kind = A->getKind();
- if (Kind == MCSymbolRefExpr::VK_WEAKREF)
- return MCSymbolRefExpr::VK_None;
- return Kind;
+ return A->getKind();
}
More information about the llvm-commits
mailing list