[cfe-dev] #pragma clang assume_nonnull begin/end

Friedman, Eli via cfe-dev cfe-dev at lists.llvm.org
Tue Sep 5 11:55:12 PDT 2017


On 9/5/2017 9:30 AM, Zbigniew Sarbinowski via cfe-dev wrote:
> Does anybody know why the following lines
> #pragma clang assume_nonnull begin
> #pragma clang assume_nonnull end
> are not preserved in preprocessed output?
> Is this a bug or it was designed as such on purpose?

Bug.

There's a small set of pragmas which are handled by the preprocessor 
itself, rather than the parser, for various reasons.  See the complete 
set at Preprocessor::RegisterBuiltinPragmas.  Some of them don't need 
special handling (e.g. "#pragma once" only applies during 
preprocessing).  For the ones that do need to be part of the output, we 
need special cases to handle them in 
lib/Frontend/PrintPreprocessedOutput.cpp.

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170905/fd9125dd/attachment.html>


More information about the cfe-dev mailing list