This is an archive of the discontinued LLVM Phabricator instance.

AST: simplify handling of the mangling
Needs ReviewPublic

Authored by compnerd on Sep 2 2015, 5:06 PM.

Details

Reviewers
rnk
espindola
Summary

Simplify the mangling handling. This allows for the correct handling of extern
"C" symbols in C++ input. The observable difference with this simplification
that additional symbols are marked as naked (\01 prefix), namely asm
labels and redefine_extname.

Diff Detail

Event Timeline

compnerd updated this revision to Diff 33884.Sep 2 2015, 5:06 PM
compnerd retitled this revision from to AST: simplify handling of the mangling.
compnerd updated this object.
compnerd added reviewers: rafael, rnk.
compnerd added a subscriber: cfe-commits.
compnerd added inline comments.
lib/AST/Mangle.cpp
191

Drive by reformat.

test/CodeGen/pr9614.c
21

Drive-by redeclaration to reduce a warnings.

majnemer added inline comments.
lib/AST/Mangle.cpp
130

Please use the American spelling, "honor."

131

The type is obvious here, please use auto *.

139

What do you mean by lie? Are we patching over a bug in the MS mangler?

140

doesn't

compnerd added inline comments.Sep 2 2015, 10:41 PM
lib/AST/Mangle.cpp
139

The shouldMangleCXXName seems to be insufficient of a check for the MS ABI case, and will return false for cases where it shouldn't. The comment is to clear up the reason for the

CC = CM_Other && TI.getCXXABI() == TargetCXXABI::Microsoft

check which we need to add.

rnk added inline comments.Sep 3 2015, 9:11 AM
lib/AST/Mangle.cpp
142

TI.getCXXABI().isMicrosoft() is better than the == check.

156–161

This looks like a functional change for Itanium. The old code was intentionally structured so that Itanium also had C calling convention mangling on Windows.

espindola edited reviewers, added: espindola; removed: rafael.Mar 15 2018, 10:59 AM