Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Issue 385273002: Subzero: Deal with substitutions in the primitive remangler. (Closed)

Created:
6 years, 5 months ago by Jim Stichnoth
Modified:
6 years, 5 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Visibility:
Public.

Description

Subzero: Deal with substitutions in the primitive remangler. https://refspecs.linuxbase.org/cxxabi-1.75.html#mangling-compression describes the mechanism for compressing mangled strings by using substitutions of the form S[0-9A-Z]*_ to represent repeated components. When the prefix is handled as wrapping inside a namespace, the base-36 substitution numbers all have to be incremented. This is implemented in a very simple way by scanning the string only for instances of the substitution pattern. Unfortunately, false matches are possible because the S[0-9A-Z]*_ pattern can be a substring of the type name, or can span other components of the mangled name. Getting this completely right would essentially require a full demangling parser - see the ~4000 lines of code in cxa_demangle.cpp and ItaniumMangle.cpp. Since this is just for testing, any false matches will likely cause a linking error and the test can be rewritten to avoid false matches. BUG= none R=jvoung@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=217dc08

Patch Set 1 #

Patch Set 2 : Test that non-C++ symbols don't have substitutions updated #

Total comments: 8

Patch Set 3 : Use "C" locale for isupper(). Remove Valid variable. Clarify S_ ==> S0_. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+120 lines, -5 lines) Patch
M src/IceGlobalContext.h View 1 chunk +4 lines, -0 lines 0 comments Download
M src/IceGlobalContext.cpp View 1 2 6 chunks +93 lines, -5 lines 0 comments Download
M tests_lit/llvm2ice_tests/mangle.ll View 1 1 chunk +23 lines, -0 lines 1 comment Download

Messages

Total messages: 6 (0 generated)
Jim Stichnoth
6 years, 5 months ago (2014-07-11 18:50:04 UTC) #1
jvoung (off chromium)
LGTM https://codereview.chromium.org/385273002/diff/20001/src/IceGlobalContext.cpp File src/IceGlobalContext.cpp (right): https://codereview.chromium.org/385273002/diff/20001/src/IceGlobalContext.cpp#newcode148 src/IceGlobalContext.cpp:148: for (Last = OldPos + 1; Last < ...
6 years, 5 months ago (2014-07-11 20:40:09 UTC) #2
Jim Stichnoth
https://codereview.chromium.org/385273002/diff/20001/src/IceGlobalContext.cpp File src/IceGlobalContext.cpp (right): https://codereview.chromium.org/385273002/diff/20001/src/IceGlobalContext.cpp#newcode148 src/IceGlobalContext.cpp:148: for (Last = OldPos + 1; Last < OldLen ...
6 years, 5 months ago (2014-07-11 21:05:12 UTC) #3
Jim Stichnoth
Committed patchset #3 manually as r217dc08 (presubmit successful).
6 years, 5 months ago (2014-07-11 21:06:59 UTC) #4
wala
https://codereview.chromium.org/385273002/diff/40001/tests_lit/llvm2ice_tests/mangle.ll File tests_lit/llvm2ice_tests/mangle.ll (right): https://codereview.chromium.org/385273002/diff/40001/tests_lit/llvm2ice_tests/mangle.ll#newcode108 tests_lit/llvm2ice_tests/mangle.ll:108: ; String length increase, e.g. SZZZ_ ==> S0000_ The ...
6 years, 5 months ago (2014-07-11 21:21:56 UTC) #5
Jim Stichnoth
6 years, 5 months ago (2014-07-11 22:04:50 UTC) #6
Message was sent while issue was closed.
On 2014/07/11 21:21:56, wala wrote:
>
https://codereview.chromium.org/385273002/diff/40001/tests_lit/llvm2ice_tests...
> File tests_lit/llvm2ice_tests/mangle.ll (right):
> 
>
https://codereview.chromium.org/385273002/diff/40001/tests_lit/llvm2ice_tests...
> tests_lit/llvm2ice_tests/mangle.ll:108: ;   String length increase, e.g. SZZZ_
> ==> S0000_
> The successor of ZZZ in base 36 is 1000. Why 0000 here?
> 
> CXXNameMangler::mangleSeqID seems to use straightforward base 36 conversion
> (http://clang.llvm.org/doxygen/ItaniumMangle_8cpp_source.html), so it would
> represent the successor of ZZZ as 1000.

Oops, you're right, I misread the spec.  I'll fix this in a new CL.

Powered by Google App Engine
This is Rietveld 408576698