summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCExpr.cpp
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2013-06-21 14:42:49 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2013-06-21 14:42:49 +0000
commite67c565dc101a63553921257d24e9854411473ec (patch)
tree9f77a4061a7e5d1a832b6145c75353eefe992b50 /llvm/lib/MC/MCExpr.cpp
parentd51c09f5d904254564b9aba28175440595a111cb (diff)
downloadbcm5719-llvm-e67c565dc101a63553921257d24e9854411473ec.tar.gz
bcm5719-llvm-e67c565dc101a63553921257d24e9854411473ec.zip
[PowerPC] Support @h modifier
This adds necessary infrastructure to support the @h modifier. Note that all required relocation types were already present (and unused). This patch provides support for using @h in the assembler; it would also be possible to now use this feature in code generated by the compiler, but this is not done yet. llvm-svn: 184548
Diffstat (limited to 'llvm/lib/MC/MCExpr.cpp')
-rw-r--r--llvm/lib/MC/MCExpr.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCExpr.cpp b/llvm/lib/MC/MCExpr.cpp
index 124bd01d6ad..f59222263da 100644
--- a/llvm/lib/MC/MCExpr.cpp
+++ b/llvm/lib/MC/MCExpr.cpp
@@ -197,6 +197,7 @@ StringRef MCSymbolRefExpr::getVariantKindName(VariantKind Kind) {
case VK_ARM_TARGET2: return "(target2)";
case VK_ARM_PREL31: return "(prel31)";
case VK_PPC_LO: return "l";
+ case VK_PPC_HI: return "h";
case VK_PPC_HA: return "ha";
case VK_PPC_TOCBASE: return "tocbase";
case VK_PPC_TOC: return "toc";
@@ -281,6 +282,8 @@ MCSymbolRefExpr::getVariantKindForName(StringRef Name) {
.Case("secrel32", VK_SECREL)
.Case("L", VK_PPC_LO)
.Case("l", VK_PPC_LO)
+ .Case("H", VK_PPC_HI)
+ .Case("h", VK_PPC_HI)
.Case("HA", VK_PPC_HA)
.Case("ha", VK_PPC_HA)
.Case("TOCBASE", VK_PPC_TOCBASE)
OpenPOWER on IntegriCloud