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