[cfe-commits] r69550 - in /cfe/trunk: lib/Lex/Pragma.cpp test/Preprocessor/pragma_unknown.c

Chris Lattner sabre at nondot.org
Sun Apr 19 14:20:36 PDT 2009


Author: lattner
Date: Sun Apr 19 16:20:35 2009
New Revision: 69550

URL: http://llvm.org/viewvc/llvm-project?rev=69550&view=rev
Log:
stub out STDC #pragmas.

Modified:
    cfe/trunk/lib/Lex/Pragma.cpp
    cfe/trunk/test/Preprocessor/pragma_unknown.c

Modified: cfe/trunk/lib/Lex/Pragma.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Pragma.cpp?rev=69550&r1=69549&r2=69550&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/Pragma.cpp (original)
+++ cfe/trunk/lib/Lex/Pragma.cpp Sun Apr 19 16:20:35 2009
@@ -509,6 +509,42 @@
     PP.HandlePragmaComment(CommentTok);
   }
 };
+  
+// Pragma STDC implementations.
+  
+/// PragmaSTDC_FP_CONTRACTHandler - "#pragma STDC FP_CONTRACT ...".
+struct PragmaSTDC_FP_CONTRACTHandler : public PragmaHandler {
+  PragmaSTDC_FP_CONTRACTHandler(const IdentifierInfo *ID) : PragmaHandler(ID) {}
+  virtual void HandlePragma(Preprocessor &PP, Token &CommentTok) {
+    //PP.HandlePragmaComment(CommentTok);
+  }
+};
+  
+/// PragmaSTDC_FENV_ACCESSHandler - "#pragma STDC FENV_ACCESS ...".
+struct PragmaSTDC_FENV_ACCESSHandler : public PragmaHandler {
+  PragmaSTDC_FENV_ACCESSHandler(const IdentifierInfo *ID) : PragmaHandler(ID) {}
+  virtual void HandlePragma(Preprocessor &PP, Token &CommentTok) {
+    //PP.HandlePragmaComment(CommentTok);
+  }
+};
+  
+/// PragmaSTDC_CX_LIMITED_RANGEHandler - "#pragma STDC CX_LIMITED_RANGE ...".
+struct PragmaSTDC_CX_LIMITED_RANGEHandler : public PragmaHandler {
+  PragmaSTDC_CX_LIMITED_RANGEHandler(const IdentifierInfo *ID)
+    : PragmaHandler(ID) {}
+  virtual void HandlePragma(Preprocessor &PP, Token &CommentTok) {
+    //PP.HandlePragmaComment(CommentTok);
+  }
+};
+  
+/// PragmaSTDC_UnknownHandler - "#pragma STDC ...".
+struct PragmaSTDC_UnknownHandler : public PragmaHandler {
+  PragmaSTDC_UnknownHandler() : PragmaHandler(0) {}
+  virtual void HandlePragma(Preprocessor &PP, Token &CommentTok) {
+    //PP.HandlePragmaComment(CommentTok);
+  }
+};
+  
 }  // end anonymous namespace
 
 
@@ -523,6 +559,14 @@
   AddPragmaHandler("GCC", new PragmaDependencyHandler(
                                           getIdentifierInfo("dependency")));
   
+  AddPragmaHandler("STDC", new PragmaSTDC_FP_CONTRACTHandler(
+                                             getIdentifierInfo("FP_CONTRACT")));
+  AddPragmaHandler("STDC", new PragmaSTDC_FENV_ACCESSHandler(
+                                             getIdentifierInfo("FENV_ACCESS")));
+  AddPragmaHandler("STDC", new PragmaSTDC_CX_LIMITED_RANGEHandler(
+                                        getIdentifierInfo("CX_LIMITED_RANGE")));
+  AddPragmaHandler("STDC", new PragmaSTDC_UnknownHandler());
+  
   // MS extensions.
   if (Features.Microsoft)
     AddPragmaHandler(0, new PragmaCommentHandler(getIdentifierInfo("comment")));

Modified: cfe/trunk/test/Preprocessor/pragma_unknown.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/pragma_unknown.c?rev=69550&r1=69549&r2=69550&view=diff

==============================================================================
--- cfe/trunk/test/Preprocessor/pragma_unknown.c (original)
+++ cfe/trunk/test/Preprocessor/pragma_unknown.c Sun Apr 19 16:20:35 2009
@@ -5,3 +5,20 @@
 #define bar xX
 #pragma foo bar   // expected-warning {{unknown pragma ignored}}
 
+#pragma STDC FP_CONTRACT ON
+#pragma STDC FP_CONTRACT OFF
+#pragma STDC FP_CONTRACT DEFAULT
+#pragma STDC FP_CONTRACT IN_BETWEEN
+
+#pragma STDC FENV_ACCESS ON
+#pragma STDC FENV_ACCESS OFF
+#pragma STDC FENV_ACCESS DEFAULT
+#pragma STDC FENV_ACCESS IN_BETWEEN
+
+#pragma STDC CX_LIMITED_RANGE ON
+#pragma STDC CX_LIMITED_RANGE OFF
+#pragma STDC CX_LIMITED_RANGE DEFAULT 
+#pragma STDC CX_LIMITED_RANGE IN_BETWEEN
+
+#pragma STDC SO_GREAT
+





More information about the cfe-commits mailing list