summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/XCOFFObjectWriter.cpp
diff options
context:
space:
mode:
authorSean Fertile <sfertile@ca.ibm.com>2019-08-22 15:11:23 +0000
committerSean Fertile <sfertile@ca.ibm.com>2019-08-22 15:11:23 +0000
commit18fd1b0b494a196f84bfa93dec6f421c9a4da22e (patch)
tree5dbf1b9f8cb98c05f7d81786c0517cdc0925dcae /llvm/lib/MC/XCOFFObjectWriter.cpp
parent08d93f1ed3b65d962552e5b3b9a288078a0b740e (diff)
downloadbcm5719-llvm-18fd1b0b494a196f84bfa93dec6f421c9a4da22e.tar.gz
bcm5719-llvm-18fd1b0b494a196f84bfa93dec6f421c9a4da22e.zip
[PowerPC][XCOFF][MC] Explicitly set containing csect on symbols. [NFC]
Previously we would get the csect a symbol was contained in through its fragment. This works only if we are writing an object file, and only for defined symbols. To fix this we set the contating csect explicitly on the MCSymbolXCOFF object. Differential Revision: https://reviews.llvm.org/D66032 llvm-svn: 369657
Diffstat (limited to 'llvm/lib/MC/XCOFFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/XCOFFObjectWriter.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/MC/XCOFFObjectWriter.cpp b/llvm/lib/MC/XCOFFObjectWriter.cpp
index 94c95279c06..d4dfd467976 100644
--- a/llvm/lib/MC/XCOFFObjectWriter.cpp
+++ b/llvm/lib/MC/XCOFFObjectWriter.cpp
@@ -247,8 +247,7 @@ void XCOFFObjectWriter::executePostLayoutBinding(
const MCSymbolXCOFF *XSym = cast<MCSymbolXCOFF>(&S);
// Map the symbol into its containing csect.
- MCSectionXCOFF *ContainingCsect =
- dyn_cast<MCSectionXCOFF>(XSym->getFragment(false)->getParent());
+ const MCSectionXCOFF *ContainingCsect = XSym->getContainingCsect();
assert(WrapperMap.find(ContainingCsect) != WrapperMap.end() &&
"Expected containing csect to exist in map");
OpenPOWER on IntegriCloud