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:
Gabor Greif 2010-08-04 10:00:52 +00:00
parent 6b43ea117f
commit 94ab490260
1 changed files with 7 additions and 0 deletions

View File

@ -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;