Skip to content

Commit

Permalink
Workaround an assertion failure during module build
Browse files Browse the repository at this point in the history
After the change in https://reviews.llvm.org/D131858, clang cannot
bootstrap itself with modules due to assertion failure:
(lvaluePath->getType() == elemTy && "Unexpected type reference!")

Workaround the assertion by converting some of the includes into forward
declares.

Reviewed By: arphaman

Differential Revision: https://reviews.llvm.org/D139956
  • Loading branch information
cachemeifyoucan committed Dec 13, 2022
1 parent 269177e commit e77e14e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Expand Up @@ -39,7 +39,6 @@
#include "llvm/IR/Type.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/ValueMapper.h"
#include <algorithm>
#include <cassert>
#include <functional>
Expand Down
6 changes: 5 additions & 1 deletion llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
Expand Up @@ -18,10 +18,11 @@
#include "llvm/ExecutionEngine/JITSymbol.h"
#include "llvm/ExecutionEngine/Orc/Core.h"
#include "llvm/ExecutionEngine/Orc/OrcABISupport.h"
#include "llvm/IR/ValueHandle.h"
#include "llvm/IR/ValueMap.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/Memory.h"
#include "llvm/Support/Process.h"
#include "llvm/Transforms/Utils/ValueMapper.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
Expand All @@ -47,6 +48,9 @@ class Twine;
class Value;
class MCDisassembler;
class MCInstrAnalysis;
class ValueMaterializer;

using ValueToValueMapTy = ValueMap<const Value *, WeakTrackingVH>;

namespace jitlink {
class LinkGraph;
Expand Down
3 changes: 2 additions & 1 deletion llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h
Expand Up @@ -13,14 +13,15 @@
#ifndef LLVM_EXECUTIONENGINE_ORC_SPECULATEANALYSES_H
#define LLVM_EXECUTIONENGINE_ORC_SPECULATEANALYSES_H

#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/ExecutionEngine/Orc/Core.h"
#include "llvm/ExecutionEngine/Orc/Speculation.h"

#include <vector>

namespace llvm {

class BranchProbabilityInfo;

namespace orc {

// Provides common code.
Expand Down

0 comments on commit e77e14e

Please sign in to comment.