Implement the #define_other_target directive.
llvm-svn: 38984
diff --git a/clang/Lex/PPExpressions.cpp b/clang/Lex/PPExpressions.cpp
index 3217df9..9ed59d5 100644
--- a/clang/Lex/PPExpressions.cpp
+++ b/clang/Lex/PPExpressions.cpp
@@ -106,6 +106,13 @@
PP.getTargetInfo().DiagnoseNonPortability(PeekTok.getLocation(),
diag::port_target_macro_use);
}
+ } else {
+ // Use of a target-specific macro for some other target? If so, warn.
+ if (II->isOtherTargetMacro()) {
+ II->setIsOtherTargetMacro(false); // Don't warn on second use.
+ PP.getTargetInfo().DiagnoseNonPortability(PeekTok.getLocation(),
+ diag::port_target_macro_use);
+ }
}
// Consume identifier.