StringRef Name = GVName.toStringRef(TmpData);
assert(!Name.empty() && "getNameWithPrefix requires non-empty name");
+ // No need to do anything special if the global has the special "do not
+ // mangle" flag in the name.
+ if (Name[0] == '\1') {
+ OS << Name.substr(1);
+ return;
+ }
+
if (PrefixTy == Mangler::Private)
OS << DL.getPrivateGlobalPrefix();
else if (PrefixTy == Mangler::LinkerPrivate)
unsigned ArgWords = 0;
for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end();
AI != AE; ++AI) {
+ // Skip arguments in registers to handle typical fastcall lowering.
+ if (F->getAttributes().hasAttribute(AI->getArgNo() + 1, Attribute::InReg))
+ continue;
Type *Ty = AI->getType();
// 'Dereference' type in case of byval or inalloca parameter attribute.
if (AI->hasByValOrInAllocaAttr())
StringRef Name = GV->getName();
- // No need to do anything special if the global has the special "do not
- // mangle" flag in the name.
- if (Name[0] == '\1') {
- OS << Name.substr(1);
- return;
- }
-
bool UseAt = false;
- const Function *MSFunc = NULL;
+ const Function *MSFunc = nullptr;
CallingConv::ID CC;
- if (DL->hasMicrosoftFastStdCallMangling()) {
+ if (Name[0] != '\1' && DL->hasMicrosoftFastStdCallMangling()) {
if ((MSFunc = dyn_cast<Function>(GV))) {
CC = MSFunc->getCallingConv();
// fastcall functions need to start with @ instead of _.