History log of /frameworks/compile/slang/slang.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8264cf563991c882868af0aa162c32922285b2cd 12-Nov-2014 Stephen Hines <srhines@google.com> Clear up some object lifetime issues for ASTContext and Preprocessor.

Bug: 18343568

llvm-rs-cc was accidentally freeing memory that was still in use. The
ASTContext and Preprocessor contain several strings and other pieces
of data that are used during the generation of our reflected code.

(cherry picked from commit c546630bbcc631bc963609c2288d4d9a18753e8d)

Change-Id: I900faa3beb6b1e21524708ca2a23468da1de6011
2d504fd03c66be56ac3b4bb62c78cc72c75dd8b6 15-Aug-2014 Stephen Hines <srhines@google.com> Suppress warnings on our second compilation (for 64-bit).

Bug: 16031597
Bug: 17052573

Without this patch the 64-bit compilation path will print duplicate warning
diagnostics, since we call the frontend twice (for 32-bit, and then 64-bit).
The simplest fix is to not print warnings for the second compilation. A bug
(17052573) has been filed to track fixing this a better way (actually printing
out all warning diagnostics, but removing duplicates explicitly).

Change-Id: I78ac0ebd2b132713ec0c86c2cf234da2b620eecf
7ac9d0de26d325071ad3f26f8d34514efca2d3d6 16-Jul-2014 Stephen Hines <srhines@google.com> Update slang for LLVM rebase to r212749.

Change-Id: I5819f9df3212ffcfa8f34c11d3cea29f1fd04878
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
0e4ee65a2ba6b32fcd16c5d4a57fc7542d4032b4 10-Jun-2014 Stephen Hines <srhines@google.com> Run InitializePreprocessor() to ensure that all macros are set up properly.

Without this, we don't end up defining things like __LP64__ for 64-bit
compilation targets.

Change-Id: I11e11bde3498089056e7a70903c8d47d1030e01a
75d471819f1810e0e65224d6e57fe1106af0d340 28-May-2014 Stephen Hines <srhines@google.com> Update slang for LLVM 3.5 rebase (r209713).

Change-Id: If0f510085358d2e48c865257851d9ff7f5846eb8
ee4016d1247d3fbe50822de279d3da273d8aef4c 11-Apr-2014 Tim Murray <timmurray@google.com> Update Slang for Clang/LLVM 3.5a.

Change-Id: Icd59efa1197098076555c505c31939866e504a83
eeb251e8db802b836af7461d0f6eb1252c527ab8 11-Feb-2014 Stephen Hines <srhines@google.com> Update slang for LLVM 3.4 rebase.

Remove LinkOnceODRAutoHideLinkage, since it is now just a special case of

Remove CaseRange expansion code from all bitcode writers, since it is now dead.

Fix up HeaderSearch constructor.

Change-Id: I38547486be509b16ea5d8218b43c31ae35b37d3b
a1f95ee8df425089100148a42954cf61dc285015 09-Aug-2013 Stephen Hines <srhines@google.com> Update slang for LLVM merge up to r187914.

Move OptParser.td dependency to use LLVM's version.
Switch to llvm::sys::fs::F_* enums.
Switch to LLVM Option handling library (not in Clang any more).
Add new ALIASARGS field to OPTION macro.
Switch to clang::getLastArgIntValue() helper function.
Use llvm::sys::fs::OpenFlags as enum and not unsigned int.
Remove unused DisableSimplifyLibCalls().
Switch to llvm::sys::fs::create_directories().

Change-Id: I9b12e18b759536c762ea0dd43356907ee53dbddb
f64e76657a98f66c0f3f26014c0a51f55204dc1c 14-May-2013 Stephen Hines <srhines@google.com> Turn off "lax vector conversions".

Bug: 7342914

This language option catches all the terrible implicit vector casts (but not
the explicit vector casts) that we are trying to forbid.

Change-Id: I7cd75326fc72e0c7c74b635c81d7263a257330dd
4b3f3bada7155de983e7d92fa8b20091629b3bb3 07-May-2013 Stephen Hines <srhines@google.com> Adapt llvm-rs-cc for LLVM/Clang update.

Change-Id: Ic38ebc1d824f6d3ae26c6b354336a01b52d46136
0da7f6c8201b27938d3b9f048d71fd784cd1df9a 06-Mar-2013 Stephen Hines <srhines@google.com> Updates for LLVM merge to r176139.

Change-Id: I0d0d32893b4638eef298c99ac8c862c9a9bca1a6
23c4358f12bd9d0ba7166eceebd683db95a41b3f 10-Jan-2013 Stephen Hines <srhines@google.com> Updates for LLVM merge to r171906 on 20130108.

Change-Id: I4cf3718041d8876d4a23a412b6b4fa4226ec3b50
43730fe3c839af391efe6bdf56b0479860121924 03-Aug-2012 Shih-wei Liao <sliao@google.com> Apply changes to migrate to CLANG-160673-20120724.

Change-Id: I666df2ff91532318883dd48ea1249178b2ebda81
52d132c53a57c3bb4b517f87ec4f0148ef8a4216 02-Aug-2012 Stephen Hines <srhines@google.com> Set LangOpts.Renderscript = 1.

Change-Id: I7f80d124d11eeed776ce3acd520297fc0c3f08f6
0444de0c0e7cfc8d8f8fed6f64cd97812bdd6a41 03-Mar-2012 Stephen Hines <srhines@google.com> Adapt to upstream Clang/LLVM changes.

Change-Id: Ib81ad97246dbee060341e2690fb7f27e9e0298f4
e3cb21bc8654181da174ac441acec7726b5a78ec 02-Mar-2012 Jean-Baptiste Queru <jbq@google.com> am fa5209a2: am 9c459f0c: Merge "Enable emission of debugger-friendly bitcode"

* commit 'fa5209a2bd1e10f675a889c60d8d5a589e860d18':
Enable emission of debugger-friendly bitcode
c460b37ffb50819a32c2a8967754b6f784b28263 09-Jan-2012 mkopec1 <mkopec1@intel.com> Enable emission of debugger-friendly bitcode

- Add "-g" flag to llvm-rs-cc in order to emit debug metadata
- Add optimization level parameter -O and tests
- Add lit based tests (use llvm-lit from libbcc/tests/debuginfo)
-- Add README file for lit-tests directory

Change-Id: I5e2f6f9b6f536fa7a10de008b54ac0878cf352a9
194d4039a37861368d0774682b6d104f10bcc262 28-Feb-2012 Stephen Hines <srhines@google.com> Force LangOpts.CharIsSigned=1 (although it is currently the default).


Change-Id: Ie3bbcd7f0536c432531c88ad5dff5b76bd2a8ab6
e67239de8d94975e7e2216ee6860ae2e6cb8b15a 25-Feb-2012 Stephen Hines <srhines@google.com> Style violation cleanup.

Change-Id: Idb127f2fd6e637039454f47299360aec5a4edfe8
ac4e18584b8768b3f68535fa5f16232e03974323 16-Dec-2011 Logan Chien <loganchien@google.com> Apply changes to migrate to upstream (Dec 16th 2011)

- clang::ModuleLoader has changed the interface of loadModule.

- Following constants has been removed from llvm::bitc by the
upstream, so we have to define our version.


- llvm::TargetMachine::createTargetMachine now takes a new
parameter for options, such as float ABI, soft float, and
no frame elimination, and etc.

Change-Id: I75e51da9d2265207060a449735342b426cedf243
8f4d972ef6c6796ffdde603e456979a7004d1e20 05-Dec-2011 Stephen Hines <srhines@google.com> Add support for warning flag processing.


Change-Id: I96567325df605c5eb0f0bf2f2371a1cea9718a5b
4c622e0953afe3dca4da0aee364a811f3ccb61d9 11-Nov-2011 Stephen Hines <srhines@google.com> Adapt to upstream changes.

Change-Id: I9ab7bad890eb78621c5fc6dd516dbcacdad88471
9207a2e495c8363606861e4f034504ec5c153dab 21-Oct-2011 Logan Chien <loganchien@google.com> Apply changes to migrate to LLVM upstream Oct 20th 2011.

- StructType::isAnonymous is renamed to StructType::isLiteral.

- PassManagerBuilder has been moved from
llvm/Support/PassManagerBuilder.h to

- Include llvm/Transforms/IPO.h for llvm::createInternalizePass.

- clang::DiagClient has be renamed to clang::DiagnosticConsumer.
Besides, we have to implement one additional pure virtual method
'clone' for create a clone of slang::DiagnosticBuffer.

- llvm::Linker::LinkModules comes with one additional parameter.
Passing llvm::Linker::DestroySource should be equivalent to
the old code we were using.

- slang::Slang is now derived from clang::ModuleLoader and implemented
loadModule pure virtual method (though we will always return NULL.)

- clang::Preprocessor is taking one additional parameter for

- clang::Diagnostic has been changed. A lot of the method has been
moved to clang::DiagnosticsEngine, and we can no longer 'Report' a
diagnostic from clang::Diagnostic. We have to use
clang::DiagnosticEngine instead.

- llvm::setCodeModel has been removed.

Change-Id: I1f2a4cbeaf61a8ed1d0d635a5a0e1baa90d99d07
c632be206ac4fe49a5db05cfa54942d774329dbe 24-Sep-2011 Stephen Hines <srhines@google.com> Generate warnings properly for multi-file compiles.


Slang (llvm-rs-cc) was clobbering warnings during multi-file compilation
because they are not part of the error count. When the diagnostics get reset,
we should be dumping whichever non-error (i.e. warning) diagnostics we have
accumulated. During investigation, I also found then that our dependency
generation path can cause duplicate warnings to be added to the diagnostic
client. Thus, to fix this bug, the change need dumps relevant diagnostics, but
then suppresses warnings if we are compiling the same file multiple times
(once for code generation and once for dependencies).

Change-Id: I4b94e962f93b96f31ff7e7d6cce45418fe39e1d1
fcc654a1f4034978f7534479f9c5c33a92ca8546 22-Jun-2011 Shih-wei Liao <sliao@google.com> Fix llvm API changes to migrate to upstream r131807.

Now, llvm doesn't provide create*Passes() interface and removes StandardPasses.h.
Instead, we use PassManagerBuilder to replace StandardPasses.

Change-Id: I0979afd0ecb9bf2df6634aaff0a8c9a32d405f71
6f4e0a9955a53a6f715af7e674e68ed15270a47c 09-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Migrate to newer API.

Following function (left) is deprecated, use the right version

llvm::sys::Path::getLast -> llvm::sys::path::filename
llvm::sys::Path::getBasename -> llvm::sys::path::stem
llvm::sys::Path::getDirname -> llvm::sys::path::parent_path
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 ->

- 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

- Add const qualifier for several unsafe type cast.
df5bcce1582d839eead432a5e24435236c90fb05 01-Mar-2011 Shih-wei Liao <sliao@google.com> NOTICE file and logn:
Apply changes to migrate to LLVM 2010 Nov 10th:

Change-Id: Ib8d3675b4701957f299f249ac72e8a43c2a6bc4c
6e6578a360497f78a181e63d7783422a9c9bfb15 08-Feb-2011 Stephen Hines <srhines@google.com> Add support for assertions in llvm-rs-cc.

Bug: 3430674
Change-Id: I3400238652449cde84275cc2a770f405332d9544
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
245eba133628ef5b52c78d6f538c9268c9bc5828 19-Jan-2011 Shih-wei Liao <sliao@google.com> Enforce C99 checking.

Change-Id: Id5c2afa01fdf88170d7fafcb7d321aa127d02e27
3fd0a94a5cf1656569b1aea07043cc63939dcb46 18-Jan-2011 Stephen Hines <srhines@google.com> Refactor pragma handling (pass everything to LLVM)

Change-Id: Id09d4934af06f0880cd867456218602ce9a9e2de
e639eb5caa2c386b4a60659a4929e8a6141a2cbe 09-Nov-2010 Stephen Hines <srhines@google.com> Improve code style.

Change-Id: I26e043849bce2a4b41ae132fbe0c882f4a6f112f
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.
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

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.
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.
e8c263a1c5df81594cf302ecadd813909c894487 11-Oct-2010 Zonr Chang <zonr@google.com> Refactor a bit & -M bug fixed.

1. Use llvm::tool_output_file instead of llvm::raw_stream. The former
can automatically deleted itself from filesystem once the compilation failed.
2. Fix -M bug which causes segfault previously.
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.
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.
6791df284557f4173a9715b3634f4f4901a6bb8a 09-Oct-2010 Shih-wei Liao <sliao@google.com> New implementation of llvm-rs-cc (replacement of slang_driver).

Change-Id: I1b8b6cf3dad8ef8fe2f4d24d4df604099f45ff37
b257301a1c711ba81458a4f8bf3c99c91c91a047 07-Oct-2010 Zonr Chang <zonr@google.com> Don't include rs_graphics.rsh by default.
Fix the Externalize in slang_driver.cpp.

Change-Id: Idce037b0150af3ea9968e39b7bce63a0e1b6d9a5
08df36e5c0a990306d958c9f6d59a5de23b748f6 07-Oct-2010 Zonr Chang <zonr@google.com> Factor out shared library libslang.so from slang.

libslang.so can be regarded as a lightweight Clang compiler. Only C-like
language compilation is supported in libslang.so currently. Both llvm-rs-link
and slang now link to this library.

Change-Id: Ib8f8dc8568640bc36c2b1fe8dba1212c4c8a56c8
8c6d9b2d36ed2d6d811279fd9bddc05fffe16803 07-Oct-2010 Zonr Chang <zonr@google.com> Use llvm::sys::Path to implement "mkdir -p".

Change-Id: I3bb36e1a8050bbd9744fd02935b6186d2f285015
5457231d5201be02c3232ffc1c6d8bc408f276ab 08-Oct-2010 Ying Wang <wangying@google.com> Pass additional dep target to slang

By "slang -a out/foo/bar/RenderScript.stamp ...", additional dep target will be added to the .d file,
something like:
out/target/common/obj/APPS/Fountain_intermediates/src/RenderScript.stamp ./fountain.bc: \
frameworks/base/libs/rs/java/Fountain/src/com/android/fountain/fountain.rs \

Currently the .bc file is not used in the build system dependency graph, but the stamp file.

Change-Id: I1251dba0a4b003e4b6bc689f1064bddd4ffbccc1
0b7ef1a176b9ddd1e0d437efdce20743373fd7db 08-Oct-2010 Stephen Hines <srhines@google.com> Add support to Slang for "-MD" option.

Change-Id: Ie01ccb3f07191f6de954b8094eec5ab47e703817
f7de85223c8728d5dc147e8a19ddf039da72b431 06-Oct-2010 Stephen Hines <srhines@google.com> Fix a minor error checking bug.

Change-Id: I26c809d361071eba06efb734ea2b54c4dc560981
cc0efad052e944f64bb71cfdaa8a825e30192e78 05-Oct-2010 Stephen Hines <srhines@google.com> Add "-M" dependency generation to Slang.

Change-Id: I26d1daf1005de7b3ad297fba5ad0d85a1aab1e45
3a9ca1f0d6bd8f12c2bb2adea51f95c255996180 06-Oct-2010 Zonr Chang <zonr@google.com> Provide better abstraction of class Slang.

1. Remove the Slang C APIs support (not used by any other programs.)
2. All RS relatives are now in slang_rs_*.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.
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
1ebc0ca6ffa7effb875883d18205ed4943ab8fc2 14-Sep-2010 Shih-wei Liao <sliao@google.com> Implement the ARM-specific struct layout ABI in exportable functions parameters for rs. Add the ABI-compliant #args when needed.
My old code inadvertently assumed x86 ABIs for structs, but ARM ABI/calling convention is tricky here, compared to x86's. Also, fixed the type promotion problem.
Note that the most portable fix is to add a shim layer in Clang which is a BIG undertaking like PNaCl. Let's put in the potential fix for b/2988615 now.

Change-Id: I1d9fe4d803485b55bb72112ea8e17c1f4a19dd32
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
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
e2e522f0d23c074ecd1025f1f2ed161ed485d9c8 01-Sep-2010 Ying Wang <wangying@google.com> Customized header search paths

1. Use "-I <path>" (or "--include-path <path>") to add a header search path.
2. You can specify more than 1 search path and the preceding path takes precedence.
3. System include path is moved out of the code -- they are inserted in the build system instead.

Change-Id: Idfaee4763e8bf0cd71deeecdf1dc1ec515e44d0f
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
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
60de5bd34649e3a0acfdbc881a07b16781fd2661 21-Jul-2010 Shih-wei Liao <sliao@google.com> Change the Preprocessor to automatically include rs_types.rsh and rs_math.rsh. They are part of the standard RenderScript APIs.

Change-Id: Ib79d624bec877869f420f7f4c2bc294b139db597
9089828a995422a5ed3beeed0890b755c4abe188 20-Jul-2010 Shih-wei Liao <sliao@google.com> Add curr directory to include path.

Change-Id: I67eba0fd18a703d9349d58446fbafbcd32a08dfb
8eac0940b8d13f8c4bad50942bf8527d64ccd12c 19-Jul-2010 Shih-wei Liao <sliao@google.com> Add frameworks/base/libs/rs/scriptc to system include path.

Change-Id: I5b28bdefb7ddc99b9861dc49bd088c813806f0f4
66819a96bda9362f86e4f26ed8a9b1f73961b27a 19-Jul-2010 Shih-wei Liao <sliao@google.com> Clean up printing.

Change-Id: I0c335d1e8203fe412466b0e2b83ceda0ea33b56b
68e8e9f98730b3672fb96d49e33b9db70a90ed3f 19-Jul-2010 Shih-wei Liao <sliao@google.com> Add include path and deal with the case that "-p" flag on path is unspecified.

Change-Id: I592b23ac1e08b62088a9a9e1bfc8109b56929386
807a0eaf3c19dc067becdca46a10e8c703d1e871 17-Jul-2010 Che-Liang Chiou <clchiou@google.com> Handle corner case if file path is too long.

Change-Id: Idf6cd3530d45d21ae40d8d27265368619e70155f
b55d7ef3333534fc6aad80f9a9133f2bf945faf1 16-Jul-2010 Shih-wei Liao <sliao@google.com> Change "-o" to create parent directories if it's needed.

Change-Id: I98de7f29d338c5849f5fcd7fb598c00150140d5a
6de89272b00a31f2a73e2f56edf9cc511df46265 16-Jul-2010 Shih-wei Liao <sliao@google.com> Add --output-java-reflection-path | -p

Change-Id: I951a3540aa653060f81ff76b670ffb4b0029a3ca
1fd8579fe65b13a26cfaad12d056d2fc9b46475a 07-Jul-2010 Kirk Stewart <kstewart@google.com> Add a command-line option to allow function names with the "rs" prefix (--allow-rs-prefix). When not specified, user-defined functions with that prefix will be treated as an error.

Change-Id: Ieefc8bb55d61980241d5392ffb32770a303ce6a7
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
462aefd62cc646d2ff753c1d003ef3cd7bbea262 05-Jun-2010 Shih-wei Liao <sliao@google.com> Initialize slang and Android.mk.

Change-Id: If74da8e54d45511c8c9bb236bcfeec508f4f2439