Commit Graph

766 Commits

Author SHA1 Message Date
Achim D. Brucker c285cc72d2 Moved resource declaration into try-statement. 2018-10-21 20:20:13 +01:00
Achim D. Brucker d53814e154 Restored error level for org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable. 2018-10-21 18:29:40 +01:00
Achim D. Brucker 3d5dec0b0c Manual merge. 2018-10-21 16:31:25 +01:00
Julian Dolby 533d392bda support for method argument default values 2018-10-17 19:44:44 -04:00
Julian Dolby 948d69cbb8 fix for Soot: trim instruction array to avoid nulls 2018-10-16 21:43:26 -04:00
Julian Dolby d690d94cdd more use for object literals 2018-10-16 00:34:31 -04:00
Julian Dolby b2503628a4 1) a bit more source mappimg information
2) fixes to how Contexts are combined
2018-10-13 08:42:08 -04:00
Erik Derr ee13713c4d Impl of IMethod.is(Wala)Synthetic and IClass.isSynthetic (#359)
* Impl of IMethod isSynthetic and isWalaSynthetic

So far IMethod.isSynthetic referred to WALA-generated helper functions
and there was no equivalent to check whether an IMethod is synthetic in
terms of compiler-generated.

To make naming consistent this patch first renames the isSynthetic to
isWalaSynthetic to clearly indicate that a given IMethod was generated
by WALA. Then, we re-introduce isSynthetic that from now on checks
whether an IMethod is synthetic/compiler-generated (referring to the
synthetic flag in bytecode)

* Implementation of IClass.isSynthetic

Complementary to IMethod.isSynthetic, this method checks whether
an IClass is compiler-generated.

* updated JavaDoc
2018-10-02 22:28:21 -07:00
Sifis Lagouvardos be0ef4e16b Added CAstOperator to support the not in operation in Python. 2018-09-12 18:25:21 +03:00
Sifis Lagouvardos 9ce10ab5b9 Added GLOBAL_DECL CAstNode for the python global statement. 2018-09-12 18:21:00 +03:00
Julian Dolby 762389c315
Merge pull request #344 from bryantam/cast_constant-h-add-changes
add missing CAstNodeType to cast_constant.h that are defined in CAstNode
2018-08-26 22:35:58 -04:00
Bryan Tam 6f317bc9fa add missing CAstNodeType to cast_constant.h that are defined in CAstNode 2018-08-23 21:16:24 -04:00
Manu Sridharan 49628fdf44 Start new development version 2018-08-22 12:01:19 -07:00
Manu Sridharan 6b46ce4faa Version 1.5.0 2018-08-22 11:19:51 -07:00
Julian Dolby 0ad11fefc3 work on Wala with Yannis' group 2018-07-22 16:19:32 -04:00
Leo Li d15f49bd90 Add install_name when build libcast on macos. (#332)
Gradle won't pass absolute path when build libcast. We need to set install_name manually otherwise `dyld` would not able to find libcast at runtime.

This is only needed on macos since `ld` will look up all runtime search path automatically.
2018-07-22 02:42:19 +02:00
Julian Dolby dc47e1da98 add default methods to instruction visitors
relax dump api
2018-07-10 21:53:48 -04:00
Julian Dolby 37eea27f4a more support for out-of-order lexical declarations 2018-06-22 19:49:49 -04:00
Julian Dolby 4de0ed876d remove overly conservative assertion 2018-06-22 07:26:38 -04:00
Julian Dolby b1b09684bd
Merge pull request #317 from liblit/future-java-compatibility-fixes
Future Java compatibility fixes
2018-06-06 12:52:51 -04:00
Ben Liblit 5336a08af2 Avoid using deprecated boxing constructors
Boxing a primitive using the constructor ("new Integer(4)") always
creates a distinct new boxed instance.  That's rarely what you need,
and in fact all of those constructors have been deprecated in Java 9.
Using the static "valueOf" method instead ("Integer.valueOf(4)") can
give better performance by reusing existing instances.  You no longer
get a unique boxed object, but generally that's OK.
2018-06-05 14:44:59 -05:00
Julian Dolby 9aed4e058d more tracking of sourse positions for function parameters 2018-06-05 15:00:31 -04:00
Ben Liblit fbac524a02 Find JVM shared library better across versions and operating systems
We now use "-rpath" on both Linux and macOS.  This linker flag sets
the ELF RPATH on Linux, and the "@rpath" attribute on macOS, but
effectively it's doing the same thing, and that same thing is exactly
what we want.  I think.

On Linux, we also now look for the JVM shared library in three
different places.  The library has moved between Java 8 and 9, and
even on Java 9 it goes in a different place on Fedora 28 versus Ubuntu
16.04.
2018-06-04 12:28:42 -05:00
Ben Liblit 2067d6c37a Open up some more vertical white space 2018-06-04 12:28:42 -05:00
Julian Dolby d2852beebf
Merge pull request #312 from liblit/gradle-load-plugins-modernization
Load Gradle plugins using “plugins” closure rather than “apply plugin”
2018-06-04 12:22:33 -04:00
Julian Dolby 400b2055ce break basic blocks at eachelementget instructions 2018-05-30 12:26:19 -04:00
Ben Liblit e2ce6a84b0 Load plugins using "plugins" closure rather than "apply plugin"
Apparently the latter is considered a "legacy method":
<https://docs.gradle.org/current/userguide/plugins.html#sec:old_plugin_application>.
2018-05-23 16:47:58 -05:00
Julian Dolby 5236b95bd2 tighten type 2018-05-11 12:30:32 -04:00
Julian Dolby a3a6ce3f51 expose copy propagation records to allow better source position mapping even when copy propagation has occurred. 2018-05-09 18:10:20 -04:00
Julian Dolby 6b2db3e190 more-detailed source mapping information 2018-05-08 08:01:35 -04:00
Julian Dolby 8005b665b9 flexibility in how to model constants 2018-04-30 19:09:59 -04:00
Julian Dolby 2a7a98ed32 move code for sharing between javascript and python 2018-04-30 13:33:48 -04:00
Julian Dolby 27a8fff714 ast-based constant folding 2018-04-28 12:05:49 +02:00
Ben Liblit 209086f068 Bump version to 1.5.0-SNAPSHOT before merging with WALA master
This gives the WALA maintainers the option of doing future 1.4.5+
releases from of a pre-Gradle branch if these merged Gradle changes
turn out to be more disruptive than expected.
2018-04-18 11:29:29 -05:00
Ben Liblit 7cbccb33fb Simplify how we refer to the outputs of certain tasks 2018-04-18 11:29:29 -05:00
Ben Liblit 4dc1e41529 Tell Eclipse to ignore some questionable manifest contents
These manifest files are here for use by the Maven build, but Eclipse
is now using Gradle (via Buildship).  So the manifests as seen by
Eclipse do not entirely make sense.  I'm hesitant to change the
manifests directly, since presumably they were correct for Maven and
still are.

Perhaps some day we'll be using Gradle to generate manifests.  Until
that day comes, we're better off leaving the manifests as they are and
just suppressing Eclipse's warnings instead.
2018-04-18 11:29:29 -05:00
Ben Liblit 72e5eb2b8d Restore old manifests in hope of fixing Maven regressions 2018-04-18 11:29:29 -05:00
Ben Liblit 3961b3a20e Incremental improvements to Windows JDK library configuration
This still doesn't actually work, but it's closer than it was before.
There's still some problem with improper mixing of 32-bit ("x86") and
64-bit ("x64") libraries.
2018-04-18 11:29:29 -05:00
Ben Liblit 298d6654d6 Clean up questionable memory management during string construction
Avoid allocating memory using strdup() and then releasing it using
operator delete.  strdup()-allocated memory should be released using
free(), not delete.  But in these specific cases, there really was
never any good reason to duplicate the C-style strings in the first
place.  Instead, we can safely pass those NUL-terminated char pointers
directly in calls to JNI's NewStringUTF().  NewStringUTF() does not
take ownership of its argument, but rather clones that string data
internally before returning.  So using strdup() and delete was just
unnecessary memory churn.

In cases where we need to format, concatenate, or construct new
strings, don't use sprintf() into variable-sized, stack-allocated
arrays.  Variable-sized arrays are not portable, and in particular are
rejected by Microsoft's Visual Studio 2017 C++ compiler.  Instead, do
our string formatting and manipulations using std::ostringstream
and/or std::string.  We just need to be a bit careful about the
lifetimes and ownership responsibilities of allocated data.  In
brief, (1) ostringstream::str() returns a temporary string instance
that expires at the end of the enclosing statement, independent of the
lifetime of the ostringstream instance; while (2) string::c_str()
returns an pointer to internal data that remains valid as long as the
string on which it was called is valid and unmodified.
2018-04-18 11:29:29 -05:00
Ben Liblit 216981f7e3 Somebody decided to use three-space indentation in this file only
OK, whatever makes you happy.
2018-04-18 11:29:29 -05:00
Ben Liblit 86fe6e9334 Fill in likely (but untested) JVM library path on Windows 2018-04-18 11:29:29 -05:00
Ben Liblit 48ffce525c Fix remaining Javadoc warnings
This fixes the last of our Javadoc warnings without creating a
circular dependency between ":com.ibm.wala.cast:javadoc" and
":com.ibm.wala.cast.js:javadoc".  Fixes #4, wherein more details about
this tricky dependency challenge can be found.
2018-04-18 11:29:28 -05:00
Ben Liblit 61d8ee1b02 Fix various warnings produced by "./gradlew javadoc"
Three stubborn warnings remain, but this is progress!
2018-04-18 11:29:27 -05:00
Ben Liblit da90d1cf5a Trigger custom clean tasks whenever running "./gradlew clean"
A cleaned tree is now much closer to a pristine tree that has just
been checked out and never built.  The only extra created files that
are left behind are ".gradle", "buildSrc/.gradle", and
"buildSrc/build".
2018-04-18 11:29:27 -05:00
Ben Liblit 817166c128 Compute a library path from the native software model
Previously we were repeating the library path twice, but that's not
good for long-term maintenance.  That being said, extracting this
information from the depths of the native software model seems *far*
more complex than it should be.  I had hoped for something nicer in
response to
<https://discuss.gradle.org/t/compute-wl-rpath-flag-suitable-for-native-shared-library/25278>,
but so far there's nothing.
2018-04-18 11:29:27 -05:00
Ben Liblit a98b913373 Avoid random leftover junk by using "Sync" instead of "Copy" 2018-04-18 11:29:27 -05:00
Ben Liblit 98324cd148 Simplify how we refer to existing tasks 2018-04-18 11:29:26 -05:00
Ben Liblit 01acd0e338 RPath settings apply only to Linux; some only to Linux on x86_64
I don't know whether Windows or MacOS needs anything similar.  If they
do, the details will differ, and should be handled by adding suitable
cases to these switch statements.
2018-04-18 11:29:26 -05:00
Ben Liblit 35663c1264 Teach Gradle how to find and copy a Jar archive that we bundle
I'm not actually sure why this archive is needed, except that it is
mentioned in "META-INF/MANIFEST.MF" and "build.properties".  If we
eventually stop supporting Maven, then we may be able to discard the
"copyJarsIntoLib" task and the corresponding lines in
"META-INF/MANIFEST.MF" and "build.properties"
2018-04-18 11:29:25 -05:00
Ben Liblit 3380b78f38 This is no longer how we'll build the native library in Eclipse 2018-04-18 11:29:25 -05:00