mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-20 11:33:24 +02:00
by Alexander Herz:
"The CWriter::GetValueName() method does not check if a value as an alias and emits the alias name which will never be defined in the output .c file (so the output file fails to compile). This can happen if you have multiple inheritance with several destructors defined by clang (...D0Ev, ...D1Ev, ...D2Ev)." -- applied with minor tweaks. Thanks! llvm-svn: 110194
This commit is contained in:
parent
7cc5e5f017
commit
50fb0419ea
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user