Changeset fd2debf


Ignore:
Timestamp:
Jul 30, 2018, 4:43:48 PM (3 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer
Children:
05e6eb5
Parents:
7f38b67a
git-author:
Rob Schluntz <rschlunt@…> (07/30/18 11:23:08)
git-committer:
Rob Schluntz <rschlunt@…> (07/30/18 16:43:48)
Message:

Add checks for constructor/destructor attribute arguments

Location:
src
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/Common/SemanticError.h

    r7f38b67a rfd2debf  
    5858        {"aggregate-forward-decl" , "forward declaration of nested aggregate: %s"  , Severity::Warn},
    5959        {"superfluous-decl"       , "declaration does not allocate storage: %s"    , Severity::Warn},
     60        {"gcc-attributes"         , "invalid attribute: %s"                        , Severity::Warn},
    6061};
    6162
     
    6667        AggrForwardDecl,
    6768        SuperfluousDecl,
     69        GccAttributes,
    6870        NUMBER_OF_WARNINGS, // This MUST be the last warning
    6971};
  • src/Makefile.am

    r7f38b67a rfd2debf  
    3838include SynTree/module.mk
    3939include Tuples/module.mk
     40include Validate/module.mk
    4041include Virtual/module.mk
    4142
  • src/Makefile.in

    r7f38b67a rfd2debf  
    2323#SRC +=  ArgTweak/Rewriter.cc \
    2424#       ArgTweak/Mutate.cc
     25
     26######################### -*- Mode: Makefile-Gmake -*- ########################
     27###############################################################################
    2528
    2629######################### -*- Mode: Makefile-Gmake -*- ########################
     
    150153am__objects_1 = driver_cfa_cpp-main.$(OBJEXT) \
    151154        driver_cfa_cpp-MakeLibCfa.$(OBJEXT) \
     155        driver_cfa_cpp-CompilationState.$(OBJEXT) \
    152156        CodeGen/driver_cfa_cpp-Generate.$(OBJEXT) \
    153157        CodeGen/driver_cfa_cpp-CodeGenerator.$(OBJEXT) \
     
    254258        Tuples/driver_cfa_cpp-TupleExpansion.$(OBJEXT) \
    255259        Tuples/driver_cfa_cpp-Explode.$(OBJEXT) \
     260        Validate/driver_cfa_cpp-HandleAttributes.$(OBJEXT) \
    256261        Virtual/driver_cfa_cpp-ExpandCasts.$(OBJEXT)
    257262am_driver_cfa_cpp_OBJECTS = $(am__objects_1)
     
    354359        $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk \
    355360        $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk \
    356         $(srcdir)/Tuples/module.mk $(srcdir)/Virtual/module.mk \
    357         $(top_srcdir)/automake/depcomp $(top_srcdir)/automake/ylwrap \
    358         Parser/lex.cc Parser/parser.cc Parser/parser.hh
     361        $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk \
     362        $(srcdir)/Virtual/module.mk $(top_srcdir)/automake/depcomp \
     363        $(top_srcdir)/automake/ylwrap Parser/lex.cc Parser/parser.cc \
     364        Parser/parser.hh
    359365DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    360366ACLOCAL = @ACLOCAL@
     
    481487# create object files in directory with source files
    482488AUTOMAKE_OPTIONS = subdir-objects
    483 SRC = main.cc MakeLibCfa.cc CodeGen/Generate.cc \
     489SRC = main.cc MakeLibCfa.cc CompilationState.cc CodeGen/Generate.cc \
    484490        CodeGen/CodeGenerator.cc CodeGen/GenType.cc \
    485491        CodeGen/FixNames.cc CodeGen/FixMain.cc \
     
    530536        SynTree/Attribute.cc SynTree/DeclReplacer.cc \
    531537        Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \
    532         Tuples/Explode.cc Virtual/ExpandCasts.cc
     538        Tuples/Explode.cc Validate/HandleAttributes.cc \
     539        Virtual/ExpandCasts.cc
    533540MAINTAINERCLEANFILES = Parser/parser.output ${libdir}/${notdir \
    534541        ${cfa_cpplib_PROGRAMS}}
     
    549556.SUFFIXES:
    550557.SUFFIXES: .cc .ll .o .obj .yy
    551 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Virtual/module.mk $(am__configure_deps)
     558$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__configure_deps)
    552559        @for dep in $?; do \
    553560          case '$(am__configure_deps)' in \
     
    569576            cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
    570577        esac;
    571 $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Virtual/module.mk $(am__empty):
     578$(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__empty):
    572579
    573580$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
     
    930937Tuples/driver_cfa_cpp-Explode.$(OBJEXT): Tuples/$(am__dirstamp) \
    931938        Tuples/$(DEPDIR)/$(am__dirstamp)
     939Validate/$(am__dirstamp):
     940        @$(MKDIR_P) Validate
     941        @: > Validate/$(am__dirstamp)
     942Validate/$(DEPDIR)/$(am__dirstamp):
     943        @$(MKDIR_P) Validate/$(DEPDIR)
     944        @: > Validate/$(DEPDIR)/$(am__dirstamp)
     945Validate/driver_cfa_cpp-HandleAttributes.$(OBJEXT):  \
     946        Validate/$(am__dirstamp) Validate/$(DEPDIR)/$(am__dirstamp)
    932947Virtual/$(am__dirstamp):
    933948        @$(MKDIR_P) Virtual
     
    960975        -rm -f SynTree/*.$(OBJEXT)
    961976        -rm -f Tuples/*.$(OBJEXT)
     977        -rm -f Validate/*.$(OBJEXT)
    962978        -rm -f Virtual/*.$(OBJEXT)
    963979
     
    965981        -rm -f *.tab.c
    966982
     983@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driver_cfa_cpp-CompilationState.Po@am__quote@
    967984@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driver_cfa_cpp-MakeLibCfa.Po@am__quote@
    968985@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driver_cfa_cpp-main.Po@am__quote@
     
    10711088@AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Po@am__quote@
    10721089@AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Po@am__quote@
     1090@AMDEP_TRUE@@am__include@ @am__quote@Validate/$(DEPDIR)/driver_cfa_cpp-HandleAttributes.Po@am__quote@
    10731091@AMDEP_TRUE@@am__include@ @am__quote@Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Po@am__quote@
    10741092
     
    11171135@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o driver_cfa_cpp-MakeLibCfa.obj `if test -f 'MakeLibCfa.cc'; then $(CYGPATH_W) 'MakeLibCfa.cc'; else $(CYGPATH_W) '$(srcdir)/MakeLibCfa.cc'; fi`
    11181136
     1137driver_cfa_cpp-CompilationState.o: CompilationState.cc
     1138@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT driver_cfa_cpp-CompilationState.o -MD -MP -MF $(DEPDIR)/driver_cfa_cpp-CompilationState.Tpo -c -o driver_cfa_cpp-CompilationState.o `test -f 'CompilationState.cc' || echo '$(srcdir)/'`CompilationState.cc
     1139@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/driver_cfa_cpp-CompilationState.Tpo $(DEPDIR)/driver_cfa_cpp-CompilationState.Po
     1140@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='CompilationState.cc' object='driver_cfa_cpp-CompilationState.o' libtool=no @AMDEPBACKSLASH@
     1141@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1142@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o driver_cfa_cpp-CompilationState.o `test -f 'CompilationState.cc' || echo '$(srcdir)/'`CompilationState.cc
     1143
     1144driver_cfa_cpp-CompilationState.obj: CompilationState.cc
     1145@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT driver_cfa_cpp-CompilationState.obj -MD -MP -MF $(DEPDIR)/driver_cfa_cpp-CompilationState.Tpo -c -o driver_cfa_cpp-CompilationState.obj `if test -f 'CompilationState.cc'; then $(CYGPATH_W) 'CompilationState.cc'; else $(CYGPATH_W) '$(srcdir)/CompilationState.cc'; fi`
     1146@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/driver_cfa_cpp-CompilationState.Tpo $(DEPDIR)/driver_cfa_cpp-CompilationState.Po
     1147@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='CompilationState.cc' object='driver_cfa_cpp-CompilationState.obj' libtool=no @AMDEPBACKSLASH@
     1148@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1149@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o driver_cfa_cpp-CompilationState.obj `if test -f 'CompilationState.cc'; then $(CYGPATH_W) 'CompilationState.cc'; else $(CYGPATH_W) '$(srcdir)/CompilationState.cc'; fi`
     1150
    11191151CodeGen/driver_cfa_cpp-Generate.o: CodeGen/Generate.cc
    11201152@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-Generate.o -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Tpo -c -o CodeGen/driver_cfa_cpp-Generate.o `test -f 'CodeGen/Generate.cc' || echo '$(srcdir)/'`CodeGen/Generate.cc
     
    25722604@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    25732605@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-Explode.obj `if test -f 'Tuples/Explode.cc'; then $(CYGPATH_W) 'Tuples/Explode.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/Explode.cc'; fi`
     2606
     2607Validate/driver_cfa_cpp-HandleAttributes.o: Validate/HandleAttributes.cc
     2608@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Validate/driver_cfa_cpp-HandleAttributes.o -MD -MP -MF Validate/$(DEPDIR)/driver_cfa_cpp-HandleAttributes.Tpo -c -o Validate/driver_cfa_cpp-HandleAttributes.o `test -f 'Validate/HandleAttributes.cc' || echo '$(srcdir)/'`Validate/HandleAttributes.cc
     2609@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Validate/$(DEPDIR)/driver_cfa_cpp-HandleAttributes.Tpo Validate/$(DEPDIR)/driver_cfa_cpp-HandleAttributes.Po
     2610@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Validate/HandleAttributes.cc' object='Validate/driver_cfa_cpp-HandleAttributes.o' libtool=no @AMDEPBACKSLASH@
     2611@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2612@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Validate/driver_cfa_cpp-HandleAttributes.o `test -f 'Validate/HandleAttributes.cc' || echo '$(srcdir)/'`Validate/HandleAttributes.cc
     2613
     2614Validate/driver_cfa_cpp-HandleAttributes.obj: Validate/HandleAttributes.cc
     2615@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Validate/driver_cfa_cpp-HandleAttributes.obj -MD -MP -MF Validate/$(DEPDIR)/driver_cfa_cpp-HandleAttributes.Tpo -c -o Validate/driver_cfa_cpp-HandleAttributes.obj `if test -f 'Validate/HandleAttributes.cc'; then $(CYGPATH_W) 'Validate/HandleAttributes.cc'; else $(CYGPATH_W) '$(srcdir)/Validate/HandleAttributes.cc'; fi`
     2616@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Validate/$(DEPDIR)/driver_cfa_cpp-HandleAttributes.Tpo Validate/$(DEPDIR)/driver_cfa_cpp-HandleAttributes.Po
     2617@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Validate/HandleAttributes.cc' object='Validate/driver_cfa_cpp-HandleAttributes.obj' libtool=no @AMDEPBACKSLASH@
     2618@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2619@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Validate/driver_cfa_cpp-HandleAttributes.obj `if test -f 'Validate/HandleAttributes.cc'; then $(CYGPATH_W) 'Validate/HandleAttributes.cc'; else $(CYGPATH_W) '$(srcdir)/Validate/HandleAttributes.cc'; fi`
    25742620
    25752621Virtual/driver_cfa_cpp-ExpandCasts.o: Virtual/ExpandCasts.cc
     
    27342780        -rm -f Tuples/$(DEPDIR)/$(am__dirstamp)
    27352781        -rm -f Tuples/$(am__dirstamp)
     2782        -rm -f Validate/$(DEPDIR)/$(am__dirstamp)
     2783        -rm -f Validate/$(am__dirstamp)
    27362784        -rm -f Virtual/$(DEPDIR)/$(am__dirstamp)
    27372785        -rm -f Virtual/$(am__dirstamp)
     
    27512799
    27522800distclean: distclean-am
    2753         -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Virtual/$(DEPDIR)
     2801        -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)
    27542802        -rm -f Makefile
    27552803distclean-am: clean-am distclean-compile distclean-generic \
     
    27972845
    27982846maintainer-clean: maintainer-clean-am
    2799         -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Virtual/$(DEPDIR)
     2847        -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)
    28002848        -rm -f Makefile
    28012849maintainer-clean-am: distclean-am maintainer-clean-generic
  • src/SymTab/Validate.cc

    r7f38b67a rfd2debf  
    7373#include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
    7474#include "SynTree/Visitor.h"           // for Visitor
     75#include "Validate/HandleAttributes.h" // for handleAttributes
    7576
    7677class CompoundStmt;
     
    314315                acceptAll( translationUnit, finder ); // xxx - remove this pass soon
    315316                mutateAll( translationUnit, labelAddrFixer );
     317                Validate::handleAttributes( translationUnit );
    316318        }
    317319
Note: See TracChangeset for help on using the changeset viewer.