/// getGlobalLinkName - Returns the asm/link name of of the specified
/// global variable. Should be overridden by each target asm printer to
/// generate the appropriate value.
- virtual void getGlobalLinkName(const GlobalVariable *GV,
- std::string &LinkName);
+ virtual const std::string getGlobalLinkName(const GlobalVariable *GV) const;
protected:
/// doInitialization - Set up the AsmPrinter when we are working on a new
/// getGlobalLinkName - Returns the asm/link name of of the specified
/// global variable. Should be overridden by each target asm printer to
/// generate the appropriate value.
-void AsmPrinter::getGlobalLinkName(const GlobalVariable *GV,
- std::string &LinkName) {
+const std::string AsmPrinter::getGlobalLinkName(const GlobalVariable *GV) const{
+ std::string LinkName;
// Default action is to use a global symbol.
LinkName = TAI->getGlobalPrefix();
LinkName += GV->getName();
+ return LinkName;
}
// EmitAlignment - Emit an alignment directive to the specified power of two.
AddSourceLine(VariableDie, UnitDesc, GVD->getLine());
// Work up linkage name.
- std::string LinkageName;
- Asm->getGlobalLinkName(GV, LinkageName);
+ const std::string LinkageName = Asm->getGlobalLinkName(GV);
// Add address.
DIEBlock *Block = new DIEBlock();