mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-24 06:10:12 +00:00
[libc] Fix build after 777180a32b
.
Implicit conversion from llvm::StringRef to std::string was made explicit in the above commit.
This commit is contained in:
parent
e8e6e13176
commit
b9826408e4
@ -58,7 +58,7 @@ void Generator::parseCommandArgs(llvm::StringRef ArgStr, ArgVector &Args) {
|
||||
A = A.trim(' ');
|
||||
if (A.startswith(ParamNamePrefix) && A.endswith(ParamNameSuffix)) {
|
||||
A = A.drop_front(ParamNamePrefixSize).drop_back(ParamNameSuffixSize);
|
||||
A = ArgMap[A];
|
||||
A = ArgMap[std::string(A)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ llvm::cl::list<std::string> ReplacementValues(
|
||||
void ParseArgValuePairs(std::unordered_map<std::string, std::string> &Map) {
|
||||
for (std::string &R : ReplacementValues) {
|
||||
auto Pair = llvm::StringRef(R).split('=');
|
||||
Map[Pair.first] = Pair.second;
|
||||
Map[std::string(Pair.first)] = std::string(Pair.second);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ class APIGenerator {
|
||||
|
||||
std::string getTypeAsString(llvm::Record *TypeRecord) {
|
||||
if (isaNamedType(TypeRecord) || isaStructType(TypeRecord)) {
|
||||
return TypeRecord->getValueAsString("Name");
|
||||
return std::string(TypeRecord->getValueAsString("Name"));
|
||||
} else if (isaPtrType(TypeRecord)) {
|
||||
return getTypeAsString(TypeRecord->getValueAsDef("PointeeType")) + " *";
|
||||
} else if (isaConstType(TypeRecord)) {
|
||||
@ -123,15 +123,17 @@ class APIGenerator {
|
||||
auto MacroSpecList = HeaderSpec->getValueAsListOfDefs("Macros");
|
||||
// TODO: Trigger a fatal error on duplicate specs.
|
||||
for (llvm::Record *MacroSpec : MacroSpecList)
|
||||
MacroSpecMap[MacroSpec->getValueAsString("Name")] = MacroSpec;
|
||||
MacroSpecMap[std::string(MacroSpec->getValueAsString("Name"))] =
|
||||
MacroSpec;
|
||||
|
||||
auto TypeSpecList = HeaderSpec->getValueAsListOfDefs("Types");
|
||||
for (llvm::Record *TypeSpec : TypeSpecList)
|
||||
TypeSpecMap[TypeSpec->getValueAsString("Name")] = TypeSpec;
|
||||
TypeSpecMap[std::string(TypeSpec->getValueAsString("Name"))] =
|
||||
TypeSpec;
|
||||
|
||||
auto FunctionSpecList = HeaderSpec->getValueAsListOfDefs("Functions");
|
||||
for (llvm::Record *FunctionSpec : FunctionSpecList) {
|
||||
FunctionSpecMap[FunctionSpec->getValueAsString("Name")] =
|
||||
FunctionSpecMap[std::string(FunctionSpec->getValueAsString("Name"))] =
|
||||
FunctionSpec;
|
||||
}
|
||||
}
|
||||
@ -144,19 +146,19 @@ class APIGenerator {
|
||||
// generating the API.
|
||||
auto MacroDefList = PublicAPI->getValueAsListOfDefs("Macros");
|
||||
for (llvm::Record *MacroDef : MacroDefList)
|
||||
MacroDefsMap[MacroDef->getValueAsString("Name")] = MacroDef;
|
||||
MacroDefsMap[std::string(MacroDef->getValueAsString("Name"))] = MacroDef;
|
||||
|
||||
auto TypeDeclList = PublicAPI->getValueAsListOfDefs("TypeDeclarations");
|
||||
for (llvm::Record *TypeDecl : TypeDeclList)
|
||||
TypeDeclsMap[TypeDecl->getValueAsString("Name")] = TypeDecl;
|
||||
TypeDeclsMap[std::string(TypeDecl->getValueAsString("Name"))] = TypeDecl;
|
||||
|
||||
auto StructList = PublicAPI->getValueAsListOfStrings("Structs");
|
||||
for (llvm::StringRef StructName : StructList)
|
||||
Structs.insert(StructName);
|
||||
Structs.insert(std::string(StructName));
|
||||
|
||||
auto FunctionList = PublicAPI->getValueAsListOfStrings("Functions");
|
||||
for (llvm::StringRef FunctionName : FunctionList)
|
||||
Functions.insert(FunctionName);
|
||||
Functions.insert(std::string(FunctionName));
|
||||
}
|
||||
|
||||
void index(llvm::RecordKeeper &Records) {
|
||||
|
Loading…
Reference in New Issue
Block a user