[cfe-commits] r54477 - /cfe/trunk/Driver/clang.cpp
Ted Kremenek
kremenek at apple.com
Thu Aug 7 11:13:13 PDT 2008
Author: kremenek
Date: Thu Aug 7 13:13:12 2008
New Revision: 54477
URL: http://llvm.org/viewvc/llvm-project?rev=54477&view=rev
Log:
Micro cleanups.
Modified:
cfe/trunk/Driver/clang.cpp
Modified: cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/clang.cpp?rev=54477&r1=54476&r2=54477&view=diff
==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Thu Aug 7 13:13:12 2008
@@ -1422,7 +1422,8 @@
// 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 @@
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"));
More information about the cfe-commits
mailing list