[all-commits] [llvm/llvm-project] ee9b49: Tablegen: Remove the error for duplicate include f...

River Riddle via All-commits all-commits at lists.llvm.org
Wed Nov 20 18:25:19 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ee9b49eef04518123ec04372b7b4bfc337c39dc9
      https://github.com/llvm/llvm-project/commit/ee9b49eef04518123ec04372b7b4bfc337c39dc9
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2019-11-20 (Wed, 20 Nov 2019)

  Changed paths:
    M llvm/lib/TableGen/Main.cpp
    M llvm/lib/TableGen/TGLexer.cpp
    M llvm/lib/TableGen/TGLexer.h
    M llvm/lib/TableGen/TGParser.h
    A llvm/test/TableGen/duplicate-include.inc
    A llvm/test/TableGen/duplicate-include.td

  Log Message:
  -----------
  Tablegen: Remove the error for duplicate include files.

This error was originally added a while(7 years) ago when
including multiple files was basically always an error. Tablegen
now has preprocessor support, which allows for building nice
c/c++ style include guards. With the current error being
reported, we unfortunately need to double guard when including
files:

* In user of MyFile.td

 #ifndef MYFILE_TD
 include MyFile.td
 #endif

* In MyFile.td

 #ifndef MYFILE_TD
 #define MYFILE_TD
 ...
 #endif

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




More information about the All-commits mailing list