Skip to content

Commit

Permalink
formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Mar 21, 2014
1 parent 2966837 commit fbd4c76
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
30 changes: 14 additions & 16 deletions src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,27 +240,25 @@ static void jl_gen_llvm_gv_array()
ConstantInt::get(T_size,globalUnique+1),
"jl_globalUnique");

Constant *feature_string = ConstantDataArray::getString(jl_LLVMContext,jl_cpu_string);
new GlobalVariable(
*jl_Module,
feature_string->getType(),
true,
GlobalVariable::ExternalLinkage,
feature_string,
"jl_sysimg_cpu_target");
Constant *feature_string = ConstantDataArray::getString(jl_LLVMContext, jl_cpu_string);
new GlobalVariable(*jl_Module,
feature_string->getType(),
true,
GlobalVariable::ExternalLinkage,
feature_string,
"jl_sysimg_cpu_target");

// For native also store the cpuid
if(strcmp(jl_cpu_string,"native") == 0) {
if (strcmp(jl_cpu_string,"native") == 0) {
uint32_t info[4];

jl_cpuid((int32_t*)info, 1);
new GlobalVariable(
*jl_Module,
T_int64,
true,
GlobalVariable::ExternalLinkage,
ConstantInt::get(T_int64,((uint64_t)info[2])|(((uint64_t)info[3])<<32)),
"jl_sysimg_cpu_cpuid");
new GlobalVariable(*jl_Module,
T_int64,
true,
GlobalVariable::ExternalLinkage,
ConstantInt::get(T_int64,((uint64_t)info[2])|(((uint64_t)info[3])<<32)),
"jl_sysimg_cpu_cpuid");
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,7 @@ void jl_dump_objfile(char* fname, int jit_model)
PassManager PM;
PM.add(new TargetLibraryInfo(Triple(jl_TargetMachine->getTargetTriple())));
PM.add(new DataLayout(*jl_ExecutionEngine->getDataLayout()));
if (TM->addPassesToEmitFile(PM, FOS,
TargetMachine::CGFT_ObjectFile, false)) {
if (TM->addPassesToEmitFile(PM, FOS, TargetMachine::CGFT_ObjectFile, false)) {
jl_error("Could not generate obj file for this target");
}

Expand Down
9 changes: 5 additions & 4 deletions src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,18 @@ static void jl_load_sysimg_so(char *fname)
"Please delete or regenerate sys.{so,dll,dylib}.");
uint32_t info[4];
jl_cpuid((int32_t*)info, 1);
if (strcmp(cpu_target,"native") == 0)
{
if (strcmp(cpu_target, "native") == 0) {
uint64_t saved_cpuid = *(uint64_t*)jl_dlsym(sysimg_handle, "jl_sysimg_cpu_cpuid");
if (saved_cpuid != (((uint64_t)info[2])|(((uint64_t)info[3])<<32)))
jl_error("Target architecture mismatch. Please delete or regenerate sys.{so,dll,dylib}.");
} else if(strcmp(cpu_target,"core2") == 0) {
}
else if(strcmp(cpu_target,"core2") == 0) {
int HasSSSE3 = (info[3] & 1<<9);
if (!HasSSSE3)
jl_error("The current host does not support SSSE3, but the system image was compiled for Core2.\n"
"Please delete or regenerate sys.{so,dll,dylib}.");
} else {
}
else {
jl_error("System image has unknown target cpu architecture.\n"
"Please delete or regenerate sys.{so,dll,dylib}.");
}
Expand Down

0 comments on commit fbd4c76

Please sign in to comment.