/// EmitPropertyList - Emit the given property list. The return
/// value has type PropertyListPtrTy.
- llvm::Constant *EmitPropertyList(Twine Name,
- const Decl *Container,
+ llvm::Constant *EmitPropertyList(const Twine &Name, const Decl *Container,
const ObjCContainerDecl *OCD,
const ObjCCommonTypesHelper &ObjCTypes,
bool IsClassProperty);
/// EmitProtocolMethodTypes - Generate the array of extended method type
/// strings. The return value has type Int8PtrPtrTy.
- llvm::Constant *EmitProtocolMethodTypes(Twine Name,
- ArrayRef<llvm::Constant*> MethodTypes,
- const ObjCCommonTypesHelper &ObjCTypes);
+ llvm::Constant *
+ EmitProtocolMethodTypes(const Twine &Name,
+ ArrayRef<llvm::Constant *> MethodTypes,
+ const ObjCCommonTypesHelper &ObjCTypes);
/// GetProtocolRef - Return a reference to the internal protocol
/// description, creating an empty one if it has not been
/// \param Align - The alignment for the variable, or 0.
/// \param AddToUsed - Whether the variable should be added to
/// "llvm.used".
- llvm::GlobalVariable *CreateMetadataVar(Twine Name,
+ llvm::GlobalVariable *CreateMetadataVar(const Twine &Name,
ConstantStructBuilder &Init,
StringRef Section, CharUnits Align,
bool AddToUsed);
- llvm::GlobalVariable *CreateMetadataVar(Twine Name,
+ llvm::GlobalVariable *CreateMetadataVar(const Twine &Name,
llvm::Constant *Init,
StringRef Section, CharUnits Align,
bool AddToUsed);
/// EmitMethodList - Emit the method list for the given
/// implementation. The return value has type MethodListPtrTy.
- llvm::Constant *emitMethodList(Twine Name, MethodListType MLT,
+ llvm::Constant *emitMethodList(const Twine &Name, MethodListType MLT,
ArrayRef<const ObjCMethodDecl *> Methods);
/// GetOrEmitProtocol - Get the protocol object for the given
/// EmitProtocolList - Generate the list of referenced
/// protocols. The return value has type ProtocolListPtrTy.
- llvm::Constant *EmitProtocolList(Twine Name,
+ llvm::Constant *EmitProtocolList(const Twine &Name,
ObjCProtocolDecl::protocol_iterator begin,
ObjCProtocolDecl::protocol_iterator end);
/// Emit the method list for the given implementation. The return value
/// has type MethodListnfABITy.
- llvm::Constant *emitMethodList(Twine Name, MethodListType MLT,
+ llvm::Constant *emitMethodList(const Twine &Name, MethodListType MLT,
ArrayRef<const ObjCMethodDecl *> Methods);
/// EmitIvarList - Emit the ivar list for the given
/// EmitProtocolList - Generate the list of referenced
/// protocols. The return value has type ProtocolListPtrTy.
- llvm::Constant *EmitProtocolList(Twine Name,
+ llvm::Constant *EmitProtocolList(const Twine &Name,
ObjCProtocolDecl::protocol_iterator begin,
ObjCProtocolDecl::protocol_iterator end);
};
*/
llvm::Constant *
-CGObjCMac::EmitProtocolList(Twine name,
+CGObjCMac::EmitProtocolList(const Twine &Name,
ObjCProtocolDecl::protocol_iterator begin,
ObjCProtocolDecl::protocol_iterator end) {
// Just return null for empty protocol lists
section = "__OBJC,__cat_cls_meth,regular,no_dead_strip";
llvm::GlobalVariable *GV =
- CreateMetadataVar(name, values, section, CGM.getPointerAlign(), false);
+ CreateMetadataVar(Name, values, section, CGM.getPointerAlign(), false);
return llvm::ConstantExpr::getBitCast(GV, ObjCTypes.ProtocolListPtrTy);
}
struct _objc_property[prop_count];
};
*/
-llvm::Constant *CGObjCCommonMac::EmitPropertyList(Twine Name,
- const Decl *Container,
- const ObjCContainerDecl *OCD,
- const ObjCCommonTypesHelper &ObjCTypes,
- bool IsClassProperty) {
+llvm::Constant *CGObjCCommonMac::EmitPropertyList(
+ const Twine &Name, const Decl *Container, const ObjCContainerDecl *OCD,
+ const ObjCCommonTypesHelper &ObjCTypes, bool IsClassProperty) {
if (IsClassProperty) {
// Make this entry NULL for OS X with deployment target < 10.11, for iOS
// with deployment target < 9.0.
return llvm::ConstantExpr::getBitCast(GV, ObjCTypes.PropertyListPtrTy);
}
-llvm::Constant *
-CGObjCCommonMac::EmitProtocolMethodTypes(Twine Name,
- ArrayRef<llvm::Constant*> MethodTypes,
- const ObjCCommonTypesHelper &ObjCTypes) {
+llvm::Constant *CGObjCCommonMac::EmitProtocolMethodTypes(
+ const Twine &Name, ArrayRef<llvm::Constant *> MethodTypes,
+ const ObjCCommonTypesHelper &ObjCTypes) {
// Return null for empty list.
if (MethodTypes.empty())
return llvm::Constant::getNullValue(ObjCTypes.Int8PtrPtrTy);
/// int count;
/// struct objc_method_description list[count];
/// };
-llvm::Constant *CGObjCMac::emitMethodList(Twine name, MethodListType MLT,
- ArrayRef<const ObjCMethodDecl *> methods) {
+llvm::Constant *
+CGObjCMac::emitMethodList(const Twine &Name, MethodListType MLT,
+ ArrayRef<const ObjCMethodDecl *> methods) {
StringRef prefix;
StringRef section;
bool forProtocol = false;
}
methodArray.finishAndAddTo(values);
- llvm::GlobalVariable *GV = CreateMetadataVar(prefix + name, values, section,
+ llvm::GlobalVariable *GV = CreateMetadataVar(prefix + Name, values, section,
CGM.getPointerAlign(), true);
return llvm::ConstantExpr::getBitCast(GV,
ObjCTypes.MethodDescriptionListPtrTy);
}
methodArray.finishAndAddTo(values);
- llvm::GlobalVariable *GV = CreateMetadataVar(prefix + name, values, section,
+ llvm::GlobalVariable *GV = CreateMetadataVar(prefix + Name, values, section,
CGM.getPointerAlign(), true);
return llvm::ConstantExpr::getBitCast(GV, ObjCTypes.MethodListPtrTy);
}
return Method;
}
-llvm::GlobalVariable *CGObjCCommonMac::CreateMetadataVar(Twine Name,
- ConstantStructBuilder &Init,
- StringRef Section,
- CharUnits Align,
- bool AddToUsed) {
+llvm::GlobalVariable *CGObjCCommonMac::CreateMetadataVar(
+ const Twine &Name, ConstantStructBuilder &Init, StringRef Section,
+ CharUnits Align, bool AddToUsed) {
llvm::GlobalVariable *GV =
Init.finishAndCreateGlobal(Name, Align, /*constant*/ false,
llvm::GlobalValue::PrivateLinkage);
return GV;
}
-llvm::GlobalVariable *CGObjCCommonMac::CreateMetadataVar(Twine Name,
+llvm::GlobalVariable *CGObjCCommonMac::CreateMetadataVar(const Twine &Name,
llvm::Constant *Init,
StringRef Section,
CharUnits Align,
/// struct _objc_method method_list[method_count];
/// }
///
-llvm::Constant *
-CGObjCNonFragileABIMac::emitMethodList(Twine name, MethodListType kind,
- ArrayRef<const ObjCMethodDecl *> methods) {
+llvm::Constant *CGObjCNonFragileABIMac::emitMethodList(
+ const Twine &Name, MethodListType kind,
+ ArrayRef<const ObjCMethodDecl *> methods) {
// Return null for empty list.
if (methods.empty())
return llvm::Constant::getNullValue(ObjCTypes.MethodListnfABIPtrTy);
}
methodArray.finishAndAddTo(values);
- auto *GV = values.finishAndCreateGlobal(prefix + name, CGM.getPointerAlign(),
+ auto *GV = values.finishAndCreateGlobal(prefix + Name, CGM.getPointerAlign(),
/*constant*/ false,
llvm::GlobalValue::PrivateLinkage);
if (CGM.getTriple().isOSBinFormatMachO())
/// }
/// @endcode
///
-llvm::Constant *
-CGObjCNonFragileABIMac::EmitProtocolList(Twine Name,
- ObjCProtocolDecl::protocol_iterator begin,
- ObjCProtocolDecl::protocol_iterator end) {
+llvm::Constant *CGObjCNonFragileABIMac::EmitProtocolList(
+ const Twine &Name, ObjCProtocolDecl::protocol_iterator begin,
+ ObjCProtocolDecl::protocol_iterator end) {
SmallVector<llvm::Constant *, 16> ProtocolRefs;
// Just return null for empty protocol lists
/// \brief Expect 'Match' *not* to occur at the given 'Line' and 'Column'.
///
/// Any number of matches can be disallowed.
- void DisallowMatch(Twine Match, unsigned Line, unsigned Column) {
+ void DisallowMatch(const Twine &Match, unsigned Line, unsigned Column) {
DisallowedMatches.push_back(MatchCandidate(Match, Line, Column));
}
/// Each is expected to be matched 'Times' number of times. (This is useful in
/// cases in which different AST nodes can match at the same source code
/// location.)
- void ExpectMatch(Twine Match, unsigned Line, unsigned Column,
+ void ExpectMatch(const Twine &Match, unsigned Line, unsigned Column,
unsigned Times = 1) {
ExpectedMatches.push_back(ExpectedMatch(Match, Line, Column, Times));
}
unsigned LineNumber;
unsigned ColumnNumber;
- MatchCandidate(Twine Name, unsigned LineNumber, unsigned ColumnNumber)
- : ExpectedName(Name.str()), LineNumber(LineNumber),
- ColumnNumber(ColumnNumber) {
- }
+ MatchCandidate(const Twine &Name, unsigned LineNumber,
+ unsigned ColumnNumber)
+ : ExpectedName(Name.str()), LineNumber(LineNumber),
+ ColumnNumber(ColumnNumber) {}
bool Matches(StringRef Name, FullSourceLoc const &Location) const {
return MatchesName(Name) && MatchesLocation(Location);
};
struct ExpectedMatch {
- ExpectedMatch(Twine Name, unsigned LineNumber, unsigned ColumnNumber,
+ ExpectedMatch(const Twine &Name, unsigned LineNumber, unsigned ColumnNumber,
unsigned Times)
: Candidate(Name, LineNumber, ColumnNumber), TimesExpected(Times),
TimesSeen(0) {}