diff options
author | Tim Northover <tnorthover@apple.com> | 2018-11-02 13:14:11 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2018-11-02 13:14:11 +0000 |
commit | 314fbfa1c4c6665c54a220eefb10a6f23010a352 (patch) | |
tree | e7249debf2e3c4d030fd1be7460a7f72a30a1c19 /clang/lib/CodeGen | |
parent | c55d09a00e8067f27de2bb88c12a2bee64a2192a (diff) | |
download | bcm5719-llvm-314fbfa1c4c6665c54a220eefb10a6f23010a352.tar.gz bcm5719-llvm-314fbfa1c4c6665c54a220eefb10a6f23010a352.zip |
Reapply Logging: make os_log buffer size an integer constant expression.
The size of an os_log buffer is known at any stage of compilation, so making it
a constant expression means that the common idiom of declaring a buffer for it
won't result in a VLA. That allows the compiler to skip saving and restoring
the stack pointer around such buffers.
This also moves the OSLog and other FormatString helpers from
libclangAnalysis to libclangAST to avoid a circular dependency.
llvm-svn: 345971
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGBuiltin.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index 2c7a3d720a7..f880e93068a 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -21,7 +21,7 @@ #include "TargetInfo.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" -#include "clang/Analysis/Analyses/OSLog.h" +#include "clang/AST/OSLog.h" #include "clang/Basic/TargetBuiltins.h" #include "clang/Basic/TargetInfo.h" #include "clang/CodeGen/CGFunctionInfo.h" @@ -3606,13 +3606,6 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, case Builtin::BI__builtin_os_log_format: return emitBuiltinOSLogFormat(*E); - case Builtin::BI__builtin_os_log_format_buffer_size: { - analyze_os_log::OSLogBufferLayout Layout; - analyze_os_log::computeOSLogBufferLayout(CGM.getContext(), E, Layout); - return RValue::get(ConstantInt::get(ConvertType(E->getType()), - Layout.size().getQuantity())); - } - case Builtin::BI__xray_customevent: { if (!ShouldXRayInstrumentFunction()) return RValue::getIgnored(); |