forked from OSchip/llvm-project
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
6b43ea117f
commit
94ab490260
|
@ -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