summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPMacroExpansion.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2019-02-14 04:13:17 +0000
committerNico Weber <nicolasweber@gmx.de>2019-02-14 04:13:17 +0000
commit023dd1eefad3c3b41633e0644df2e0d29f66d728 (patch)
treef2b6d6aa8d5fc4de307b4254447d4e05123c12f4 /clang/lib/Lex/PPMacroExpansion.cpp
parentee704c1d912d1993cae290ec1cf89c64ab468b63 (diff)
downloadbcm5719-llvm-023dd1eefad3c3b41633e0644df2e0d29f66d728.tar.gz
bcm5719-llvm-023dd1eefad3c3b41633e0644df2e0d29f66d728.zip
Print a note to the called macro when diagnosing err_embedded_directive
Fixes PR40713, see there for the motivation for this. Differential Revision: https://reviews.llvm.org/D58161 llvm-svn: 354009
Diffstat (limited to 'clang/lib/Lex/PPMacroExpansion.cpp')
-rw-r--r--clang/lib/Lex/PPMacroExpansion.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index 2e9c686b2a0..f33a9a2a9de 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -492,10 +492,13 @@ bool Preprocessor::HandleMacroExpandedIdentifier(Token &Identifier,
// Preprocessor directives used inside macro arguments are not portable, and
// this enables the warning.
InMacroArgs = true;
+ ArgMacro = &Identifier;
+
Args = ReadMacroCallArgumentList(Identifier, MI, ExpansionEnd);
// Finished parsing args.
InMacroArgs = false;
+ ArgMacro = nullptr;
// If there was an error parsing the arguments, bail out.
if (!Args) return true;
OpenPOWER on IntegriCloud