forked from Meinersbur/isl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interface: pass correct 4th argument to CompilerInvocation::setLangDe…
…faults Since llvmorg-12-init-16745-gc495dfe0268b ([clang][cli] NFC: Decrease the scope of ParseLangArgs parameters, Thu Jan 14 08:26:12 2021 +0100), the fourth argument of CompilerInvocation::setLangDefaults is a std::vector<std::string> rather than a clang::PreprocessorOptions. Introduce a setLangDefaultsArg4 to pass in the right argument depending on what is expected by the specific version of clang. Signed-off-by: Sven Verdoolaege <[email protected]>
- Loading branch information
Sven Verdoolaege
committed
Apr 10, 2021
1 parent
647edd6
commit aba9b46
Showing
4 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <string> | ||
#include <vector> | ||
|
||
#include <clang/Lex/PreprocessorOptions.h> | ||
|
||
/* Convert a clang::PreprocessorOptions to the fourth argument | ||
* of CompilerInvocation::setLangDefaults, which may be either | ||
* a clang::PreprocessorOptions itself or its Includes. | ||
*/ | ||
struct setLangDefaultsArg4 { | ||
setLangDefaultsArg4(clang::PreprocessorOptions &PO) : PO(PO) {} | ||
operator clang::PreprocessorOptions &() { return PO; } | ||
operator std::vector<std::string> &() { return PO.Includes; } | ||
|
||
clang::PreprocessorOptions &PO; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters