summaryrefslogtreecommitdiffstats
path: root/clang/Lex/PPExpressions.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-10-14 19:54:15 +0000
committerChris Lattner <sabre@nondot.org>2006-10-14 19:54:15 +0000
commit063400e46e209e2c6dcc16e134d26175b97fb585 (patch)
treec04187337f99ebc77aec40192d9670c436afc242 /clang/Lex/PPExpressions.cpp
parent58360339bd15868ddc921ffdd300fa2634864e69 (diff)
downloadbcm5719-llvm-063400e46e209e2c6dcc16e134d26175b97fb585.tar.gz
bcm5719-llvm-063400e46e209e2c6dcc16e134d26175b97fb585.zip
Implement the #define_other_target directive.
llvm-svn: 38984
Diffstat (limited to 'clang/Lex/PPExpressions.cpp')
-rw-r--r--clang/Lex/PPExpressions.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/Lex/PPExpressions.cpp b/clang/Lex/PPExpressions.cpp
index 3217df9fc9e..9ed59d5b13a 100644
--- a/clang/Lex/PPExpressions.cpp
+++ b/clang/Lex/PPExpressions.cpp
@@ -106,6 +106,13 @@ static bool EvaluateValue(int &Result, LexerToken &PeekTok, DefinedTracker &DT,
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.
OpenPOWER on IntegriCloud