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
/testing/gmock
/testing/gtest
/third_party/icu
/third_party/llvm
/tools/jsfunfuzz
/tools/jsfunfuzz.zip
/tools/oom_dump/oom_dump
......
......@@ -31,13 +31,12 @@ LLVM_INCLUDE:=$(LLVM_SRC_ROOT)/include
CLANG_INCLUDE:=$(LLVM_SRC_ROOT)/tools/clang/include
libgcmole.so: gcmole.cc
g++ -I$(LLVM_INCLUDE) -I$(CLANG_INCLUDE) -I. -D_DEBUG -D_GNU_SOURCE \
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 \
-fomit-frame-pointer -fno-exceptions -fno-rtti -fPIC \
-Woverloaded-virtual -Wcast-qual -fno-strict-aliasing \
-pedantic -Wno-long-long -Wall \
-W -Wno-unused-parameter -Wwrite-strings \
-shared -o libgcmole.so gcmole.cc
$(CXX) -I$(LLVM_INCLUDE) -I$(CLANG_INCLUDE) -I. -D_DEBUG \
-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS \
-D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -fno-exceptions \
-fno-rtti -fPIC -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing \
-pedantic -Wno-long-long -Wall -W -Wno-unused-parameter \
-Wwrite-strings -std=c++0x -shared -o libgcmole.so gcmole.cc
clean:
rm -f libgcmole.so
$(RM) libgcmole.so
......@@ -27,9 +27,12 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# 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}")"
LLVM_DIR="${THIS_DIR}/../../third_party/llvm"
......@@ -110,7 +113,7 @@ if [ "${OS}" = "Darwin" ]; then
# See http://crbug.com/256342
STRIP_FLAGS=-x
fi
strip ${STRIP_FLAGS} Release/bin/clang
strip ${STRIP_FLAGS} Release+Asserts/bin/clang
cd -
# Build libgcmole.so
......@@ -122,5 +125,5 @@ set +x
echo
echo You can now run gcmole using this command:
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
This diff is collapsed.
......@@ -93,14 +93,16 @@ end
local function MakeClangCommandLine(plugin, plugin_args, triple, arch_define)
if plugin_args then
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
plugin_args = " " .. table.concat(plugin_args, " ")
end
return CLANG_BIN .. "/clang -cc1 -load " .. CLANG_PLUGINS .. "/libgcmole.so"
.. " -plugin " .. plugin
return CLANG_BIN .. "/clang++ -c "
.. " -Xclang -load -Xclang " .. CLANG_PLUGINS .. "/libgcmole.so"
.. " -Xclang -plugin -Xclang " .. plugin
.. (plugin_args or "")
.. " -triple " .. triple
.. " -Xclang -triple -Xclang " .. triple
.. " -D" .. arch_define
.. " -DENABLE_DEBUGGER_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