r272317 - Add a RenderScript language type

Pirama Arumuga Nainar via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 9 14:57:41 PDT 2016


Author: pirama
Date: Thu Jun  9 16:57:40 2016
New Revision: 272317

URL: http://llvm.org/viewvc/llvm-project?rev=272317&view=rev
Log:
Add a RenderScript language type

Summary:
Add RenderScript language type and associate it with ".rs" extensions.
Test that the driver passes "-x renderscript" to the frontend for ".rs"
files.

(Also add '.rs' to the list of suffixes tested by lit).

Reviewers: rsmith

Subscribers: cfe-commits, srhines

Differential Revision: http://reviews.llvm.org/D21199

Added:
    cfe/trunk/test/Driver/renderscript.rs
Modified:
    cfe/trunk/include/clang/Driver/Types.def
    cfe/trunk/lib/Driver/Types.cpp
    cfe/trunk/test/Driver/lit.local.cfg
    cfe/trunk/test/lit.cfg

Modified: cfe/trunk/include/clang/Driver/Types.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Types.def?rev=272317&r1=272316&r2=272317&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Types.def (original)
+++ cfe/trunk/include/clang/Driver/Types.def Thu Jun  9 16:57:40 2016
@@ -53,6 +53,7 @@ TYPE("c++",                      CXX,
 TYPE("objective-c++-cpp-output", PP_ObjCXX,    INVALID,         "mii",   "u")
 TYPE("objc++-cpp-output",        PP_ObjCXX_Alias, INVALID,      "mii",   "u")
 TYPE("objective-c++",            ObjCXX,       PP_ObjCXX,       "mm",    "u")
+TYPE("renderscript",             RenderScript, PP_C,            "rs",    "u")
 
 // C family input files to precompile.
 TYPE("c-header-cpp-output",      PP_CHeader,   INVALID,         "i",     "p")

Modified: cfe/trunk/lib/Driver/Types.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Types.cpp?rev=272317&r1=272316&r2=272317&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Types.cpp (original)
+++ cfe/trunk/lib/Driver/Types.cpp Thu Jun  9 16:57:40 2016
@@ -204,6 +204,7 @@ types::ID types::lookupTypeForExtension(
            .Case("pcm", TY_ModuleFile)
            .Case("pch", TY_PCH)
            .Case("gch", TY_PCH)
+           .Case("rs", TY_RenderScript)
            .Default(TY_INVALID);
 }
 

Modified: cfe/trunk/test/Driver/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/lit.local.cfg?rev=272317&r1=272316&r2=272317&view=diff
==============================================================================
--- cfe/trunk/test/Driver/lit.local.cfg (original)
+++ cfe/trunk/test/Driver/lit.local.cfg Thu Jun  9 16:57:40 2016
@@ -1,5 +1,5 @@
 config.suffixes = ['.c', '.cpp', '.h', '.m', '.mm', '.S', '.s', '.f90', '.f95',
-                   '.cu']
+                   '.cu', '.rs']
 config.substitutions = list(config.substitutions)
 config.substitutions.insert(0,
     ('%clang_cc1',

Added: cfe/trunk/test/Driver/renderscript.rs
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/renderscript.rs?rev=272317&view=auto
==============================================================================
--- cfe/trunk/test/Driver/renderscript.rs (added)
+++ cfe/trunk/test/Driver/renderscript.rs Thu Jun  9 16:57:40 2016
@@ -0,0 +1,3 @@
+// RUN: %clang -### 2>&1 %s | FileCheck %s
+
+// CHECK: "-x" "renderscript"

Modified: cfe/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.cfg?rev=272317&r1=272316&r2=272317&view=diff
==============================================================================
--- cfe/trunk/test/lit.cfg (original)
+++ cfe/trunk/test/lit.cfg Thu Jun  9 16:57:40 2016
@@ -44,7 +44,7 @@ else:
 config.test_format = lit.formats.ShTest(execute_external)
 
 # suffixes: A list of file extensions to treat as test files.
-config.suffixes = ['.c', '.cpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s', '.S', '.modulemap', '.test']
+config.suffixes = ['.c', '.cpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s', '.S', '.modulemap', '.test', '.rs']
 
 # excludes: A list of directories to exclude from the testsuite. The 'Inputs'
 # subdirectories contain auxiliary inputs for various tests in their parent




More information about the cfe-commits mailing list