diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2019-07-18 21:37:16 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2019-07-18 21:37:16 +0000 |
commit | 50057f328870e0ecc4975cd4ef46b2fd6221d999 (patch) | |
tree | 49d22617952c918f3aa2fc945f83deb649f15530 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | ba9c9e62cbf48dd77e717b843531ce4114916841 (diff) | |
download | bcm5719-llvm-50057f328870e0ecc4975cd4ef46b2fd6221d999.tar.gz bcm5719-llvm-50057f328870e0ecc4975cd4ef46b2fd6221d999.zip |
CodeGen: Allow !associated metadata to point to aliases.
This is a small extension of !associated, mostly useful for the implementation
convenience of instrumentation passes that RAUW globals with aliases, such
as LowerTypeTests.
Differential Revision: https://reviews.llvm.org/D64951
llvm-svn: 366502
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 4c8f75b237a..23cb1c1d305 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -524,8 +524,8 @@ static const MCSymbolELF *getAssociatedSymbol(const GlobalObject *GO, if (!VM) report_fatal_error("MD_associated operand is not ValueAsMetadata"); - GlobalObject *OtherGO = dyn_cast<GlobalObject>(VM->getValue()); - return OtherGO ? dyn_cast<MCSymbolELF>(TM.getSymbol(OtherGO)) : nullptr; + auto *OtherGV = dyn_cast<GlobalValue>(VM->getValue()); + return OtherGV ? dyn_cast<MCSymbolELF>(TM.getSymbol(OtherGV)) : nullptr; } static unsigned getEntrySizeForKind(SectionKind Kind) { |