[llvm-commits] [llvm] r167272 - /llvm/trunk/runtime/libprofile/CommonProfiling.c

NAKAMURA Takumi geek4civic at gmail.com
Thu Nov 1 18:32:02 PDT 2012


Author: chapuni
Date: Thu Nov  1 20:32:02 2012
New Revision: 167272

URL: http://llvm.org/viewvc/llvm-project?rev=167272&view=rev
Log:
libprofile/CommonProfiling.c: Fix according to C89.

Modified:
    llvm/trunk/runtime/libprofile/CommonProfiling.c

Modified: llvm/trunk/runtime/libprofile/CommonProfiling.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/runtime/libprofile/CommonProfiling.c?rev=167272&r1=167271&r2=167272&view=diff
==============================================================================
--- llvm/trunk/runtime/libprofile/CommonProfiling.c (original)
+++ llvm/trunk/runtime/libprofile/CommonProfiling.c Thu Nov  1 20:32:02 2012
@@ -36,10 +36,10 @@
  * variable is set.  If it is then save it and set OutputFilename.
  */
 static void check_environment_variable(void) {
+  const char *EnvVar;
   if (SavedEnvVar) return; /* Guarantee that we can't leak memory. */
 
-  const char *EnvVar = getenv("LLVMPROF_OUTPUT");
-  if (EnvVar) {
+  if ((EnvVar = getenv("LLVMPROF_OUTPUT")) != NULL) {
     /* The string that getenv returns is allowed to be statically allocated,
      * which means it may be changed by future calls to getenv, so copy it.
      */





More information about the llvm-commits mailing list