aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2018-11-01 16:15:24 +0000
committerTim Northover <tnorthover@apple.com>2018-11-01 16:15:24 +0000
commitd686dbbc7c24a81a46f61733d48df866f2874e24 (patch)
tree257b32b0f9d6dce6f66db1cd98998df5f0b04f44 /clang/lib
parent32a34e6d7e97c37c18b2051d37d932c38758b9d0 (diff)
downloadllvm-d686dbbc7c24a81a46f61733d48df866f2874e24.zip
llvm-d686dbbc7c24a81a46f61733d48df866f2874e24.tar.gz
llvm-d686dbbc7c24a81a46f61733d48df866f2874e24.tar.bz2
Revert "Logging: make os_log buffer size an integer constant expression.
This also reverts a couple of follow-up commits trying to fix the dependency issues. Latest revision added a cyclic dependency that can't just be patched up in 5 minutes. llvm-svn: 345846
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/CMakeLists.txt1
-rw-r--r--clang/lib/AST/ExprConstant.cpp7
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp7
3 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/AST/CMakeLists.txt b/clang/lib/AST/CMakeLists.txt
index d0447bc..4f868a3 100644
--- a/clang/lib/AST/CMakeLists.txt
+++ b/clang/lib/AST/CMakeLists.txt
@@ -72,7 +72,6 @@ add_clang_library(clangAST
VTTBuilder.cpp
LINK_LIBS
- clangAnalysis
clangBasic
clangLex
)
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 9fc7b30..bf08d6b 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -33,7 +33,6 @@
//
//===----------------------------------------------------------------------===//
-#include "clang/Analysis/Analyses/OSLog.h"
#include "clang/AST/APValue.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTDiagnostic.h"
@@ -8127,12 +8126,6 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
llvm_unreachable("unexpected EvalMode");
}
- case Builtin::BI__builtin_os_log_format_buffer_size: {
- analyze_os_log::OSLogBufferLayout Layout;
- analyze_os_log::computeOSLogBufferLayout(Info.Ctx, E, Layout);
- return Success(Layout.size().getQuantity(), E);
- }
-
case Builtin::BI__builtin_bswap16:
case Builtin::BI__builtin_bswap32:
case Builtin::BI__builtin_bswap64: {
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 271dc2a..c67db26 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -3609,6 +3609,13 @@ 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();