Skip to content

Commit 63d3aeb

Browse files
committed
[analyzer] Fix out-of-tree only clang build by not relaying on private header
It turned out that the D78704 included a private LLVM header, which is excluded from the LLVM install target. I'm substituting that `#include` with the public one by moving the necessary `#define` into that. There was a discussion about this at D78704 and on the cfe-dev mailing list. I'm also placing a note to remind others of this pitfall. Reviewed By: mgorny Differential Revision: https://reviews.llvm.org/D84929
1 parent a50cec7 commit 63d3aeb

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

clang/unittests/StaticAnalyzer/FalsePositiveRefutationBRVisitorTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
1717
#include "clang/StaticAnalyzer/Frontend/AnalysisConsumer.h"
1818
#include "clang/StaticAnalyzer/Frontend/CheckerRegistry.h"
19-
#include "llvm/Config/config.h"
19+
#include "llvm/Config/llvm-config.h"
2020
#include "gtest/gtest.h"
2121

2222
// FIXME: Use GTEST_SKIP() instead if GTest is updated to version 1.10.0

llvm/include/llvm/Config/config.h.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#ifndef CONFIG_H
22
#define CONFIG_H
33

4+
// Include this header only under the llvm source tree.
5+
// This is a private header.
6+
47
/* Exported configuration */
58
#include "llvm/Config/llvm-config.h"
69

@@ -335,9 +338,6 @@
335338
/* Whether GlobalISel rule coverage is being collected */
336339
#cmakedefine01 LLVM_GISEL_COV_ENABLED
337340

338-
/* Define if we have z3 and want to build it */
339-
#cmakedefine LLVM_WITH_Z3 ${LLVM_WITH_Z3}
340-
341341
/* Define to the default GlobalISel coverage file prefix */
342342
#cmakedefine LLVM_GISEL_COV_PREFIX "${LLVM_GISEL_COV_PREFIX}"
343343

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@
7979
*/
8080
#cmakedefine01 LLVM_FORCE_ENABLE_STATS
8181

82+
/* Define if we have z3 and want to build it */
83+
#cmakedefine LLVM_WITH_Z3 ${LLVM_WITH_Z3}
84+
8285
/* Define if LLVM was built with a dependency to the libtensorflow dynamic library */
8386
#cmakedefine LLVM_HAVE_TF_API
8487

0 commit comments

Comments
 (0)