On 2011-03-09 18:21, Argyrios Kyrtzidis wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=127339&view=rev
> Log:
> Introduce '-chain-include' option to specify headers that will be converted
> to chained PCHs in memory
> without having to use multiple runs and intermediate files.
...
> Added: cfe/trunk/lib/Serialization/ChainedIncludesSource.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ChainedIncludesSource.cpp?rev=127339&view=auto
...
> + for (unsigned i = 0, e = includes.size(); i != e; ++i) {
> + bool firstInclude = (i == 0);
...
> + for (unsigned i = 0, e = serialBufs.size(); i != e; ++i) {
> + bufs.push_back(llvm::MemoryBuffer::getMemBufferCopy(
> +
> llvm::StringRef(serialBufs[i]->getBufferStart(),
> +
> serialBufs[i]->getBufferSize())));
> + }
> + std::string pchName = includes[i-1];
> + llvm::raw_string_ostream os(pchName);
> + os<< ".pch"<< i-1;
These nested for loops, both having 'unsigned i' variables, make g++
complain:
tools/clang/lib/Serialization/ChainedIncludesSource.cpp: In static member
function 'static clang::ChainedIncludesSource*
clang::ChainedIncludesSource::create(clang::CompilerInstance&)':
tools/clang/lib/Serialization/ChainedIncludesSource.cpp:122: warning: name
lookup of 'i' changed
tools/clang/lib/Serialization/ChainedIncludesSource.cpp:67: warning: matches
this 'i' under ISO standard rules
tools/clang/lib/Serialization/ChainedIncludesSource.cpp:117: warning: matches
this 'i' under old rules
If the "std::string pchName = includes[i-1];" and "os<< ".pch"<< i-1;"
lines are supposed to use the 'outer' i, could you maybe just rename the
'inner' i, to shut up the warning?
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits