Keep -I unique: no need to add it if it already exists.

This commit is contained in:
Axel Naumann 2014-02-20 17:32:24 +01:00 committed by sftnight
parent a7c08683ae
commit 9ef996db19

View File

@ -280,6 +280,14 @@ namespace cling {
HeaderSearchOptions& headerOpts = CI->getHeaderSearchOpts();
const bool IsFramework = false;
const bool IsSysRootRelative = true;
// Avoid duplicates; just return early if incpath is already in UserEntries.
for (std::vector<HeaderSearchOptions::Entry>::const_iterator
I = headerOpts.UserEntries.begin(),
E = headerOpts.UserEntries.end(); I != E; ++I)
if (I->Path == incpath)
return;
headerOpts.AddPath(incpath, frontend::Angled, IsFramework,
IsSysRootRelative);