History log of /frameworks/compile/slang/slang_rs_context.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6a360ef49a83c623784ce97e32f7c07b170ef364 24-Jul-2017 David Gross <dgross@google.com> Improve Java reflection for 32-bit versus 64-bit differences.

Bug: 32780232
Bug: 20260865
Bug: 21597073

By default, when targeting API L or above, we support both 32-bit and
64-bit targets. We do so by running two compilation passes -- a
32-bit compilation pass followed by a 64-bit compilation pass. We
generate reflected Java code as part of the 64-bit compilation pass.
This can cause problems if there are "significant" differences between
the user's script (.rs file) as seen during 32-bit compilation
compared to 64-bit compilation -- for example, rs object handles (such
as rs_allocation and rs_element) are different sizes, the type size_t
is a different size, and a user can create arbitrary differences by
using the __LP64__ macro. If any of those differences affect
reflected code (for example, by changing exported types), then we may
get incorrect runtime behavior on 32-bit targets.

At present we do have some special processing for rs object handles.
However, we don't properly address all cases -- for example, when an
rs object handle is a field of a struct or an argument to an invokable
function, reflected code does not get the layout of the struct or
argument list correct on 32-bit targets. We also make no attempt to
address any other differences (such as size_t or __LP64__).

This CL is intended to fully address 32-bit versus 64-bit reflection
issues:

1) Fully handle rs object handle size differences when laying out data
(such as structs and invokable function argument lists).

2) Emit errors for any other differences between 32-bit and 64-bit
compilation that would require changes to reflected code (for
example, no exported global may be of type size_t).

We solve these problems as follows:

a) As part of the 32-bit compilation pass, execute (most of) the same
code paths we would use to generate reflected code, but instead of
actually generating reflected code, collect information for later.

b) When we generate reflected code as part of the 64-bit compilation
pass, we consult the information collected during the 32-bit
compilation pass in order to do target sensitive data layout and to
emit errors for intolerable 32-bit versus 64-bit differences.

This CL requires changes to the compatibility library (in
frameworks/rs).

Test: many
- slang/lit-tests
- slang/test
- RsTest aosp_x86_64-eng (aosp, emulator) 32-bit and 64-bit
- cts aosp_x86_64-eng (aosp, emulator) RenderScript and CtsRsCppTestCases
- RSTestBackward
- aosp_arm-eng
- n9 LMP MR1 Release (LM)
- angler MNC DR Release (MD)
- aosp_arm64-eng
- n9 LMP MR1 Release (LM)
- angler MNC DR Release (MD)
- RSTest_Backward19
- aosp_arm-eng
- n5 KLP MR2 Release (KT)
- n9 LMP MR1 Release (LM)
- angler MNC DR Release (MD)
- RSTest_CompatLib
- aosp_arm-eng
- n9 LMP MR1 Release (LM)
- angler MNC DR Release (MD)
- aosp_arm64-eng
- n9 LMP MR1 Release (LM)
- angler MNC DR Release (MD)
- aosp_x86-eng
- emulator aosp
- aosp_x86_64-eng
- emulator aosp
- RSTest_Compat19
- aosp_arm-eng
- n5 KLP MR2 Release (KT)
- n9 LMP MR1 Release (LM)
- angler MNC DR Release (MD)
- aosp_x86
- emulator aosp

Change-Id: I5d1fc51e35693588dff05afa48e1a4902859036e
(cherry picked from commit d80e58b259c2febc4907aed4aca9d88d43bdd1a1)
/frameworks/compile/slang/slang_rs_context.cpp
b6a143562bda2117824a0515c208504e9a2830f1 26-Jul-2016 Pirama Arumuga Nainar <pirama@google.com> Fix slang to compile with LLVM r275480

Bug: http://b/31320715

In addition to fixing compilation with the new LLVM sources, this change
also switches to using LLVM's RenderScript triples. Clang also uses
this triple to set the size and alignment of 'long' data type to
64-bits. We no longer need/have the '+long64' CPU feature.

Test: Run RenderScript tests (host tests for slang and libbcc, RsTest, CTS)

Change-Id: I3d2795bc0253a10d6fb36bfb0c28eb0c2e9a2922
/frameworks/compile/slang/slang_rs_context.cpp
8ee018bdb53fc5abdc430878e2bec0c0c0aa560f 02-Jun-2016 David Gross <dgross@google.com> Delete simple reduction implementation.

Bug: 27298560
Change-Id: I775dd782d658c7c720f57aa31a584deee98cdd17
/frameworks/compile/slang/slang_rs_context.cpp
40bac5d72af8fe32ab3d0bb38aafb5c65d8d9dfa 09-May-2016 Yang Ni <yangni@google.com> Disallow launching old-style kernels via rsForEach

Bug: 28666819

The "kernel" attribute should be the sole criterion for a kernel
function launchable via rsForEach() in single-source RS.
(The utility function isRSForEachFunc() considers a super set of such
functions as kernels, including old-style kernels or any function
that returns void and has a pointer type first parameter, which
don't have the "kernel" attribute.)

Launching an old-style kernel is forbidden via an rsForEach() or
rsForEachWithOptions() call. Old-style kernels can still co-exist in
the same script with such a call, and can be launched via Java or C++
reflected code.

To make this coexisting possible, old-style kernels are moved to
the end of the list for exported kernels in the metadata. This way,
the single-source RS frontend pass can agree with the metadata
on the slot assignment for "new-style" kernels.

Change-Id: I3d61c1c91b29043f3597ae622ef7c2ef972eb789
/frameworks/compile/slang/slang_rs_context.cpp
8f093e05e28046b6fc74175b66a06152f72e0c66 04-Mar-2016 Pirama Arumuga Nainar <pirama@google.com> Update slang for LLVM rebase to r256229

Bug: http://b/26987366

(cherry picked from commit 98cfae456bb1831336bce2b21979a04e2e31fed4)

Change-Id: Ic7f67da3fee0da075f11e3125132af7ea9c96457
/frameworks/compile/slang/slang_rs_context.cpp
5e306b944425a952fe744f59d828538137a59375 09-Feb-2016 David Gross <dgross@google.com> Change mechanism used to ensure #pragma rs reduce functions are not deleted.

Requires corresponding change in frameworks/compile/libbcc.

The functions referenced by "#pragma rs reduce" are static functions.
If the only references to such a function are from these pragmas, then
the function looks unreferenced, and hence without additional work
will be deleted by clang.

The old solution to this problem is to add all such functions to
the LLVM intrinsic variable @llvm.used. Unfortunately, this
doesn't just prevent clang from deleting these functions -- it
also prevents llvm from deleting these functions. This is
undesirable in the case of the combiner function (which is not
currently needed by the CPU reference driver) or the accumulator
function (because the CPU reference driver needs an "expanded"
form of the accumulator function, not the original accumulator
function).

The new solution is that for each such function "f" we generate a
dummy variable initialized with a pointer to that function:

void *.rs.reduce_fn.f = (void*)&f;

This prevents clang from deleting "f", but does not automatically
prevent llvm from deleting "f" (e.g., the backend could use some
other mechanism to retain "f" if necessary, while
deleting ".rs.reduce_fn.f").

Bug: 23535724
(cherry picked from commit 633f2980e148775887f0d416f8dd663a6d3b48df)

Change-Id: I272445d2bf706cde8d81ed65aa32df59c3ba0e47
/frameworks/compile/slang/slang_rs_context.cpp
65f23ed862e1a1e16477ba740f295ff4a83ac822 08-Jan-2016 David Gross <dgross@google.com> Add semantic analysis of "#pragma rs reduce" script functions.

Also:
- Make initializer() optional.
- Swap initializer and accumulator in metadata.
- Expose new slang::HasRSObjectType() interface from reference counting engine.

Bug: 23535724
Change-Id: If042e227a1af87c231c867ef20ed4c2082bb1871
/frameworks/compile/slang/slang_rs_context.cpp
40a0911e5cbdf600bce5a390148865626ac7086c 05-Dec-2015 Stephen Hines <srhines@google.com> Merge changes I5b11fd14,I85f4e6db

* changes:
Void pointers can't be exported.
Fix a set of inverted conditionals for kernel validation.
13fad85b3c99a37c17d8acfec72f46b8ee64e912 24-Nov-2015 Stephen Hines <srhines@google.com> Void pointers can't be exported.

Bug: http://b/25853842

Change-Id: I5b11fd14b6cd57a06522e921c62ed033488aa08e
/frameworks/compile/slang/slang_rs_context.cpp
2615f383dfc1542a05f19aee23b03a09bd018f4e 03-Dec-2015 Yang Ni <yangni@google.com> Tidy up AST nodes for rsForEach

Bug: 23535985

Slang asserts in debug build, for the following reasons:
1) A mistake using void type instead of the function type for
rsForEachInternal();
2) rsForEachInternal() was declared with the second parameter being
void*, but should be rs_script_call_t*; and
3) Integer 0 for launch option is used for rsForEach without an
launch option, where a rs_script_call_t* is expected.

This CL fixes those.

Change-Id: If6245ceca774ee38830aeddda156be55cde9a137
/frameworks/compile/slang/slang_rs_context.cpp
88f21e16250d2e52a75607b7f0c396e1c2a34201 19-Nov-2015 Yang Ni <yangni@google.com> Changed generated calls to rsForEachInternal

Bug: 23535985

Avoided using varargs in rsForEachInternal, since LLVM handles varargs
differently on x86 than on ARM.

Changed generated calls to rsForEachInternal to match the new
signature, in which the last argument is an allocation array.

Change-Id: I1b53861083b87c51c5bdaeaec2be469dc7af7a0a
/frameworks/compile/slang/slang_rs_context.cpp
15410146cdc2a354ade80ceb3cd134f8a792d92a 10-Nov-2015 Yang Ni <yangni@google.com> Fixed dummy root creation

There should be zero exported foreach functions in the metadata, if
there is no root function seen and there is no non-root kernel seen.

Create a dummy root only if there exists other non-root kernels.
Remove the nullptr placeholder in the exported for each function
vector if there is no kernel (root or not) seen in the script.

Also adjusted the lit test script to make it run on a setup where
the out directory is not under the source tree.

Change-Id: I4c4a5fe54a7fe926db9a432c9fca2ddc5f354ba8
/frameworks/compile/slang/slang_rs_context.cpp
1946749cebf4a64341d8210890688fef7d958c22 27-Oct-2015 Yang Ni <yangni@google.com> Launch options & multi inputs for single-source RS

Bug: 23535985

Also renamed rsParallelFor to rsForEach.
Added checks for number of allocations to rsForEach matching kernel function
expectation.

Added slang tests.

Removed code from RSContext for remembering the rs_allocation AST subtree.

Change-Id: Ibc22bd5e9585a4471b15920ef60fe1fe2312de49
/frameworks/compile/slang/slang_rs_context.cpp
a5d846df579f3d60457f664a284afe2cc2b9f8db 09-Oct-2015 Stephen Hines <srhines@google.com> Don't allow user-defined uninitialized const variables to be exported.

Bug: 24607459

User-defined variables that are both uninitialized and const can never
be linked/initialized properly. We limit llvm-rs-cc to only accepting
extern const variables defined in its own headers (such that a proper
initialization value can be provided by the runtime library). This will
allow us to make constants that lldb can refer to from user commands,
since the extern const symbols will remain in the final shared object.

Change-Id: I44dbd680278af637c12868e93487745f78936ed0
/frameworks/compile/slang/slang_rs_context.cpp
fb40ee2a90f37967bf4a40a18dec7f60e5c580d8 13-Oct-2015 Yang Ni <yangni@google.com> Revert "Revert "Handle kernel launch calls""

Bug: 23535985

This reverts commit 5d9263d3a3a7457b9e5fe6e518c0d822dcdfcda6.

This also fixes issues in change list 172074, which caused some
slang tests to fail due to changed hehavior in error handling.

The fix was based on changes originally posted by srhines@.

To keep single-source functionality working, I separated kernel
name logging from the final export processing code. We would
build a map from kernel funciton names to slot numbers as we parse
the script. The map is used when translating a rsParallelFor call
to a call to the internal rsForEachInternal API, so that we can find
the proper slot numbers.

Here is Steve's original commit message.

Only call processExports() after a successful C99 compilation.

This refactoring fixes a bug in the previous single-source patch, where
exported functions/variables/kernels were being processed during the
regular compilation steps. This wastes compile time, since we don't need
to actually prepare for outputting reflected Java/C++ code if the
compile is going to fail for regular C99 reasons.

Change-Id: I81d88731188f4258f12f4c90ae8dd8abc8c2d641
/frameworks/compile/slang/slang_rs_context.cpp
5d9263d3a3a7457b9e5fe6e518c0d822dcdfcda6 13-Oct-2015 Stephen Hines <srhines@google.com> Revert "Handle kernel launch calls"

This reverts commit 45aa8c52c9400cef86efe4343f04e605a66f42af.

Change-Id: If33ad432e4381d1dc64ef884b51eb50f707807ff
/frameworks/compile/slang/slang_rs_context.cpp
45aa8c52c9400cef86efe4343f04e605a66f42af 14-Sep-2015 Yang Ni <yangni@google.com> Handle kernel launch calls

Bug: 23535985

Find rsParallelFor(void*, ...) calls in the .rs source code and
translate them into rsForEachInternal(int, rs_allocation, rs_allocation)
calls.

Semantic checks are pretty limited at this point. Will enhance them in followup CLs.

Change-Id: I6e2cf3db868f426aa8e0b9a77732b66c1e6b9f03
/frameworks/compile/slang/slang_rs_context.cpp
c0c5dd85f2d2df2bcf0cb284001f544d6c42eff9 24-Jul-2015 Matt Wala <wala@google.com> Add initial support for validating and exporting reduce kernels.

Bug: 22631253

This change adds support to slang to validate the reduce-style
kernels for errors, and also to create reduce metadata.

Change-Id: Ic9144402dff93a2a28687864637e67fca6808e2e
/frameworks/compile/slang/slang_rs_context.cpp
3f45a25c23fa0f2cca4070f4d8713dc1a83f5ff7 30-Jun-2015 Matt Wala <wala@google.com> slang: Improve handling of StringMapEntries.

In Slang::checkODR(), change a line that deletes an entry when it
fails to be inserted. There are two problems with this line:
(1) Calling delete is wrong, since the entry is malloc'ed.
(2) The line is unreachable.
Since the line is unreachable, replace it with an assert attesting to
this fact.

In RSContext::insertExportType(), the code properly cleans up an entry
that failed to be inserted with free(). However, given that malloc()
is not called anywhere in slang, this could be confusing. Use the
Destroy() member function instead.

Change-Id: Ifc0920a86bb010a89e93319a70a423d87fb97e3f
/frameworks/compile/slang/slang_rs_context.cpp
eae0b7ad0195360b0afc37d51553f2917f1aa365 16-Jun-2015 Matt Wala <wala@google.com> Extract special function handling functions into their own namespace.

This moves a bunch of static functions out of RSExportForEach.

Change-Id: Ibe022105cc03239990af8df3dd13d86a1d4836ec
/frameworks/compile/slang/slang_rs_context.cpp
f5b882cc561f656eb650d0fa6db7bac57989ab12 16-Jun-2015 Matt Wala <wala@google.com> Move kernel/static incompatibility check into AST validator.

The predicate RSExportForEach::isRSForEachFunc() was checking and
reporting an error if kernel attributes were paired with static
function declarations, which is an error in RenderScript. It makes
more sense to do the check in the AST validator. That way the work of
the predicate function doesn't involve validation.

Change-Id: I8a956f5e4ad72845ed759f9088cf8e3d543d2a0a
/frameworks/compile/slang/slang_rs_context.cpp
c706907a8041faaa882f9bd87f1d1c1669023a62 18-Mar-2015 Stephen Hines <srhines@google.com> Update slang for LLVM rebase to r230699.

Change-Id: I6fa2c59b1445735e2eb95deb4ac503cb9ed369ee
/frameworks/compile/slang/slang_rs_context.cpp
5abbe0e9ca2508260b627ffef2bf01e2554e8357 13-Aug-2014 Chris Wailes <chriswailes@google.com> Replace the NULL macro with nullptr literal.

Change-Id: I33609969cd0d7aa55eaa83fb2c65f5faa6d55fa0
/frameworks/compile/slang/slang_rs_context.cpp
a9186d31532c779257ae3a495034417dfa037e83 24-Jul-2014 Stephen Hines <srhines@google.com> Merge "Update slang for LLVM rebase to r212749."
2eb9a3f7c48fe54eb4e813d80e3363bc79553a1e 16-Jul-2014 Stephen Hines <srhines@google.com> Update slang for LLVM rebase to r212749.

Change-Id: I5819f9df3212ffcfa8f34c11d3cea29f1fd04878
/frameworks/compile/slang/slang_rs_context.cpp
109e90a854ac8d8f4df24ef27db636a641ba9913 08-Jul-2014 Jean-Luc Brouillet <jeanluc@google.com> Deprecate rs_fp_imprecise.

If rs_fp_imprecise is specified, issue a warning and
use rs_fp_relaxed instead.

Also add a validation that two incompatible precision
pragmas have been specified.

Change-Id: Ib70430872b4a3058b36f8196cbcffba2e4beb322
/frameworks/compile/slang/slang_rs_context.cpp
9ae18b2bbee0b08afd400542e863dd665ff76059 11-Jun-2014 Stephen Hines <srhines@google.com> Add an option to emit 32-bit and 64-bit bitcode.

Bug: 16031597

Change-Id: Ifb3c4eca5e7ae16106260c2b5f5da6854c021a3a
/frameworks/compile/slang/slang_rs_context.cpp
fc4f78b9c7941132fb048a83f0e4ba528c3b4fd0 11-Jun-2014 Stephen Hines <srhines@google.com> Add -v (-verbose/--verbose) option to llvm-rs-cc.

This change also suppresses the display of "Generating Script*." output by
default.

Change-Id: I034a3ba20acf64e1eb9ecc02133edb03b643d559
/frameworks/compile/slang/slang_rs_context.cpp
12fc283f4108fd6f7f0164c121ff2f6fb5044225 04-Jun-2014 Jean-Luc Brouillet <jeanluc@google.com> Don't go through RSContext for the Java reflection (take 2)

Change-Id: I08e5be9c4e39501238a9f9c382f0c66b2caf5a8d
/frameworks/compile/slang/slang_rs_context.cpp
7fda9848f91fc5cca55f63423b35672128b6daab 04-Jun-2014 Jean-Luc Brouillet <jeanluc@google.com> Revert "Don't go through RSContext for the Java reflection."

This reverts commit cc1b9699446aea20773e4c3c6ff5759fedd8ab51.

Change-Id: I330f8beb02ba4868ce115848543c506d5dea46bf
/frameworks/compile/slang/slang_rs_context.cpp
cc1b9699446aea20773e4c3c6ff5759fedd8ab51 04-Jun-2014 Jean-Luc Brouillet <jeanluc@google.com> Don't go through RSContext for the Java reflection.

The C++ code does not do that. RSContext should just contain the
context.

Change-Id: Idd9d4c00bdd27b51ba7fc0aee8c5e7cfdab6d0a0
/frameworks/compile/slang/slang_rs_context.cpp
602def74e8afa68b72a1f9391c31d6ff152add53 28-May-2014 Jean-Luc Brouillet <jeanluc@google.com> Rename RSReflection to RSReflectionJava.

Change made to make it more obvious the type of code created for this file. Reformatted the headers with clang-format, hence the slight changes in indentation style.

Change-Id: Ib2c748d84bd4eb8a188f95c0c60014ad4c60711f
/frameworks/compile/slang/slang_rs_context.cpp
796e7b1400d3f3f7c07496d88bb48129ea925bb9 27-May-2014 Jean-Luc Brouillet <jeanluc@google.com> Remove useless "return;" statements.

More cleanups to follow...

Change-Id: Ib8348255273771c1e9ff07e79bd7fbc8f2795a5b
/frameworks/compile/slang/slang_rs_context.cpp
44d495d2ad8c350a8f586502c9ee8e97a513646a 23-May-2014 Stephen Hines <srhines@google.com> Clean up embedded bitcode path for Java.

Change-Id: I79cc65778173c7eeab028dedfc4adcb59bef44c2
/frameworks/compile/slang/slang_rs_context.cpp
ee4016d1247d3fbe50822de279d3da273d8aef4c 11-Apr-2014 Tim Murray <timmurray@google.com> Update Slang for Clang/LLVM 3.5a.

Change-Id: Icd59efa1197098076555c505c31939866e504a83
/frameworks/compile/slang/slang_rs_context.cpp
50cab07b24f9d85899e697cac88a05cb8347fe74 25-Mar-2014 Narayan Kamath <narayan@google.com> Fix clang compile errors.

Clean up several unnecessary forward declarations
and private member variables.

Change-Id: I5cd27a82ae222b8ee589cd279d8778ef7061a531
/frameworks/compile/slang/slang_rs_context.cpp
d3f7527b105d21f1c69d3473eb88a762f2c3ab5a 17-Jan-2014 Jean-Luc Brouillet <jeanluc@google.com> Add ReportErrror/Warning to RSContext.

Remove a lot of boilerplate code by adding error reporting methods to RSContext. There are still a few additional files that could be cleaned. That will be for another CL someday.

Change-Id: I6a261735720227ac87d94dbdea5ce4a7b8ef6cca
/frameworks/compile/slang/slang_rs_context.cpp
925879fa622dda293806ed25b1ee63d2f4a8d65a 20-Jul-2013 Stephen Hines <srhines@google.com> Clean up handling of Java package name for llvm-rs-cc.

Adds support for C++ code generator to use this package name as well.

This change also resolves a small issue with an uninitialized mVerbose flag.

Change-Id: Ia3037a3f4dbe172ddc51af3064ac1708526a6df6
/frameworks/compile/slang/slang_rs_context.cpp
44f10063c2c08dab103a44cded0c3a288d65d43b 13-Jun-2013 Stephen Hines <srhines@google.com> Update slang for LLVM merge to r183849.

s/getLinkage/getFormalLinkage
Path.h -> PathV1.h
Fix test output diagnostics related to pragma location

Change-Id: I7ab5372e848494ac40f1284eb6f9accc18092ad7
/frameworks/compile/slang/slang_rs_context.cpp
4c7c95cab6a7baf46bbedaf6c2a67d93eafc3e66 22-Jan-2013 Stephen Hines <srhines@google.com> Merge "Skip reflection of resize() when building for the compatibility library."
23c4358f12bd9d0ba7166eceebd683db95a41b3f 10-Jan-2013 Stephen Hines <srhines@google.com> Updates for LLVM merge to r171906 on 20130108.

Change-Id: I4cf3718041d8876d4a23a412b6b4fa4226ec3b50
/frameworks/compile/slang/slang_rs_context.cpp
82754d87921c94e70562aa977cc92e28fc38b1d0 19-Jan-2013 Stephen Hines <srhines@google.com> Skip reflection of resize() when building for the compatibility library.

Change-Id: I2669914b3139756a8cf559ed99b845e77df87df0
/frameworks/compile/slang/slang_rs_context.cpp
089cde338148fbb75825aea4539ccdae8211ffef 08-Dec-2012 Stephen Hines <srhines@google.com> Forbid non-const static variables in kernels.

Bug: 7688011
Change-Id: If03084a9ece76478e0ed0847b75f09c41b89a500
/frameworks/compile/slang/slang_rs_context.cpp
cf9a73a4140402c0e9e4fbab27477f22cc7d8e3c 20-Sep-2012 Stephen Hines <srhines@google.com> Fix teardown bug for multiple files without pragma.

This previously caused a segmentation fault in llvm-rs-cc. We were
improperly using the DiagnosticsEngine after we had reset() everything.

Bug: 7202787

Change-Id: Ic8522566ef257e70f16caf34b89f6a8e012908c5
/frameworks/compile/slang/slang_rs_context.cpp
0a813a3ef2a82f19d7eab9e23ae8493197143803 04-Aug-2012 Stephen Hines <srhines@google.com> Add RS package name option + support.

Usage:
llvm-rs-cc -rs-package-name=android.renderscript ...
or
llvm-rs-cc -rs-package-name android.renderscript ...

This allows us to reflect a different import path for our base RS classes.
The default value is "android.renderscript", resulting in a reflection that
produces "import android.renderscript.*;".

Change-Id: Icf7e83b963ba70c803899697f49b41fdfb9586e7
/frameworks/compile/slang/slang_rs_context.cpp
14a7e172a411372d4edd84ea791ab972598dfa17 24-Apr-2012 Shih-wei Liao <sliao@google.com> Apply changes to migrate to CLANG-155088-20120419.

Change-Id: I77fee87d511ce9d36c56b76c58b4a6caef888676
/frameworks/compile/slang/slang_rs_context.cpp
c17e198ffcd37bfc57e3add1f6eee952ae2a2eab 22-Feb-2012 Stephen Hines <srhines@google.com> Support dummy root() and re-ordering in presence of non-root kernels.

BUG=6000538

Change-Id: Ib3ed249916d36acf68ab32e9216804ae1da5e991
/frameworks/compile/slang/slang_rs_context.cpp
9999ec3aa0c4d7a6befd3a300dc07f0cea91cb6c 11-Feb-2012 Stephen Hines <srhines@google.com> Clean up graphics/compute root() distinction.

BUG=6000538

Change-Id: I29096556dff2072a8757e0dfd3321006cd60bb27
/frameworks/compile/slang/slang_rs_context.cpp
7aff4a0a124209fdf93ecbcd7aed701d39ba094b 09-Dec-2011 Stephen Hines <srhines@google.com> Update error diagnostics.

Change-Id: I8415450504f95cc3ad35866ed884fafc7ee24c90
/frameworks/compile/slang/slang_rs_context.cpp
f736d5a12269e7e74740b130cdca98d9839b31e6 27-Oct-2011 Stephen Hines <srhines@google.com> Add back pre-ICS support for "int root(int);".

BUG=5521638

Change-Id: Ic1f3c071562c687a98125c2151e306313c5405b8
/frameworks/compile/slang/slang_rs_context.cpp
4a4bf92a8add68629a7e6e59ef81c3c3fe603a75 19-Aug-2011 Stephen Hines <srhines@google.com> Don't generate forEach() on pre-ICS target SDK.

Change-Id: I794587d1f79a08aca8cc4f7f20f4012050ab0501
/frameworks/compile/slang/slang_rs_context.cpp
b5a89fbfcba6d8817c1c3700ed78bd6482cf1a5d 17-May-2011 Stephen Hines <srhines@google.com> Clean up forEach reflection code.

BUG=4203264

Change-Id: I8196608408fe333bd8e875d9517b8e875bdce17d
/frameworks/compile/slang/slang_rs_context.cpp
593a894650e81be54173106ec266f0311cebebd3 11-May-2011 Stephen Hines <srhines@google.com> Simple support for reflecting rsForEach().

BUG=4203264

Change-Id: Idf722ee3fb07c8e46ac0c4628e753ff2fa6840cf
/frameworks/compile/slang/slang_rs_context.cpp
b6809edd6ee8b90982425fb8ad24e867708b46fc 09-May-2011 Stephen Hines <srhines@google.com> Provide multiple diagnostics when we can.

Change-Id: I2e13baa20cb7dd39ae2e00cd011771b1b8574357
/frameworks/compile/slang/slang_rs_context.cpp
5baf6324a97430016026419deaef246ad75430fc 26-Apr-2011 Stephen Hines <srhines@google.com> Check RS functions (esp. init/root) for validity.

Change-Id: Ice65c8b691550e2d11caf621e0f88c822316601b
/frameworks/compile/slang/slang_rs_context.cpp
be27482cdeaf08576bc39b72a15d35d13014a636 16-Feb-2011 Logan <tzuhsiang.chien@gmail.com> Apply changes to migrate to LLVM Mar 6th 2011.

- API for name mangling. (Changing from non-public APIs to the
public one)

- API changes for clang::Diagnostic::getNumErrors ->
clang::Diagnostic::hasErrorOccurred

- API changes for clang::CharUnits and Quantity type.

- API changes libLLVMSystem -> libLLVMSupport.

- Change clang::Token::eom -> clang::Token::eod.

- Remove SourceRange parameter for DeclRefExpr::Create and
MemberExpr::Create.

- Add const qualifier for several unsafe type cast.
/frameworks/compile/slang/slang_rs_context.cpp
f2174cfd6a556b51aadf2b8765e50df080e8f18e 10-Feb-2011 Stephen Hines <srhines@google.com> Handle struct reference counting.

Bug: 3092382

Change-Id: I215bd8245324ec2b7752a7c40817e3e5cd1c0e00
/frameworks/compile/slang/slang_rs_context.cpp
3fa286b4c2f110c6be2bbfac9c715bb1ec880338 10-Feb-2011 Shih-wei Liao <sliao@google.com> Fix b/3427124. Adding the overloadable invokable feature. Reflect that type of invokables to Java.

1. Add __attribute__((overloadable)) support on the rs side for invokables. Requested by the Books team.
2. Add name mangling support and MangleContext.
3. Add the test P_overload.
4. This CL only affects Honeycomb SDK. It doesn't affect Final ROM.
5. This CL should go in at the same time with another CL on external/clang.git (to be done now.)

Change-Id: I9e743894a97626d8c27b0dd9c0a51cef1175d2ab
/frameworks/compile/slang/slang_rs_context.cpp
6e6578a360497f78a181e63d7783422a9c9bfb15 08-Feb-2011 Stephen Hines <srhines@google.com> Add support for assertions in llvm-rs-cc.

Bug: 3430674
Change-Id: I3400238652449cde84275cc2a770f405332d9544
/frameworks/compile/slang/slang_rs_context.cpp
4cc67fce91f43215d61b2695746eab102a3db516 01-Feb-2011 Stephen Hines <srhines@google.com> Support for generating .java dependencies for RS.

This updates the -MD option to also emit .java targets to the dependency
information placed in our foo.d file.

Change-Id: I189cf6302bc1cbd6201487743a37dced87b5c5eb
/frameworks/compile/slang/slang_rs_context.cpp
3fd0a94a5cf1656569b1aea07043cc63939dcb46 18-Jan-2011 Stephen Hines <srhines@google.com> Refactor pragma handling (pass everything to LLVM)

Change-Id: Id09d4934af06f0880cd867456218602ce9a9e2de
/frameworks/compile/slang/slang_rs_context.cpp
96ab06cbe40b2d73c0eb614f814cd761d8962b6b 06-Jan-2011 Stephen Hines <srhines@google.com> Add support for the version pragma.

Change-Id: I62707dcb432093ba50db95e527d55ff781be22a9
/frameworks/compile/slang/slang_rs_context.cpp
2ef9bc0cfbca2152d972c0975005f8c897c2a42c 14-Dec-2010 Stephen Hines <srhines@google.com> Convert fprintf -> diagnostic messages.

Proper support/test for multi-level pointer types.
Proper diagnostics for bit fields, which are currently
not supported.

Bug: 2954471
Change-Id: I347f14f02fcf7fbef9f6e5dde5b4e948391a0691
/frameworks/compile/slang/slang_rs_context.cpp
c97a333bc84ce8c28c96d07734cbded75c914639 01-Dec-2010 Stephen Hines <srhines@google.com> Improve validation of AST before reflection.

Change-Id: If4b52f3a713ab97145bc31ef42b18d1cc144099a
/frameworks/compile/slang/slang_rs_context.cpp
c808a99831115928b4648f4c8b86dc682594217a 30-Nov-2010 Stephen Hines <srhines@google.com> Add prelim error check for pointers in structs.

Bug: 2954471
Change-Id: Icacf67dd3eeb3dda67e1eae3d54e11f7efa6c680
/frameworks/compile/slang/slang_rs_context.cpp
35f5b39f0490953f1fe13ef803b43e3ced9a01d9 23-Nov-2010 Stephen Hines <srhines@google.com> Missing pragma for java_package_name is an error.

Bug: 3122920

Change-Id: I88fcb07b95d47e1aba28fcf6e255d17ef957f285
/frameworks/compile/slang/slang_rs_context.cpp
2d2512c5703bb238b7935ab5228beff6563f2f94 19-Nov-2010 Stephen Hines <srhines@google.com> Remove legacy code for export func/var pragmas.

Change-Id: I62e0768b11e4192ffde8ed26c0160d62e8f09714
/frameworks/compile/slang/slang_rs_context.cpp
3fbe68a4ec20fec25f8a40191437bbc02d00f591 18-Nov-2010 Stephen Hines <srhines@google.com> Turn on support for exporting non-static funcs.

Bug: 2932253
Change-Id: Ice5422b4a3d78f8c2973e1af6c8abea30fa74bb6
/frameworks/compile/slang/slang_rs_context.cpp
e639eb5caa2c386b4a60659a4929e8a6141a2cbe 09-Nov-2010 Stephen Hines <srhines@google.com> Improve code style.

Change-Id: I26e043849bce2a4b41ae132fbe0c882f4a6f112f
/frameworks/compile/slang/slang_rs_context.cpp
9e5b503349719144f63ccb7c62ee9c291a7d83b8 03-Nov-2010 Stephen Hines <srhines@google.com> Use Clang object references instead of pointers.

Change-Id: Ief0e78859572761d880eaad9ae854f14e65da2c4
/frameworks/compile/slang/slang_rs_context.cpp
41ebf534161bb67f6207a070c1f6a895dc853408 13-Oct-2010 Zonr Chang <zonr@google.com> Remove Slang::TargetDescription.

Clang and LLVM never read outside target description to configure the
target-dependent information needed during compilation and codegen. They
always use their own data layout string for specific, known target.
/frameworks/compile/slang/slang_rs_context.cpp
641558f02fe6ce0ee3ae5076eb366c25e2ad5903 12-Oct-2010 Zonr Chang <zonr@google.com> Implement one-definition-rule (ODR) feature.

When compiling multiple RS files, we say two RS files A and B break ODR
iff:

1. They have at least one common struct named [S] and [S] will be reflected
to ScriptField_[S].java, and
2. [S] defined in A is not *exactly the same* (number of fields, field
type and field name) as the one defined in B.

This CL detects such error.
/frameworks/compile/slang/slang_rs_context.cpp
c383a500aa59423264811be3874461bf8adbfea0 11-Oct-2010 Zonr Chang <zonr@google.com> Prepend legal announcement in all files.

Release libslang/llvm-rs-cc/llvm-rs-link under Apache 2.0 license.
/frameworks/compile/slang/slang_rs_context.cpp
b81c6a4cbd9c08e0b20ea4fbc615b416ac1bc9ec 10-Oct-2010 Shih-wei Liao <sliao@google.com> Revert "Revert "New implementation of llvm-rs-cc (replacement of slang_driver).""

This reverts commit a6d60672695f1438a63acdbf85eae7f97ce2b50d.
/frameworks/compile/slang/slang_rs_context.cpp
a6d60672695f1438a63acdbf85eae7f97ce2b50d 10-Oct-2010 Shih-wei Liao <sliao@google.com> Revert "New implementation of llvm-rs-cc (replacement of slang_driver)."

This reverts commit 6791df284557f4173a9715b3634f4f4901a6bb8a.
/frameworks/compile/slang/slang_rs_context.cpp
6791df284557f4173a9715b3634f4f4901a6bb8a 09-Oct-2010 Shih-wei Liao <sliao@google.com> New implementation of llvm-rs-cc (replacement of slang_driver).

Change-Id: I1b8b6cf3dad8ef8fe2f4d24d4df604099f45ff37
/frameworks/compile/slang/slang_rs_context.cpp
2df25dbc3b09764b7bed9f02aee7cbd3d9720ef2 08-Oct-2010 Stephen Hines <srhines@google.com> Export all non-static globals in RS.

Change-Id: Ie021b603085c901fbaf83cb231ce2999ce28c791
/frameworks/compile/slang/slang_rs_context.cpp
a41ce1d98094da84643995d40d71c529905123fc 05-Oct-2010 Zonr Chang <zonr@google.com> Fix memory leak of RSExport* object create in processExport(). Now, they will
properly be freed after their associated RSContext was destroyed.
/frameworks/compile/slang/slang_rs_context.cpp
6315f76e3cc6ff2d012d1183a0b030d4ff0dc808 05-Oct-2010 zonr <zonr@google.com> More coding style fixing to improve the readability. No actual semantics
changed. This also makes cpplint happy.
/frameworks/compile/slang/slang_rs_context.cpp
9ef2f785e0cc490af678dfd685995dec787321ff 01-Oct-2010 Shih-wei Liao <sliao@google.com> The Mother-of-All code review:
1. Fix AllowRSPrefix bug
2. Remove member mRS*Pragma in class RSContext
3. No longer only support 2x2, 3x3, 4x4 arrays
4. Fix Export All code for victorhsieh
5. Improve readability and maintainability
6. size_t -> int in calculating padding

Change-Id: I772aebd1440af66a89e2d2e688b193e500f38d69
/frameworks/compile/slang/slang_rs_context.cpp
cecd11d2af5d45d8ba322bed61fb48a99c305528 21-Sep-2010 Shih-wei Liao <sliao@google.com> Fix warnings. Bug fix.

Change-Id: I80934814ae64d11f0edebfa3b131164207f1aca0
/frameworks/compile/slang/slang_rs_context.cpp
f52a620440fa62257dfdcf2583f0f9df5b855c76 11-Sep-2010 Shih-wei Liao <sliao@google.com> Apply changes on slang such that it can work with LLVM/Clang upstream r112364/r112367.

Change-Id: If38da28502a6111b855105c2fceb23fdb0caefa4
/frameworks/compile/slang/slang_rs_context.cpp
3f8b44dba57685b437cecc208f2a20a4ed93ed36 04-Sep-2010 Ying Wang <wangying@google.com> Encode the bitcode binary files into Java source files.

So that the apps don't need to have the bc files as resources.
The bitcode java files will be put at the same dir as the reflected java files.
The bitcode java file name will be <ClassName>BitCode.java.
The bitcode is represented as byte array and you can reference it as:
byte[] bitcode = <ClassName>BitCode.getBitCode();

To enable this feature, pass "-s jc" to the command line.

The class name <ClassName> is converted from the .rs file name, for example:
foo.rs -> FooBitCode.java
foo_bar.rs -> FooBarBitCode.java
fooBar.rs -> FooBarBitCode.java
foobar.rs -> FoobarBitCode.java

i.e., any non-alnum characters in the rs file name are filtered
and the rest are converted to camel case.

The above method is also applied to the reflected java classes now.

Change-Id: Idf234d4c017e33740a13d6cd68bc3e14710ec149
/frameworks/compile/slang/slang_rs_context.cpp
28cf66d9a9f82dc4bd4708db905423d14e101ed6 29-Aug-2010 Shih-wei Liao <sliao@google.com> Check export pragma.

Change-Id: I467424b46fb63e4341165b04332c14850946e385
/frameworks/compile/slang/slang_rs_context.cpp
ac91815eb4918b9307ec876f34f2b60adf28c78b 29-Aug-2010 Shih-wei Liao <sliao@google.com> Check export pragmas in the rs file.

Change-Id: I6e934bfc166b85fffdd8d2897a823b651910d43f
/frameworks/compile/slang/slang_rs_context.cpp
c81dd70ab201ba13033004d36107ed96a6ad8036 20-Aug-2010 Shih-wei Liao <sliao@google.com> Memory errors: Fix mismatched free() / delete / delete [].

Change-Id: I6fcac252953a0c2bd48b3146b7e9f2d6861fc703
/frameworks/compile/slang/slang_rs_context.cpp
4c9f742efa36b1037acc640184681d421aa0f6ba 05-Aug-2010 Shih-wei Liao <sliao@google.com> Right usage of linking. Enable the reuse of the same Slang object across multiple input files.

Change-Id: Id036c300ece9a245437ea2bdd0a9c0da436f558d
/frameworks/compile/slang/slang_rs_context.cpp
f83d3c396d5d7eacd97cf0a5d3b6a01d75535b67 31-Jul-2010 Shih-wei Liao <sliao@google.com> Support multiple .rs files. Change "-o" to denote output path for .bc, NOT the output .bc file.

Change-Id: I168b3f96de37b0d6a787b3a83306ac84a0ebebb5
/frameworks/compile/slang/slang_rs_context.cpp
6de89272b00a31f2a73e2f56edf9cc511df46265 16-Jul-2010 Shih-wei Liao <sliao@google.com> Add --output-java-reflection-path | -p

Change-Id: I951a3540aa653060f81ff76b670ffb4b0029a3ca
/frameworks/compile/slang/slang_rs_context.cpp
e3756aa450b690cf5d18c0ea572ef7563de97bb3 12-Jul-2010 Victor Hsieh <victorhsieh@google.com> Usage Linkage for choosing vars/funcs which should be exported instead.

Change-Id: I7773bbfea721cc2c9423cf4e89e0d14c9539d14d
/frameworks/compile/slang/slang_rs_context.cpp
a50704238e06bc72a7ea3e8282fb5d350f88fd08 08-Jul-2010 Victor Hsieh <victorhsieh@google.com> Rename *ExportAllStatic* to *ExportAllNonStatic*.

Change-Id: I454a181e0081334e9e3dee99e80c2f875258d6ed
/frameworks/compile/slang/slang_rs_context.cpp
d8a0d186a362739f385f1a4af35360d5da69e47b 07-Jul-2010 Victor Hsieh <victorhsieh@google.com> Add pragma rs set_reflect_license

Change-Id: I9c3d9505c108a11b6c3fd85499fbac10da9f2532
/frameworks/compile/slang/slang_rs_context.cpp
c6718b312b793ea76ac6b61479090c33ba9f2ba6 23-Jun-2010 Victor Hsieh <victorhsieh@google.com> Add pragma rs export_var_all and export_func_all

Change-Id: Id9a90aeeb7cf74b3e9247cf8b998d5c5358ac73a
/frameworks/compile/slang/slang_rs_context.cpp
001fb6dddbf1cc794532eeb6a55f7b500eab1abc 21-Jun-2010 Shih-wei Liao <sliao@google.com> 1. Add comments to clarify (E.g., don't worry. "syntax error will be triggered by predecessor later")
2. Create ASTContext before RSContext creation and pass it to RSContext for using later

Change-Id: I6c11af70f1a13036c560aa34d311808548390864
/frameworks/compile/slang/slang_rs_context.cpp
537446c9542fdda458920876ed8a020a97ddf7a4 12-Jun-2010 Shih-wei Liao <sliao@google.com> Add support to #pragma rs java_package_name.

Change-Id: Ieb3582511238e1a13056221dfd6e6b3c1f87fe6a
/frameworks/compile/slang/slang_rs_context.cpp
462aefd62cc646d2ff753c1d003ef3cd7bbea262 05-Jun-2010 Shih-wei Liao <sliao@google.com> Initialize slang and Android.mk.

Change-Id: If74da8e54d45511c8c9bb236bcfeec508f4f2439
/frameworks/compile/slang/slang_rs_context.cpp