diff options
Diffstat (limited to 'lib/Target/CBackend/CBackend.cpp')
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index e8d8474b5b..3b4d0a604c 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -1300,6 +1300,13 @@ void CWriter::printConstantWithCast(Constant* CPV, unsigned Opcode) { } std::string CWriter::GetValueName(const Value *Operand) { + + // Resolve potential alias. + if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(Operand)) { + if (const Value *V = GA->resolveAliasedGlobal(false)) + Operand = V; + } + // Mangle globals with the standard mangler interface for LLC compatibility. if (const GlobalValue *GV = dyn_cast<GlobalValue>(Operand)) { SmallString<128> Str; |