]> granicus.if.org Git - llvm/commitdiff
[MCA] Fix MSVC 19.16 build with libc++
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Fri, 9 Aug 2019 12:41:24 +0000 (12:41 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Fri, 9 Aug 2019 12:41:24 +0000 (12:41 +0000)
MSVC (19.16) wants to see the definition of Instruction in
`std::pair<unsigned, const Instruction &> SourceRef` to decide
if it is assignable.

Patch by Orivej Desh.

Differential Revision: https://reviews.llvm.org/D65844

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368436 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MCA/SourceMgr.h

index dbe31db1b1ddbd97c41c6178729daa245ba5a359..e844171bdcab9f1c766a24c916ab832accc11f89 100644 (file)
 #define LLVM_MCA_SOURCEMGR_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/MCA/Instruction.h"
 
 namespace llvm {
 namespace mca {
 
-class Instruction;
-
+// MSVC >= 19.15, < 19.20 need to see the definition of class Instruction to
+// prevent compiler error C2139 about intrinsic type trait '__is_assignable'.
 typedef std::pair<unsigned, const Instruction &> SourceRef;
 
 class SourceMgr {