]> granicus.if.org Git - clang/commitdiff
Revert 178811 until I fix the unit tests.
authorTanya Lattner <tonic@nondot.org>
Thu, 4 Apr 2013 23:45:52 +0000 (23:45 +0000)
committerTanya Lattner <tonic@nondot.org>
Thu, 4 Apr 2013 23:45:52 +0000 (23:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178813 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDecl.cpp
test/SemaOpenCL/event_t.cl
test/SemaOpenCL/storageclass.cl

index fe8233b053ea508499b0723daee7c3f1719d8dce..c4815cd7ea6c55016c52017e5ca30ad72936afd4 100644 (file)
@@ -6205,9 +6205,7 @@ def err_sampler_argument_required : Error<
   "sampler_t variable required - got %0">;
 def err_wrong_sampler_addressspace: Error<
   "sampler type cannot be used with the __local and __global address space qualifiers">;
-def err_opencl_global_invalid_addr_space : Error<
-  "global variables must have a constant address space qualifier">;
-  
+
 // OpenMP support.
 def err_omp_expected_var_arg_suggest : Error<
   "%0 is not a global variable, static local variable or static data member%select{|; did you mean %2?}1">;
index e9116bc91a5bb9850934082ce4600f8c6f6be731..adf3505633bdc8765e9084d04cbd9fa23a7ca8d9 100644 (file)
@@ -5177,16 +5177,6 @@ bool Sema::CheckVariableDeclaration(VarDecl *NewVD,
     return false;
   }
 
-  // OpenCL v1.2 s6.5 - All program scope variables must be declared in the
-  // __constant address space.
-  if (getLangOpts().OpenCL && NewVD->isFileVarDecl()
-      && T.getAddressSpace() != LangAS::opencl_constant
-      && !T->isSamplerT()){
-    Diag(NewVD->getLocation(), diag::err_opencl_global_invalid_addr_space);
-    NewVD->setInvalidDecl();
-    return false;
-  }
-  
   // OpenCL v1.2 s6.8 -- The static qualifier is valid only in program
   // scope.
   if ((getLangOpts().OpenCLVersion >= 120)
index 06197d0c1796e23be795c70ff5017addc69c05f6..57a0981cf130ec0d46ba44f37bd7bd9e30aa6a1a 100644 (file)
@@ -2,7 +2,7 @@
 
 event_t glb_evt; // expected-error {{the event_t type cannot be used to declare a program scope variable}}
 
-constant struct evt_s {
+struct evt_s {
   event_t evt;  // expected-error {{the event_t type cannot be used to declare a structure or union field}}
 } evt_str;
 
index d2678f2010d9e917307d215b9aef79c73d6c21f6..fdfe134621884ddf04af44ea82645688fd01b3c5 100644 (file)
@@ -2,8 +2,6 @@
 
 static constant int A = 0;
 
-int X = 0; // expected-error{{global variables must have a constant address space qualifier}}
-
 // static is not allowed at local scope.
 void kernel foo() {
   static int X = 5; // expected-error{{variables in function scope cannot be declared static}}