aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Basic/SourceManagerTest.cpp
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2015-05-02 15:31:08 +0000
committerYaron Keren <yaron.keren@gmail.com>2015-05-02 15:31:08 +0000
commit2155f8042643c955fe84df6f2478a7c938b7939e (patch)
tree99aba4c7fb2d34034565d3d8154c4e2fc1aca7b8 /clang/unittests/Basic/SourceManagerTest.cpp
parentd5e20306cc9ec9449a949d4ab08121066bea74f7 (diff)
downloadllvm-2155f8042643c955fe84df6f2478a7c938b7939e.zip
llvm-2155f8042643c955fe84df6f2478a7c938b7939e.tar.gz
llvm-2155f8042643c955fe84df6f2478a7c938b7939e.tar.bz2
Replace GetNumBytesInBuffer() in MicrosoftCXXNameMangler::mangleArgumentType by tell().
Using GetNumBytesInBuffer() assumes that the stream was not flushed between the GetNumBytesInBuffer() calls, which may happen to be true or not, depending on stream policy. tell() always reports the correct stream location. Do note there are only two more uses of GetNumBytesInBuffer() in LLVM+clang, in lib/MC/MCAsmStreamer.cpp and lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp. The former may be replacable by tell (needs testing) but while the later can not be immediatly replaced by tell() as it uses the absolute value of GetNumBytesInBuffer() rather than the real stream position. Both uses seems to depend upon flush policy and thus may not work correctly depending upon the stream behaviour. Going forward, GetNumBytesInBuffer() should probably be protected, non-accessible to raw_ostream clients. llvm-svn: 236389
Diffstat (limited to 'clang/unittests/Basic/SourceManagerTest.cpp')
0 files changed, 0 insertions, 0 deletions