Skip to content

Commit

Permalink
Merge pull request #14403 from drepper/warn-uninitialized-squashed
Browse files Browse the repository at this point in the history
Mark variables as initialized [cleaned up version]
  • Loading branch information
Keno committed Dec 17, 2015
2 parents e88ee46 + 82e9118 commit 1e7e967
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4674,6 +4674,7 @@ static void emit_function(jl_lambda_info_t *lam, jl_llvm_functions_t *declaratio
ctx.debug_enabled = false;
do_coverage = false;
do_malloc_log = false;
JL_MARK_INITIALIZED(SP);
}
else {
// TODO: Fix when moving to new LLVM version
Expand Down
3 changes: 3 additions & 0 deletions src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@ extern "C" {
#if defined(__GNUC__)
# define JL_NORETURN __attribute__ ((noreturn))
# define JL_CONST_FUNC __attribute__((const))
# define JL_MARK_INITIALIZED(var) asm("" : "=rm" (var))
#elif defined(_COMPILER_MICROSOFT_)
# define JL_NORETURN __declspec(noreturn)
// This is the closest I can find for __attribute__((const))
# define JL_CONST_FUNC __declspec(noalias)
# define JL_MARK_INITIALIZED(var) do {} while (0)
#else
# define JL_NORETURN
# define JL_CONST_FUNC
# define JL_MARK_INITIALIZED(var) do {} while (0)
#endif

#define container_of(ptr, type, member) \
Expand Down

0 comments on commit 1e7e967

Please sign in to comment.