- For one thing, this adds unneeded overhead; for another, this
routine can be used to emit unnamed decls which we shouldn't try to
mangle.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66212
91177308-0d34-0410-b5e6-
96231b3b80d8
const llvm::Type *LTy = ConvertTypeForMem(Ty);
if (isByRef)
LTy = BuildByRefType(Ty, getContext().getDeclAlignInBytes(&D));
- llvm::AllocaInst *Alloc =
- CreateTempAlloca(LTy, CGM.getMangledName(&D));
+ llvm::AllocaInst *Alloc =
+ CreateTempAlloca(LTy, D.getNameAsString().c_str());
if (isByRef)
Alloc->setAlignment(std::max(getContext().getDeclAlignInBytes(&D),
getContext().getTypeAlign(getContext().VoidPtrTy) / 8));
const char *CodeGenModule::getMangledName(const NamedDecl *ND) {
llvm::SmallString<256> Name;
llvm::raw_svector_ostream Out(Name);
- if (!mangleName(ND, Context, Out))
+ if (!mangleName(ND, Context, Out)) {
+ assert(ND->getIdentifier() && "Attempt to mangle unnamed decl.");
return ND->getIdentifier()->getName();
+ }
Name += '\0';
return MangledNames.GetOrCreateValue(Name.begin(), Name.end())
@implementation A (Cat)
@end
+@interface B
+@end
+
int f0(id x) {
#ifndef IRGENABLE_GNU
#ifndef IRGENABLE
#ifndef IRGENABLE_GNU
@try {
@throw x;
+
} @catch(A *e) {
@throw;
+
+ // @catch param doesn't require name.
+ } @catch(B *) {
+
} @finally {
;
}