Update gcmole to a more recent clang/llvm.

* Changes for 2.9:
     * Use CXX in Makefile instead of hardwired g++, we need a more
       modern GCC than 4.6 later, anyway.

* Changes for 3.0:
     * Use llvm namespace.
     * Diagnostic => DiagnosticsEngine.

* Changes for 3.1:
     * The BlockDeclRefExpr AST node is gone.
     * The structure of the CXXNewExpr AST node has changed.
     * Path changed from Release to Release+Asserts.
     * Use clang++ instead of -cc1, otherwise we lose the system include
       paths.

* Changes for 3.2:
     none needed

* Changes for 3.3:
     * Use lookup_iterator::begin/end instead of first/second.

* Changes for 3.4:
     * createItaniumMangleContext => ItaniumMangleContext::create.

* Changes for 3.5:
     * clang uses <type_traits> now, so -std=c++0x is needed.
     * Type-trait-related AST changes.
     * getCustomDiagID signature changed.
     * We must link the C++ library statically now.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/445983002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22972 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 604eaa0d
...@@ -64,6 +64,7 @@ shell_g ...@@ -64,6 +64,7 @@ shell_g
/testing/gmock /testing/gmock
/testing/gtest /testing/gtest
/third_party/icu /third_party/icu
/third_party/llvm
/tools/jsfunfuzz /tools/jsfunfuzz
/tools/jsfunfuzz.zip /tools/jsfunfuzz.zip
/tools/oom_dump/oom_dump /tools/oom_dump/oom_dump
......
...@@ -31,13 +31,12 @@ LLVM_INCLUDE:=$(LLVM_SRC_ROOT)/include ...@@ -31,13 +31,12 @@ LLVM_INCLUDE:=$(LLVM_SRC_ROOT)/include
CLANG_INCLUDE:=$(LLVM_SRC_ROOT)/tools/clang/include CLANG_INCLUDE:=$(LLVM_SRC_ROOT)/tools/clang/include
libgcmole.so: gcmole.cc libgcmole.so: gcmole.cc
g++ -I$(LLVM_INCLUDE) -I$(CLANG_INCLUDE) -I. -D_DEBUG -D_GNU_SOURCE \ $(CXX) -I$(LLVM_INCLUDE) -I$(CLANG_INCLUDE) -I. -D_DEBUG \
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 \ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS \
-fomit-frame-pointer -fno-exceptions -fno-rtti -fPIC \ -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -fno-exceptions \
-Woverloaded-virtual -Wcast-qual -fno-strict-aliasing \ -fno-rtti -fPIC -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing \
-pedantic -Wno-long-long -Wall \ -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter \
-W -Wno-unused-parameter -Wwrite-strings \ -Wwrite-strings -std=c++0x -shared -o libgcmole.so gcmole.cc
-shared -o libgcmole.so gcmole.cc
clean: clean:
rm -f libgcmole.so $(RM) libgcmole.so
...@@ -27,9 +27,12 @@ ...@@ -27,9 +27,12 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# This script will build libgcmole.so. # This script will build libgcmole.so. Building a recent clang needs a
# recent GCC, so if you explicitly want to use GCC 4.8, use:
#
# CC=gcc-4.8 CPP=cpp-4.8 CXX=g++-4.8 CXXFLAGS=-static-libstdc++ CXXCPP=cpp-4.8 ./bootstrap.sh
CLANG_RELEASE=2.9 CLANG_RELEASE=3.5
THIS_DIR="$(dirname "${0}")" THIS_DIR="$(dirname "${0}")"
LLVM_DIR="${THIS_DIR}/../../third_party/llvm" LLVM_DIR="${THIS_DIR}/../../third_party/llvm"
...@@ -110,7 +113,7 @@ if [ "${OS}" = "Darwin" ]; then ...@@ -110,7 +113,7 @@ if [ "${OS}" = "Darwin" ]; then
# See http://crbug.com/256342 # See http://crbug.com/256342
STRIP_FLAGS=-x STRIP_FLAGS=-x
fi fi
strip ${STRIP_FLAGS} Release/bin/clang strip ${STRIP_FLAGS} Release+Asserts/bin/clang
cd - cd -
# Build libgcmole.so # Build libgcmole.so
...@@ -122,5 +125,5 @@ set +x ...@@ -122,5 +125,5 @@ set +x
echo echo
echo You can now run gcmole using this command: echo You can now run gcmole using this command:
echo echo
echo CLANG_BIN=\"third_party/llvm/Release/bin\" lua tools/gcmole/gcmole.lua echo CLANG_BIN=\"third_party/llvm/Release+Asserts/bin\" lua tools/gcmole/gcmole.lua
echo echo
This diff is collapsed.
...@@ -93,14 +93,16 @@ end ...@@ -93,14 +93,16 @@ end
local function MakeClangCommandLine(plugin, plugin_args, triple, arch_define) local function MakeClangCommandLine(plugin, plugin_args, triple, arch_define)
if plugin_args then if plugin_args then
for i = 1, #plugin_args do for i = 1, #plugin_args do
plugin_args[i] = "-plugin-arg-" .. plugin .. " " .. plugin_args[i] plugin_args[i] = "-Xclang -plugin-arg-" .. plugin
.. " -Xclang " .. plugin_args[i]
end end
plugin_args = " " .. table.concat(plugin_args, " ") plugin_args = " " .. table.concat(plugin_args, " ")
end end
return CLANG_BIN .. "/clang -cc1 -load " .. CLANG_PLUGINS .. "/libgcmole.so" return CLANG_BIN .. "/clang++ -c "
.. " -plugin " .. plugin .. " -Xclang -load -Xclang " .. CLANG_PLUGINS .. "/libgcmole.so"
.. " -Xclang -plugin -Xclang " .. plugin
.. (plugin_args or "") .. (plugin_args or "")
.. " -triple " .. triple .. " -Xclang -triple -Xclang " .. triple
.. " -D" .. arch_define .. " -D" .. arch_define
.. " -DENABLE_DEBUGGER_SUPPORT" .. " -DENABLE_DEBUGGER_SUPPORT"
.. " -DV8_I18N_SUPPORT" .. " -DV8_I18N_SUPPORT"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment