summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2012-03-27 23:52:22 +0000
committerFrancois Pichet <pichet2000@gmail.com>2012-03-27 23:52:22 +0000
commitda942482a393452788f513776150f20494152d77 (patch)
tree850c619b8a05045d51f30f16afcef0db60f44f75 /runtime
parentf2fd23b0620b3785a85fbde8893ffd777ed8b2b2 (diff)
downloadllvm-da942482a393452788f513776150f20494152d77.tar.gz
llvm-da942482a393452788f513776150f20494152d77.tar.bz2
llvm-da942482a393452788f513776150f20494152d77.tar.xz
MSVC doesn't like the mixing of declarations and statements in a .c file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153549 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime')
-rw-r--r--runtime/libprofile/GCDAProfiling.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/libprofile/GCDAProfiling.c b/runtime/libprofile/GCDAProfiling.c
index 712dba08be..233a2f390f 100644
--- a/runtime/libprofile/GCDAProfiling.c
+++ b/runtime/libprofile/GCDAProfiling.c
@@ -114,8 +114,9 @@ void llvm_gcda_start_file(const char *orig_filename) {
output_file = fopen(filename, "wb");
if (!output_file) {
+ const char *cptr = 0;
filename[0] = '\0'; /* The size of filename should be big enough. */
- char *cptr = strrchr(orig_filename, '/');
+ cptr = strrchr(orig_filename, '/');
strcat(filename, cptr ? cptr + 1 : orig_filename);
output_file = fopen(filename, "wb");