From e192e8ea9e1b69439d595b18f110f0ba73a14866 Mon Sep 17 00:00:00 2001 From: Evghenii Date: Fri, 22 Nov 2013 14:43:14 +0100 Subject: [PATCH] +change static naming in IR to make it compatible with NVVM --- examples_cuda/aobench/ao1.ispc | 12 ++++++------ stmt.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples_cuda/aobench/ao1.ispc b/examples_cuda/aobench/ao1.ispc index b01523d0..8425fd89 100644 --- a/examples_cuda/aobench/ao1.ispc +++ b/examples_cuda/aobench/ao1.ispc @@ -101,7 +101,7 @@ ray_plane_intersect(Isect &isect, Ray &ray, uniform Plane &plane) { } -static inline void +void ray_sphere_intersect(Isect &isect, Ray &ray, uniform Sphere &sphere) { vec rs = ray.org - sphere.center; @@ -158,8 +158,8 @@ ambient_occlusion(Isect &isect, uniform Plane &plane, uniform Sphere spheres[3], orthoBasis(basis, isect.n); - const uniform int ntheta = NAO_SAMPLES; - const uniform int nphi = NAO_SAMPLES; + static const uniform int ntheta = NAO_SAMPLES; + static const uniform int nphi = NAO_SAMPLES; for (uniform int j = 0; j < ntheta; j++) { for (uniform int i = 0; i < nphi; i++) { Ray ray; @@ -200,15 +200,15 @@ ambient_occlusion(Isect &isect, uniform Plane &plane, uniform Sphere spheres[3], /* Compute the image for the scanlines from [y0,y1), for an overall image of width w and height h. */ -static inline void ao_tile( +static inline void ao_tile( uniform int x0, uniform int x1, uniform int y0, uniform int y1, uniform int w, uniform int h, uniform int nsubsamples, uniform float image[]) { - uniform Plane plane = { { 0.0f, -0.5f, 0.0f }, { 0.f, 1.f, 0.f } }; - uniform Sphere spheres[3] = { + static uniform Plane plane = { { 0.0f, -0.5f, 0.0f }, { 0.f, 1.f, 0.f } }; + static uniform Sphere spheres[3] = { { { -2.0f, 0.0f, -3.5f }, 0.5f }, { { -0.5f, 0.0f, -3.0f }, 0.5f }, { { 1.0f, 0.0f, -2.2f }, 0.5f } }; diff --git a/stmt.cpp b/stmt.cpp index ee990c51..fd85f60f 100644 --- a/stmt.cpp +++ b/stmt.cpp @@ -239,9 +239,9 @@ DeclStmt::EmitCode(FunctionEmitContext *ctx) const { new llvm::GlobalVariable(*m->module, llvmType, sym->type->IsConstType(), llvm::GlobalValue::InternalLinkage, cinit, - llvm::Twine("static.") + + llvm::Twine("static_") + llvm::Twine(sym->pos.first_line) + - llvm::Twine(".") + sym->name.c_str()); + llvm::Twine("_") + sym->name.c_str()); // Tell the FunctionEmitContext about the variable ctx->EmitVariableDebugInfo(sym); }