diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-03-25 06:23:34 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-03-25 06:23:34 +0000 |
commit | d1baa252c41322d3a38d4360ba1dbcc20c0badf9 (patch) | |
tree | 711a7cb3a81f2b77e31f880ef784382f7cb0c691 /utils/TableGen/Record.h | |
parent | f906cb933e4daa4b77c27941365b79cca1b697e9 (diff) | |
download | external_llvm-d1baa252c41322d3a38d4360ba1dbcc20c0badf9.zip external_llvm-d1baa252c41322d3a38d4360ba1dbcc20c0badf9.tar.gz external_llvm-d1baa252c41322d3a38d4360ba1dbcc20c0badf9.tar.bz2 |
Fix evil TableGen bug in template parameters with defaults.
If a TableGen class has an initializer expression containing an X.Y subexpression,
AND X depends on template parameters,
AND those template parameters have defaults,
AND some parameters with defaults are beyond position 1,
THEN parts of the initializer expression are evaluated prematurely with the default values when the first explicit template parameter is substituted, before the remaining explicit template parameters have been substituted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99492 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/Record.h')
-rw-r--r-- | utils/TableGen/Record.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/utils/TableGen/Record.h b/utils/TableGen/Record.h index 90096e9..55c1a80 100644 --- a/utils/TableGen/Record.h +++ b/utils/TableGen/Record.h @@ -503,7 +503,8 @@ struct Init { /// initializer for the specified field. If getFieldType returns non-null /// this method should return non-null, otherwise it returns null. /// - virtual Init *getFieldInit(Record &R, const std::string &FieldName) const { + virtual Init *getFieldInit(Record &R, const RecordVal *RV, + const std::string &FieldName) const { return 0; } @@ -950,7 +951,8 @@ public: unsigned Elt); virtual RecTy *getFieldType(const std::string &FieldName) const; - virtual Init *getFieldInit(Record &R, const std::string &FieldName) const; + virtual Init *getFieldInit(Record &R, const RecordVal *RV, + const std::string &FieldName) const; /// resolveReferences - This method is used by classes that refer to other /// variables which may not be defined at the time they expression is formed. @@ -1035,7 +1037,8 @@ public: //virtual Init *convertInitializerBitRange(const std::vector<unsigned> &Bits); virtual RecTy *getFieldType(const std::string &FieldName) const; - virtual Init *getFieldInit(Record &R, const std::string &FieldName) const; + virtual Init *getFieldInit(Record &R, const RecordVal *RV, + const std::string &FieldName) const; virtual std::string getAsString() const; |