diff options
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 11 | ||||
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/CGObjCGNU.cpp | 10 | ||||
-rw-r--r-- | lib/CodeGen/CGObjCMac.cpp | 6 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 2 |
5 files changed, 17 insertions, 16 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 9a04a83d6e..55ce237e14 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -152,7 +152,7 @@ llvm::DIType CGDebugInfo::CreateType(const TypedefType *Ty, // We don't set size information, but do specify where the typedef was // declared. - const char *TyName = Ty->getDecl()->getName(); + const char *TyName = Ty->getDecl()->getIdentifierName(); SourceLocation DefLoc = Ty->getDecl()->getLocation(); llvm::DICompileUnit DefUnit = getOrCreateCompileUnit(DefLoc); @@ -206,7 +206,7 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty, SourceManager &SM = M->getContext().getSourceManager(); // Get overall information about the record type for the debug info. - const char *Name = Decl->getName(); + const char *Name = Decl->getIdentifierName(); if (Name == 0) Name = ""; llvm::DICompileUnit DefUnit = getOrCreateCompileUnit(Decl->getLocation()); @@ -242,7 +242,7 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty, FieldDecl *Field = *I; llvm::DIType FieldTy = getOrCreateType(Field->getType(), Unit); - const char *FieldName = Field->getName(); + const char *FieldName = Field->getIdentifierName(); if (FieldName == 0) FieldName = ""; // Get the location for the field. @@ -301,7 +301,8 @@ llvm::DIType CGDebugInfo::CreateType(const EnumType *Ty, llvm::DIArray EltArray = DebugFactory.GetOrCreateArray(&Enumerators[0], Enumerators.size()); - const char *EnumName = Decl->getName() ? Decl->getName() : ""; + const char *EnumName + = Decl->getIdentifierName() ? Decl->getIdentifierName() : ""; SourceLocation DefLoc = Decl->getLocation(); llvm::DICompileUnit DefUnit = getOrCreateCompileUnit(DefLoc); SourceManager &SM = M->getContext().getSourceManager(); @@ -515,7 +516,7 @@ void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var, llvm::DICompileUnit Unit = getOrCreateCompileUnit(Decl->getLocation()); SourceManager &SM = M->getContext().getSourceManager(); uint64_t LineNo = SM.getLogicalLineNumber(Decl->getLocation()); - const char *Name = Decl->getName(); + const char *Name = Decl->getIdentifierName(); DebugFactory.CreateGlobalVariable(Unit, Name, Name, "", Unit, LineNo, getOrCreateType(Decl->getType(), Unit), diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index e54c4b386d..7a86d24801 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -146,7 +146,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) { if (!Target.useGlobalsForAutomaticVariables()) { // A normal fixed sized variable becomes an alloca in the entry block. const llvm::Type *LTy = ConvertType(Ty); - llvm::AllocaInst * Alloc = CreateTempAlloca(LTy, D.getName()); + llvm::AllocaInst * Alloc = CreateTempAlloca(LTy, D.getIdentifierName()); unsigned align = getContext().getTypeAlign(Ty); if (const AlignedAttr* AA = D.getAttr<AlignedAttr>()) align = std::max(align, AA->getAlignment()); @@ -164,7 +164,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) { // FIXME: VLA: Add VLA support. For now just make up enough to let // the compile go through. const llvm::Type *LTy = ConvertType(Ty); - llvm::AllocaInst * Alloc = CreateTempAlloca(LTy, D.getName()); + llvm::AllocaInst * Alloc = CreateTempAlloca(LTy, D.getIdentifierName()); DeclPtr = Alloc; } diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index 4726be2115..0833b0832d 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -561,7 +561,7 @@ llvm::Value *CGObjCGNU::GenerateProtocolRef(CGBuilderTy &Builder, void CGObjCGNU::GenerateProtocol(const ObjCProtocolDecl *PD) { ASTContext &Context = CGM.getContext(); - const char *ProtocolName = PD->getName(); + const char *ProtocolName = PD->getIdentifierName(); llvm::SmallVector<std::string, 16> Protocols; for (ObjCProtocolDecl::protocol_iterator PI = PD->protocol_begin(), E = PD->protocol_end(); PI != E; ++PI) @@ -616,8 +616,8 @@ void CGObjCGNU::GenerateProtocol(const ObjCProtocolDecl *PD) { } void CGObjCGNU::GenerateCategory(const ObjCCategoryImplDecl *OCD) { - const char *ClassName = OCD->getClassInterface()->getName(); - const char *CategoryName = OCD->getName(); + const char *ClassName = OCD->getClassInterface()->getIdentifierName(); + const char *CategoryName = OCD->getIdentifierName(); // Collect information about instance methods llvm::SmallVector<Selector, 16> InstanceMethodSels; llvm::SmallVector<llvm::Constant*, 16> InstanceMethodTypes; @@ -675,12 +675,12 @@ void CGObjCGNU::GenerateClass(const ObjCImplementationDecl *OID) { OID->getClassInterface()->getSuperClass(); const char * SuperClassName = NULL; if (SuperClassDecl) { - SuperClassName = SuperClassDecl->getName(); + SuperClassName = SuperClassDecl->getIdentifierName(); } // Get the class name ObjCInterfaceDecl * ClassDecl = (ObjCInterfaceDecl*)OID->getClassInterface(); - const char * ClassName = ClassDecl->getName(); + const char * ClassName = ClassDecl->getIdentifierName(); // Get the size of instances. For runtimes that support late-bound instances // this should probably be something different (size just of instance diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 296b1af551..a8f6bbab9b 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -638,7 +638,7 @@ llvm::Constant *CGObjCMac::GetOrEmitProtocol(const ObjCProtocolDecl *PD) { // over. LazySymbols.insert(&CGM.getContext().Idents.get("Protocol")); - const char *ProtocolName = PD->getName(); + const char *ProtocolName = PD->getIdentifierName(); // Construct method lists. std::vector<llvm::Constant*> InstanceMethods, ClassMethods; @@ -1050,7 +1050,7 @@ static bool IsClassHidden(const ObjCInterfaceDecl *ID) { void CGObjCMac::GenerateClass(const ObjCImplementationDecl *ID) { DefinedSymbols.insert(ID->getIdentifier()); - const char *ClassName = ID->getName(); + const char *ClassName = ID->getIdentifierName(); // FIXME: Gross ObjCInterfaceDecl *Interface = const_cast<ObjCInterfaceDecl*>(ID->getClassInterface()); @@ -1143,7 +1143,7 @@ llvm::Constant *CGObjCMac::EmitMetaClass(const ObjCImplementationDecl *ID, llvm::Constant *Protocols, const llvm::Type *InterfaceTy, const ConstantVector &Methods) { - const char *ClassName = ID->getName(); + const char *ClassName = ID->getIdentifierName(); unsigned Flags = eClassFlags_Meta; unsigned Size = CGM.getTargetData().getABITypeSize(ObjCTypes.ClassTy); diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index ff05f6e585..b358993665 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -121,7 +121,7 @@ void CodeGenFunction::StartFunction(const Decl *D, QualType RetTy, if (CGDebugInfo *DI = CGM.getDebugInfo()) { DI->setLocation(StartLoc); if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { - DI->EmitFunctionStart(FD->getName(), RetTy, CurFn, Builder); + DI->EmitFunctionStart(FD->getIdentifierName(), RetTy, CurFn, Builder); } else { // Just use LLVM function name. DI->EmitFunctionStart(Fn->getName().c_str(), |