diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-08-07 18:13:12 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-08-07 18:13:12 +0000 |
commit | 7a08e289b2cab7556759bad59726310406db27b5 (patch) | |
tree | c5a30b866ef4469878d875eced0d3e85e3a94110 | |
parent | 29da6c59df7ca994e75139303a9230b24e2abaad (diff) |
Micro cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54477 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Driver/clang.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp index 7721e83aff..69fb6a2380 100644 --- a/Driver/clang.cpp +++ b/Driver/clang.cpp @@ -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")); |