git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54477 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek 2008-08-07 18:13:12 +00:00
Родитель 29da6c59df
Коммит 7a08e289b2
1 изменённых файлов: 3 добавлений и 7 удалений

Просмотреть файл

@ -1422,7 +1422,8 @@ int main(int argc, char **argv) {
// Get information about the target being compiled for.
std::string Triple = CreateTargetTriple();
TargetInfo *Target = TargetInfo::CreateTargetInfo(Triple);
llvm::OwningPtr<TargetInfo> Target(TargetInfo::CreateTargetInfo(Triple));
if (Target == 0) {
fprintf(stderr, "Sorry, I don't know what target this is: %s\n",
Triple.c_str());
@ -1499,13 +1500,8 @@ int main(int argc, char **argv) {
SourceMgr->PrintStats();
}
}
delete Target;
unsigned NumDiagnostics = Diags.getNumDiagnostics();
if (NumDiagnostics)
if (unsigned NumDiagnostics = Diags.getNumDiagnostics())
fprintf(stderr, "%d diagnostic%s generated.\n", NumDiagnostics,
(NumDiagnostics == 1 ? "" : "s"));