From f8f405000b6a45a479eaba6ff26d9c993e50ac28 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sat, 18 May 2013 17:24:25 +0200 Subject: [PATCH] Avoid confusing naming convention. We generally do not really use underscore prefixes. But if they are used in other codebases, they typically refer to member variables. --- gen/declarations.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/gen/declarations.cpp b/gen/declarations.cpp index 2f32b110..8fa712b9 100644 --- a/gen/declarations.cpp +++ b/gen/declarations.cpp @@ -143,27 +143,26 @@ void VarDeclaration::codegen(Ir* p) Logger::println("parent: %s (%s)", parent->toChars(), parent->kind()); - // not sure why this is only needed for d2 - bool _isconst = isConst() && init; + bool isLLConst = isConst() && init; Logger::println("Creating global variable"); assert(!ir.initialized); ir.initialized = gIR->dmodule; - std::string _name(mangle()); + std::string llName(mangle()); - LLType *_type = DtoConstInitializerType(type, init); + LLType *llType = DtoConstInitializerType(type, init); // create the global variable #if LDC_LLVM_VER >= 302 // FIXME: clang uses a command line option for the thread model - LLGlobalVariable* gvar = new LLGlobalVariable(*gIR->module, _type, _isconst, - DtoLinkage(this), NULL, _name, 0, + LLGlobalVariable* gvar = new LLGlobalVariable(*gIR->module, llType, isLLConst, + DtoLinkage(this), NULL, llName, 0, isThreadlocal() ? LLGlobalVariable::GeneralDynamicTLSModel : LLGlobalVariable::NotThreadLocal); #else - LLGlobalVariable* gvar = new LLGlobalVariable(*gIR->module, _type, _isconst, - DtoLinkage(this), NULL, _name, 0, isThreadlocal()); + LLGlobalVariable* gvar = new LLGlobalVariable(*gIR->module, llType, isLLConst, + DtoLinkage(this), NULL, llName, 0, isThreadlocal()); #endif this->ir.irGlobal->value = gvar;