Identified with readability-redundant-string-init.
}
void LimitedRandomnessCheck::check(const MatchFinder::MatchResult &Result) {
- std::string Msg = "";
+ std::string Msg;
if (getLangOpts().CPlusPlus)
Msg = "; use C++11 random library instead";
const TargetOptions &)
: TargetInfo(Triple) {
- std::string Layout = "";
+ std::string Layout;
// M68k is Big Endian
Layout += "E";
LongWidth = LongAlign = PointerWidth = PointerAlign = 64;
IntMaxType = SignedLong;
Int64Type = SignedLong;
- std::string DataLayout = "";
+ std::string DataLayout;
if (Triple.isOSAIX()) {
// TODO: Set appropriate ABI for AIX platform.
Loc.isInvalid()) {
SrcLocStr = OMPBuilder.getOrCreateDefaultSrcLocStr();
} else {
- std::string FunctionName = "";
+ std::string FunctionName;
if (const auto *FD = dyn_cast_or_null<FunctionDecl>(CGF.CurFuncDecl))
FunctionName = FD->getQualifiedNameAsString();
PresumedLoc PLoc = CGF.getContext().getSourceManager().getPresumedLoc(Loc);
Loc = MapExprs.getMapDecl()->getLocation();
}
- std::string ExprName = "";
+ std::string ExprName;
if (MapExprs.getMapExpr()) {
PrintingPolicy P(CGF.getContext().getLangOpts());
llvm::raw_string_ostream OS(ExprName);
assert(NamespaceTok &&
NamespaceTok->isOneOf(tok::kw_namespace, TT_NamespaceMacro) &&
"expecting a namespace token");
- std::string name = "";
+ std::string name;
const FormatToken *Tok = NamespaceTok->getNextNonComment();
if (NamespaceTok->is(TT_NamespaceMacro)) {
// Collects all the non-comment tokens between opening parenthesis
return {Fixes, 0};
}
- std::string AllNamespaceNames = "";
+ std::string AllNamespaceNames;
size_t StartLineIndex = SIZE_MAX;
StringRef NamespaceTokenText;
unsigned int CompactedNamespacesCount = 0;
break;
case llvm::Triple::PS4: {
// <isysroot> gets prepended later in AddPath().
- std::string BaseSDKPath = "";
+ std::string BaseSDKPath;
if (!HasSysroot) {
const char *envValue = getenv("SCE_ORBIS_SDK_DIR");
if (envValue)
} // namespace
static std::string getName(const CallEvent &Call) {
- std::string Name = "";
+ std::string Name;
if (const auto *MD = dyn_cast<CXXMethodDecl>(Call.getDecl()))
if (const CXXRecordDecl *RD = MD->getParent())
Name += RD->getNameAsString() + "::";
AdjustingCompilations->appendArgumentsAdjuster(
[&ResourceDirCache](const tooling::CommandLineArguments &Args,
StringRef FileName) {
- std::string LastO = "";
+ std::string LastO;
bool HasResourceDir = false;
bool ClangCLMode = false;
auto FlagsEnd = llvm::find(Args, "--");
Intr.Dependencies.insert(&Callee);
// Now create the call itself.
- std::string S = "";
+ std::string S;
if (!Callee.isBigEndianSafe())
S += CallPrefix.str();
S += Callee.getMangledName(true) + "(";
void CommandCompletions::Registers(CommandInterpreter &interpreter,
CompletionRequest &request,
SearchFilter *searcher) {
- std::string reg_prefix = "";
+ std::string reg_prefix;
if (request.GetCursorArgumentPrefix().startswith("$"))
reg_prefix = "$";
triple.getSubArch() == llvm::Triple::NoSubArch)
triple.setArchName("armv8.7a");
- std::string features_str = "";
+ std::string features_str;
const char *triple_str = triple.getTriple().c_str();
// ARM Cortex M0-M7 devices only execute thumb instructions
break;
}
- std::string features = "";
+ std::string features;
uint32_t arch_flags = arch.GetFlags();
if (arch_flags & ArchSpec::eMIPSAse_msa)
features += "+msa,";
break;
}
- std::string features = "";
+ std::string features;
uint32_t arch_flags = arch.GetFlags();
if (arch_flags & ArchSpec::eMIPSAse_msa)
features += "+msa,";
if (!apiname_ptr)
return StructuredData::ObjectSP();
- std::string apiName = "";
+ std::string apiName;
Status read_error;
target.ReadCStringFromMemory(apiname_ptr, apiName, read_error);
if (read_error.Fail())
return StructuredData::ObjectSP();
- std::string className = "";
- std::string selector = "";
+ std::string className;
+ std::string selector;
if (apiName.substr(0, 2) == "-[") {
size_t spacePos = apiName.find(' ');
if (spacePos != std::string::npos) {
std::string InstrumentationRuntimeTSan::GetLocationDescription(
StructuredData::ObjectSP report, addr_t &global_addr,
std::string &global_name, std::string &filename, uint32_t &line) {
- std::string result = "";
+ std::string result;
ProcessSP process_sp = GetProcessSP();
report->GetAsDictionary()->AddIntegerItem("memory_address", main_address);
addr_t global_addr = 0;
- std::string global_name = "";
- std::string location_filename = "";
+ std::string global_name;
+ std::string location_filename;
uint32_t location_line = 0;
std::string location_description = instance->GetLocationDescription(
report, global_addr, global_name, location_filename, location_line);
sys_info.PlatformId = platform_id;
m_data.AppendData(&sys_info, sizeof(llvm::minidump::SystemInfo));
- std::string csd_string = "";
+ std::string csd_string;
error = WriteString(csd_string, &m_data);
if (error.Fail()) {
if (object_sp && object_sp->IsValid())
notify = object_sp->GetBooleanValue();
- std::string description{""};
+ std::string description;
object_sp = dict->GetValueForKey("description");
if (object_sp && object_sp->IsValid())
description = std::string(object_sp->GetStringValue());
regnum.GetName(), regnum.GetAsKind(eRegisterKindLLDB));
return UnwindLLDB::RegisterSearchResult::eRegisterFound;
} else {
- std::string unwindplan_name("");
+ std::string unwindplan_name;
if (m_full_unwind_plan_sp) {
unwindplan_name += "via '";
unwindplan_name += m_full_unwind_plan_sp->GetSourceName().AsCString();
for (const auto &Decl : Decls)
Codes.push_back(Decl.getCode());
- std::string Buffer = "";
+ std::string Buffer;
raw_string_ostream Stream(Buffer);
// Each iteration through this loop represents a single contiguous range in
// the set of codes.
}
std::string AMDGPUTargetID::toString() const {
- std::string StringRep = "";
+ std::string StringRep;
raw_string_ostream StreamRep(StringRep);
auto TargetTriple = STI.getTargetTriple();
<< TargetTriple.getOSName() << '-'
<< TargetTriple.getEnvironmentName() << '-';
- std::string Processor = "";
+ std::string Processor;
// TODO: Following else statement is present here because we used various
// alias names for GPUs up until GFX9 (e.g. 'fiji' is same as 'gfx803').
// Remove once all aliases are removed from GCNProcessors.td.
Twine(Version.Stepping))
.str();
- std::string Features = "";
+ std::string Features;
if (Optional<uint8_t> HsaAbiVersion = getHsaAbiVersion(&STI)) {
switch (*HsaAbiVersion) {
case ELF::ELFABIVERSION_AMDGPU_HSA_V2: