summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen/TGLexer.h
diff options
context:
space:
mode:
authorRiver Riddle <riddleriver@gmail.com>2019-11-20 18:21:50 -0800
committerMehdi Amini <aminim@google.com>2019-11-20 18:24:10 -0800
commitee9b49eef04518123ec04372b7b4bfc337c39dc9 (patch)
treee910fd198eb9d0d3f89165a00c88d1558c74d298 /llvm/lib/TableGen/TGLexer.h
parent8e896b19ddd940254c42cfbb11ba541b22177152 (diff)
downloadbcm5719-llvm-ee9b49eef04518123ec04372b7b4bfc337c39dc9.tar.gz
bcm5719-llvm-ee9b49eef04518123ec04372b7b4bfc337c39dc9.zip
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
Diffstat (limited to 'llvm/lib/TableGen/TGLexer.h')
-rw-r--r--llvm/lib/TableGen/TGLexer.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/TableGen/TGLexer.h b/llvm/lib/TableGen/TGLexer.h
index 266a9cd5d97..11a9bd303f5 100644
--- a/llvm/lib/TableGen/TGLexer.h
+++ b/llvm/lib/TableGen/TGLexer.h
@@ -19,8 +19,8 @@
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/SMLoc.h"
#include <cassert>
-#include <map>
#include <memory>
+#include <set>
#include <string>
namespace llvm {
@@ -87,10 +87,11 @@ class TGLexer {
unsigned CurBuffer = 0;
public:
- typedef std::map<std::string, SMLoc> DependenciesMapTy;
+ typedef std::set<std::string> DependenciesSetTy;
+
private:
/// Dependencies - This is the list of all included files.
- DependenciesMapTy Dependencies;
+ DependenciesSetTy Dependencies;
public:
TGLexer(SourceMgr &SrcMgr, ArrayRef<std::string> Macros);
@@ -99,7 +100,7 @@ public:
return CurCode = LexToken(CurPtr == CurBuf.begin());
}
- const DependenciesMapTy &getDependencies() const {
+ const DependenciesSetTy &getDependencies() const {
return Dependencies;
}
OpenPOWER on IntegriCloud