[PATCH] D65844: [MCA] Fix MSVC build with libc++

Orivej Desh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 21:17:54 PDT 2019


orivej created this revision.
orivej added a reviewer: andreadb.
orivej added a project: LLVM.
Herald added a reviewer: EricWF.
Herald added a subscriber: llvm-commits.

MSVC (19.16) wants to see the definition of `Instruction` in `std::pair<unsigned, const Instruction &> SourceRef` to decide if it is assignable:

  libcxx/include/type_traits:2209: error C2139: 'llvm::mca::Instruction': an undefined class is not allowed as an argument to compiler intrinsic type trait '__is_assignable'
  llvm/include/llvm/mca/sourcemgr.h:31: note: see declaration of 'llvm::mca::Instruction'
  libcxx/include/type_traits:2226: note: see reference to class template instantiation 'std::is_assignable<const llvm::mca::Instruction &,const llvm::mca::Instruction &>' being compiled
  libcxx/include/utility:524: note: see reference to class template instantiation 'std::is_copy_assignable<const llvm::mca::Instruction &>' being compiled
  llvm/include/llvm/mca/sourcemgr.h:51: note: see reference to class template instantiation 'std::pair<unsigned int,const llvm::mca::Instruction &>' being compiled


Repository:
  rL LLVM

https://reviews.llvm.org/D65844

Files:
  include/llvm/MCA/SourceMgr.h


Index: include/llvm/MCA/SourceMgr.h
===================================================================
--- include/llvm/MCA/SourceMgr.h
+++ include/llvm/MCA/SourceMgr.h
@@ -16,12 +16,11 @@
 #define LLVM_MCA_SOURCEMGR_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/MCA/Instruction.h"
 
 namespace llvm {
 namespace mca {
 
-class Instruction;
-
 typedef std::pair<unsigned, const Instruction &> SourceRef;
 
 class SourceMgr {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65844.213787.patch
Type: text/x-patch
Size: 432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190807/0821235a/attachment.bin>


More information about the llvm-commits mailing list