aboutsummaryrefslogtreecommitdiffstats
path: root/dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Fix-for-buildbreak-when-using-clang-9-compiler.patch
blob: 4af8c17e86fa931b7d216526572294ebd5513768 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
From 598038626dd2c10b96308347718f26cfa3dc509c Mon Sep 17 00:00:00 2001
From: "Wesierski, Lukasz" <lukasz.wesierski@intel.com>
Date: Mon, 9 Sep 2019 09:11:20 -0700
Subject: [PATCH 4/4] Fix for buildbreak when using clang-9 compiler

Fixes #106
Fxies #111

Change-Id: I291bf03c31b1786a00b8bc2c6d23c5adb8b72e73

Upstream-Status: Backport [https://github.com/intel/intel-graphics-compiler/commit/a332238b46e9fa9e06265d18eb877d095015e6fb]

Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
---
 IGC/AdaptorOCL/SPIRV/libSPIRV/SPIRVEntry.h    |   4 +
 .../SPIRV/libSPIRV/SPIRVInstruction.h         |  18 +--
 IGC/AdaptorOCL/SPIRV/libSPIRV/SPIRVModule.cpp | 136 +++++++++---------
 IGC/AdaptorOCL/cif/cif/export/registry.h      |   3 +-
 IGC/OCLFE/igd_fcl_mcl/source/clang_tb.cpp     |   4 +-
 visa/CISA.l                                   |   2 +-
 visa/CMakeLists.txt                           |   6 +-
 7 files changed, 89 insertions(+), 84 deletions(-)

diff --git a/IGC/AdaptorOCL/SPIRV/libSPIRV/SPIRVEntry.h b/IGC/AdaptorOCL/SPIRV/libSPIRV/SPIRVEntry.h
index 7a2ba855..307ba3f3 100644
--- a/IGC/AdaptorOCL/SPIRV/libSPIRV/SPIRVEntry.h
+++ b/IGC/AdaptorOCL/SPIRV/libSPIRV/SPIRVEntry.h
@@ -129,8 +129,12 @@ class SPIRVExtInst;
     void decode(std::istream &I) { getDecoder(I) >> x >> y;}
 #define _SPIRV_DEF_DEC3(x,y,z)                                                           \
     void decode(std::istream &I) { getDecoder(I) >> x >> y >> z;}
+#define _SPIRV_DEF_DEC3_OVERRIDE(x,y,z)                                                  \
+    void decode(std::istream &I) override { getDecoder(I) >> x >> y >> z;}
 #define _SPIRV_DEF_DEC4(x,y,z,u)                                                         \
     void decode(std::istream &I) { getDecoder(I) >> x >> y >> z >> u;}
+#define _SPIRV_DEF_DEC4_OVERRIDE(x,y,z,u)                                                \
+    void decode(std::istream &I) override { getDecoder(I) >> x >> y >> z >> u;}
 #define _SPIRV_DEF_DEC5(x,y,z,u,v)                                                       \
     void decode(std::istream &I) { getDecoder(I) >> x >> y >> z >> u >> v;}
 #define _SPIRV_DEF_DEC6(x,y,z,u,v,w)                                                     \
diff --git a/IGC/AdaptorOCL/SPIRV/libSPIRV/SPIRVInstruction.h b/IGC/AdaptorOCL/SPIRV/libSPIRV/SPIRVInstruction.h
index 9f4e9d1f..bb85fd04 100644
--- a/IGC/AdaptorOCL/SPIRV/libSPIRV/SPIRVInstruction.h
+++ b/IGC/AdaptorOCL/SPIRV/libSPIRV/SPIRVInstruction.h
@@ -727,10 +727,10 @@ public:
     return getValue(ConditionId);
   }
   SPIRVLabel *getTrueLabel() const {
-    return get<SPIRVLabel>(TrueLabelId);
+    return SPIRVEntry::get<SPIRVLabel>(TrueLabelId);
   }
   SPIRVLabel *getFalseLabel() const {
-    return get<SPIRVLabel>(FalseLabelId);
+    return SPIRVEntry::get<SPIRVLabel>(FalseLabelId);
   }
 protected:
   void setWordCount(SPIRVWord TheWordCount) {
@@ -940,7 +940,7 @@ public:
     SPIRVEntry::setWordCount(TheWordCount);
     LoopControlParameters.resize(TheWordCount - FixedWordCount);
   }
-  _SPIRV_DEF_DEC4(MergeBlock, ContinueTarget, LoopControl,
+  _SPIRV_DEF_DEC4_OVERRIDE(MergeBlock, ContinueTarget, LoopControl,
                   LoopControlParameters)
 
 protected:
@@ -1120,7 +1120,7 @@ public:
 
   SPIRVFunctionCallGeneric(SPIRVModule *BM, SPIRVWord ResId, SPIRVType *TheType,
     const std::vector<SPIRVWord> &TheArgs)
-    : SPIRVInstruction(TheArgs.size() + FixedWordCount, OC, TheType, ResId,
+    : SPIRVInstruction(TheArgs.size() + FixedWordCount, OC, TheType, ResId, NULL,
       BM),
     Args(TheArgs) {}
   SPIRVFunctionCallGeneric():SPIRVInstruction(OC) {}
@@ -1152,7 +1152,7 @@ class SPIRVFunctionCall:
 public:
   SPIRVFunctionCall():FunctionId(SPIRVID_INVALID) {}
   SPIRVFunction *getFunction()const {
-    return get<SPIRVFunction>(FunctionId);
+    return SPIRVEntry::get<SPIRVFunction>(FunctionId);
   }
   _SPIRV_DEF_DEC4(Type, Id, FunctionId, Args)
   void validate()const;
@@ -1169,8 +1169,8 @@ public:
     const std::vector<SPIRVWord>& TheArgs,
     SPIRVBasicBlock* BB);
   SPIRVFunctionPointerCallINTEL() : CalledValueId(SPIRVID_INVALID) {}
-  SPIRVValue* getCalledValue() const { return get<SPIRVValue>(CalledValueId); }
-  _SPIRV_DEF_DEC4(Type, Id, CalledValueId, Args)
+  SPIRVValue* getCalledValue() const { return SPIRVEntry::get<SPIRVValue>(CalledValueId); }
+  _SPIRV_DEF_DEC4_OVERRIDE(Type, Id, CalledValueId, Args)
   void validate() const override;
   bool isOperandLiteral(unsigned Index) const { return false; }
   CapVec getRequiredCapability() const override {
@@ -1188,8 +1188,8 @@ public:
   SPIRVFunctionPointerINTEL(SPIRVId TheId, SPIRVType* TheType,
     SPIRVFunction* TheFunction, SPIRVBasicBlock* BB);
   SPIRVFunctionPointerINTEL() : SPIRVInstruction(OC), TheFunction(SPIRVID_INVALID) {}
-  SPIRVFunction* getFunction() const { return get<SPIRVFunction>(TheFunction); }
-  _SPIRV_DEF_DEC3(Type, Id, TheFunction)
+  SPIRVFunction* getFunction() const { return SPIRVEntry::get<SPIRVFunction>(TheFunction); }
+  _SPIRV_DEF_DEC3_OVERRIDE(Type, Id, TheFunction)
   void validate() const override;
   bool isOperandLiteral(unsigned Index) const { return false; }
   CapVec getRequiredCapability() const override {
diff --git a/IGC/AdaptorOCL/SPIRV/libSPIRV/SPIRVModule.cpp b/IGC/AdaptorOCL/SPIRV/libSPIRV/SPIRVModule.cpp
index 353341b5..74ab6e93 100644
--- a/IGC/AdaptorOCL/SPIRV/libSPIRV/SPIRVModule.cpp
+++ b/IGC/AdaptorOCL/SPIRV/libSPIRV/SPIRVModule.cpp
@@ -94,126 +94,126 @@ public:
   virtual ~SPIRVModuleImpl();
 
   // Object query functions
-  bool exist(SPIRVId) const;
-  bool exist(SPIRVId, SPIRVEntry **) const;
+  bool exist(SPIRVId) const override;
+  bool exist(SPIRVId, SPIRVEntry **) const override;
   SPIRVId getId(SPIRVId Id = SPIRVID_INVALID, unsigned Increment = 1);
-  virtual SPIRVEntry *getEntry(SPIRVId Id) const;
+  virtual SPIRVEntry *getEntry(SPIRVId Id) const override;
   virtual void addUnknownStructField(
-    SPIRVTypeStruct*, unsigned idx, SPIRVId id);
-  virtual void resolveUnknownStructFields();
-  bool hasDebugInfo() const
+    SPIRVTypeStruct*, unsigned idx, SPIRVId id) override;
+  virtual void resolveUnknownStructFields() override;
+  bool hasDebugInfo() const override
   {
       return getCompilationUnit() != nullptr;
   }
 
   // Error handling functions
-  SPIRVErrorLog &getErrorLog() { return ErrLog;}
-  SPIRVErrorCode getError(std::string &ErrMsg) { return ErrLog.getError(ErrMsg);}
+  SPIRVErrorLog &getErrorLog() override { return ErrLog;}
+  SPIRVErrorCode getError(std::string &ErrMsg) override { return ErrLog.getError(ErrMsg);}
 
   // Module query functions
-  SPIRVAddressingModelKind getAddressingModel() { return AddrModel;}
-  SPIRVExtInstSetKind getBuiltinSet(SPIRVId SetId) const;
-  const SPIRVCapSet &getCapability() const { return CapSet;}
-  const std::string &getCompileFlag() const { return CompileFlag;}
-  std::string &getCompileFlag() { return CompileFlag;}
-  void setCompileFlag(const std::string &options) { CompileFlag = options; }
-  bool isSpecConstant(SPIRVWord spec_id) const {
+  SPIRVAddressingModelKind getAddressingModel() override { return AddrModel;}
+  SPIRVExtInstSetKind getBuiltinSet(SPIRVId SetId) const override;
+  const SPIRVCapSet &getCapability() const override { return CapSet;}
+  const std::string &getCompileFlag() const override { return CompileFlag;}
+  std::string &getCompileFlag() override { return CompileFlag;}
+  void setCompileFlag(const std::string &options) override { CompileFlag = options; }
+  bool isSpecConstant(SPIRVWord spec_id) const override {
     if(SCMap)
       return SCMap->find(spec_id) != SCMap->end();
     else
       return false;
   }
-  uint64_t getSpecConstant(SPIRVWord spec_id) {
+  uint64_t getSpecConstant(SPIRVWord spec_id) override {
     spirv_assert(isSpecConstant(spec_id) && "Specialization constant was not specialized!");
     return SCMap->at(spec_id);
   }
-  void setSpecConstantMap(SPIRVSpecConstantMap *specConstants) { SCMap = specConstants; }
-  std::set<std::string> &getExtension() { return SPIRVExt;}
-  SPIRVFunction *getFunction(unsigned I) const { return FuncVec[I];}
-  SPIRVVariable *getVariable(unsigned I) const { return VariableVec[I];}
-  virtual SPIRVValue *getValue(SPIRVId TheId) const;
-  virtual std::vector<SPIRVValue *> getValues(const std::vector<SPIRVId>&)const;
-  virtual std::vector<SPIRVId> getIds(const std::vector<SPIRVEntry *>&)const;
-  virtual std::vector<SPIRVId> getIds(const std::vector<SPIRVValue *>&)const;
-  virtual SPIRVType *getValueType(SPIRVId TheId)const;
+  void setSpecConstantMap(SPIRVSpecConstantMap *specConstants) override { SCMap = specConstants; }
+  std::set<std::string> &getExtension() override { return SPIRVExt;}
+  SPIRVFunction *getFunction(unsigned I) const override { return FuncVec[I];}
+  SPIRVVariable *getVariable(unsigned I) const override { return VariableVec[I];}
+  virtual SPIRVValue *getValue(SPIRVId TheId) const override;
+  virtual std::vector<SPIRVValue *> getValues(const std::vector<SPIRVId>&)const override;
+  virtual std::vector<SPIRVId> getIds(const std::vector<SPIRVEntry *>&)const override;
+  virtual std::vector<SPIRVId> getIds(const std::vector<SPIRVValue *>&)const override;
+  virtual SPIRVType *getValueType(SPIRVId TheId)const override;
   virtual std::vector<SPIRVType *> getValueTypes(const std::vector<SPIRVId>&)
-      const;
-  SPIRVMemoryModelKind getMemoryModel() { return MemoryModel;}
-  virtual SPIRVConstant* getLiteralAsConstant(unsigned Literal);
-  unsigned getNumEntryPoints(SPIRVExecutionModelKind EM) const {
+      const override;
+  SPIRVMemoryModelKind getMemoryModel() override { return MemoryModel;}
+  virtual SPIRVConstant* getLiteralAsConstant(unsigned Literal) override;
+  unsigned getNumEntryPoints(SPIRVExecutionModelKind EM) const override{
     auto Loc = EntryPointVec.find(EM);
     if (Loc == EntryPointVec.end())
       return 0;
     return Loc->second.size();
   }
-  SPIRVFunction *getEntryPoint(SPIRVExecutionModelKind EM, unsigned I) const {
+  SPIRVFunction *getEntryPoint(SPIRVExecutionModelKind EM, unsigned I) const override {
     auto Loc = EntryPointVec.find(EM);
     if (Loc == EntryPointVec.end())
       return nullptr;
     spirv_assert(I < Loc->second.size());
     return get<SPIRVFunction>(Loc->second[I]);
   }
-  unsigned getNumFunctions() const { return FuncVec.size();}
-  unsigned getNumVariables() const { return VariableVec.size();}
-  SpvSourceLanguage getSourceLanguage(SPIRVWord * Ver = nullptr) const {
+  unsigned getNumFunctions() const override { return FuncVec.size();}
+  unsigned getNumVariables() const override { return VariableVec.size();}
+  SpvSourceLanguage getSourceLanguage(SPIRVWord * Ver = nullptr) const override {
     if (Ver)
       *Ver = SrcLangVer;
     return SrcLang;
   }
-  std::set<std::string> &getSourceExtension() { return SrcExtension;}
-  bool isEntryPoint(SPIRVExecutionModelKind, SPIRVId EP) const;
+  std::set<std::string> &getSourceExtension() override { return SrcExtension;}
+  bool isEntryPoint(SPIRVExecutionModelKind, SPIRVId EP) const override;
   const std::string &getModuleProcessed() const { return ModuleProcessed; }
-  const std::vector<SPIRVString *> &getStringVec() const { return StringVec; }
+  const std::vector<SPIRVString *> &getStringVec() const override { return StringVec; }
 
   // Module changing functions
-  bool importBuiltinSet(const std::string &, SPIRVId *);
-  bool importBuiltinSetWithId(const std::string &, SPIRVId);
-  void optimizeDecorates();
-  void setAddressingModel(SPIRVAddressingModelKind AM) { AddrModel = AM;}
-  void setAlignment(SPIRVValue *, SPIRVWord);
-  void setMemoryModel(SPIRVMemoryModelKind MM) { MemoryModel = MM;}
-  void setName(SPIRVEntry *E, const std::string &Name);
-  void setSourceLanguage(SpvSourceLanguage Lang, SPIRVWord Ver) {
+  bool importBuiltinSet(const std::string &, SPIRVId *) override;
+  bool importBuiltinSetWithId(const std::string &, SPIRVId) override;
+  void optimizeDecorates() override;
+  void setAddressingModel(SPIRVAddressingModelKind AM) override { AddrModel = AM;}
+  void setAlignment(SPIRVValue *, SPIRVWord) override;
+  void setMemoryModel(SPIRVMemoryModelKind MM) override { MemoryModel = MM;}
+  void setName(SPIRVEntry *E, const std::string &Name) override;
+  void setSourceLanguage(SpvSourceLanguage Lang, SPIRVWord Ver) override {
     SrcLang = Lang;
     SrcLangVer = Ver;
   }
-  void setModuleProcessed(const std::string& MP) {
+  void setModuleProcessed(const std::string& MP) override {
     ModuleProcessed = MP;
   }
 
   // Object creation functions
   template<class T> void addTo(std::vector<T *> &V, SPIRVEntry *E);
-  virtual SPIRVEntry *addEntry(SPIRVEntry *E);
-  virtual SPIRVString *getString(const std::string &Str);
+  virtual SPIRVEntry *addEntry(SPIRVEntry *E) override;
+  virtual SPIRVString *getString(const std::string &Str) override;
   virtual SPIRVMemberName *addMemberName(SPIRVTypeStruct *ST,
-      SPIRVWord MemberNumber, const std::string &Name);
+      SPIRVWord MemberNumber, const std::string &Name) override;
   virtual SPIRVLine *addLine(SPIRVString *FileName, SPIRVWord Line,
-      SPIRVWord Column);
-  virtual void addCapability(SPIRVCapabilityKind);
-  virtual const SPIRVDecorateGeneric *addDecorate(const SPIRVDecorateGeneric *);
-  virtual SPIRVDecorationGroup *addDecorationGroup();
-  virtual SPIRVDecorationGroup *addDecorationGroup(SPIRVDecorationGroup *Group);
+      SPIRVWord Column) override;
+  virtual void addCapability(SPIRVCapabilityKind) override;
+  virtual const SPIRVDecorateGeneric *addDecorate(const SPIRVDecorateGeneric *) override;
+  virtual SPIRVDecorationGroup *addDecorationGroup() override;
+  virtual SPIRVDecorationGroup *addDecorationGroup(SPIRVDecorationGroup *Group) override;
   virtual SPIRVGroupDecorate *addGroupDecorate(SPIRVDecorationGroup *Group,
-      const std::vector<SPIRVEntry *> &Targets);
+      const std::vector<SPIRVEntry *> &Targets) override;
   virtual SPIRVGroupDecorateGeneric *addGroupDecorateGeneric(
-      SPIRVGroupDecorateGeneric *GDec);
+      SPIRVGroupDecorateGeneric *GDec) override;
   virtual SPIRVGroupMemberDecorate *addGroupMemberDecorate(
-      SPIRVDecorationGroup *Group, const std::vector<SPIRVEntry *> &Targets);
+      SPIRVDecorationGroup *Group, const std::vector<SPIRVEntry *> &Targets) override;
   virtual void addEntryPoint(SPIRVExecutionModelKind ExecModel,
-      SPIRVId EntryPoint);
-  virtual SPIRVForward *addForward(SPIRVType *Ty);
-  virtual SPIRVForward *addForward(SPIRVId, SPIRVType *Ty);
-  virtual SPIRVFunction *addFunction(SPIRVFunction *);
-  virtual SPIRVFunction *addFunction(SPIRVTypeFunction *, SPIRVId);
-  virtual SPIRVEntry *replaceForward(SPIRVForward *, SPIRVEntry *);
+      SPIRVId EntryPoint) override;
+  virtual SPIRVForward *addForward(SPIRVType *Ty) override;
+  virtual SPIRVForward *addForward(SPIRVId, SPIRVType *Ty) override;
+  virtual SPIRVFunction *addFunction(SPIRVFunction *) override;
+  virtual SPIRVFunction *addFunction(SPIRVTypeFunction *, SPIRVId) override;
+  virtual SPIRVEntry *replaceForward(SPIRVForward *, SPIRVEntry *) override;
 
   // Type creation functions
   template<class T> T * addType(T *Ty);
-  virtual SPIRVTypeInt *addIntegerType(unsigned BitWidth);
+  virtual SPIRVTypeInt *addIntegerType(unsigned BitWidth) override;
 
   // Constant creation functions
-  virtual SPIRVValue *addConstant(SPIRVValue *);
-  virtual SPIRVValue *addConstant(SPIRVType *, uint64_t);
+  virtual SPIRVValue *addConstant(SPIRVValue *) override;
+  virtual SPIRVValue *addConstant(SPIRVType *, uint64_t) override;
 
   virtual SPIRVInstruction *addLoopMergeInst(
       SPIRVId MergeBlock, SPIRVId ContinueTarget,
@@ -226,7 +226,7 @@ public:
   addInstruction(SPIRVInstruction *Inst, SPIRVBasicBlock *BB,
                  SPIRVInstruction *InsertBefore = nullptr);
 
-  virtual SPIRVExtInst* getCompilationUnit() const
+  virtual SPIRVExtInst* getCompilationUnit() const override
   {
       for (auto& item : IdEntryMap)
       {
@@ -242,7 +242,7 @@ public:
       return nullptr;
   }
 
-  virtual std::vector<SPIRVExtInst*> getGlobalVars()
+  virtual std::vector<SPIRVExtInst*> getGlobalVars() override
   {
       std::vector<SPIRVExtInst*> globalVars;
 
@@ -260,7 +260,7 @@ public:
       return globalVars;
   }
 
-  virtual std::vector<SPIRVValue*> parseSpecConstants()
+  virtual std::vector<SPIRVValue*> parseSpecConstants() override
   {
       std::vector<SPIRVValue*> specConstants;
 
diff --git a/IGC/AdaptorOCL/cif/cif/export/registry.h b/IGC/AdaptorOCL/cif/cif/export/registry.h
index a2b893c2..1571a698 100644
--- a/IGC/AdaptorOCL/cif/cif/export/registry.h
+++ b/IGC/AdaptorOCL/cif/cif/export/registry.h
@@ -50,7 +50,8 @@ namespace Helpers {
 struct EntryPointInterfaceBase{
     EntryPointInterfaceBase(){
     }
-
+    virtual ~EntryPointInterfaceBase() = default;
+  
     virtual ICIF * Create(Version_t version, ICIF * parent) const = 0;
     virtual InterfaceId_t GetFirstIncompatible(CIF::CompatibilityDataHandle handle) const = 0;
     virtual void GetSupportedVersions(Version_t &verMin, Version_t &verMax) const = 0;
diff --git a/IGC/OCLFE/igd_fcl_mcl/source/clang_tb.cpp b/IGC/OCLFE/igd_fcl_mcl/source/clang_tb.cpp
index ebad9b3d..3bde1151 100644
--- a/IGC/OCLFE/igd_fcl_mcl/source/clang_tb.cpp
+++ b/IGC/OCLFE/igd_fcl_mcl/source/clang_tb.cpp
@@ -301,7 +301,7 @@ namespace FCL
             std::string dumpPath = "c:\\Intel\\IGC\\";        // default if something goes wrong
             char custom_dir[256];
             FCLReadIGCRegistry("DumpToCustomDir", custom_dir, sizeof(custom_dir));
-            if (custom_dir != nullptr && strlen(custom_dir) > 0)
+            if (strlen(custom_dir) > 0)
             {
                 dumpPath = custom_dir;
             }
@@ -321,7 +321,7 @@ namespace FCL
             std::string dumpPath = "/tmp/IntelIGC/";        // default if something goes wrong
             char custom_dir[256];
             FCLReadIGCRegistry("DumpToCustomDir", custom_dir, sizeof(custom_dir));
-            if (custom_dir != nullptr && strlen(custom_dir) > 0)
+            if (strlen(custom_dir) > 0)
             {
                 dumpPath = custom_dir;
             }
diff --git a/visa/CISA.l b/visa/CISA.l
index def21e4b..27532695 100644
--- a/visa/CISA.l
+++ b/visa/CISA.l
@@ -45,7 +45,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #pragma warning(default: 4005)
 #endif
 
-#include "CISA.tab.h"
+#include "CISA.tab.hpp"
 
 #ifdef _DEBUG
 #define TRACE(str) fprintf(yyout, str); ECHO; fprintf(yyout, "\n")
diff --git a/visa/CMakeLists.txt b/visa/CMakeLists.txt
index 11d1bf53..551e4edb 100644
--- a/visa/CMakeLists.txt
+++ b/visa/CMakeLists.txt
@@ -105,8 +105,8 @@ endif()
 # Set up the bison and flex targets. These commands will set up commands to generate the appropriate
 # source files from the input grammars. It will also set up the dependencies correctly for any
 # library or executable that uses the generated source
-BISON_TARGET(CISAParser CISA.y ${CMAKE_CURRENT_BINARY_DIR}/CISA.tab.c COMPILE_FLAGS "-vt -p CISA")
-FLEX_TARGET(CISAScanner CISA.l ${CMAKE_CURRENT_BINARY_DIR}/lex.CISA.c COMPILE_FLAGS "-PCISA ${WIN_FLEX_FLAG}")
+BISON_TARGET(CISAParser CISA.y ${CMAKE_CURRENT_BINARY_DIR}/CISA.tab.cpp COMPILE_FLAGS "-vt -p CISA")
+FLEX_TARGET(CISAScanner CISA.l ${CMAKE_CURRENT_BINARY_DIR}/lex.CISA.cpp COMPILE_FLAGS "-PCISA ${WIN_FLEX_FLAG}")
 ADD_FLEX_BISON_DEPENDENCY(CISAScanner CISAParser)
 
 add_custom_target(CISAScanner_target DEPENDS ${FLEX_CISAScanner_OUTPUTS} ${BISON_CISAParser_OUTPUTS})
@@ -134,7 +134,7 @@ include_directories(${Jitter_inc_dirs})
 
 # Tell cmake to generate code to compile the flex and bison generated source as c++ rather than c
 # (due to the fact that they are .c files rather than .cpp)
-set_source_files_properties( CISA.tab.c lex.CISA.c PROPERTIES LANGUAGE CXX )
+set_source_files_properties( CISA.tab.cpp lex.CISA.cpp PROPERTIES LANGUAGE CXX )
 
   set(LocalScheduler_SOURCES
     LocalScheduler/Dependencies_G4IR.cpp
-- 
2.17.1