Commits

Anonymous committed 9bfcf03

Fixes to allow building code on OSX

Comments (0)

Files changed (3)

tools/clang/include/clang/Lex/Preprocessor.h

   LangOptions        Features;
   const TargetInfo  &Target;
   FileManager       &FileMgr;
+public: // ConstByDefault. Hack!
   SourceManager     &SourceMgr;
+private:
   ScratchBuffer     *ScratchBuf;
   HeaderSearch      &HeaderInfo;
 

tools/clang/lib/Driver/Tools.cpp

   // categories.
   if (Args.hasArg(options::OPT_ObjC) || Args.hasArg(options::OPT_ObjCXX))
     CmdArgs.push_back("-ObjC");
-  if (Args.hasArg(options::OPT_ConstByDefault))
-    CmdArgs.push_back("-ConstByDefault");
+  
   CmdArgs.push_back("-o");
   CmdArgs.push_back(Output.getFilename());
 

tools/clang/lib/Parse/ParseDecl.cpp

     unsigned DiagID = 0;
 
     SourceLocation Loc = Tok.getLocation();
-    if (!(DS.getTypeQualifiers() & DeclSpec::TQ_const)) {
-      bool isInvalid = DS.SetTypeQual(DeclSpec::TQ_const, Loc, PrevSpec, DiagID,
+    if (strcmp(PP.SourceMgr.getBufferName(Loc), "<built-in>") != 0) {
+      if (!(DS.getTypeQualifiers() & DeclSpec::TQ_const)) {
+        bool isInvalid = DS.SetTypeQual(DeclSpec::TQ_const, Loc, PrevSpec, DiagID,
         getLang());
+      }
     }
   }
 
     const char *PrevSpec = 0;
     unsigned DiagID = 0; // This is often wrong to force on
     SourceLocation Loc = Tok.getLocation();
+    if (strcmp(PP.SourceMgr.getBufferName(Loc), "<built-in>") != 0)
     bool isInvalid = DS.SetTypeQual(DeclSpec::TQ_const   , Loc, PrevSpec, DiagID,
                                  getLang());
   }