r227336 - Enable pragma comment processing for PS4. Original patch by Yunzhong Gao!
Alex Rosenberg
alexr at leftfield.org
Wed Jan 28 10:26:15 PST 2015
Author: alexr
Date: Wed Jan 28 12:26:15 2015
New Revision: 227336
URL: http://llvm.org/viewvc/llvm-project?rev=227336&view=rev
Log:
Enable pragma comment processing for PS4. Original patch by Yunzhong Gao!
Modified:
cfe/trunk/lib/Parse/ParsePragma.cpp
cfe/trunk/test/CodeGen/pragma-comment.c
Modified: cfe/trunk/lib/Parse/ParsePragma.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParsePragma.cpp?rev=227336&r1=227335&r2=227336&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParsePragma.cpp (original)
+++ cfe/trunk/lib/Parse/ParsePragma.cpp Wed Jan 28 12:26:15 2015
@@ -219,6 +219,9 @@ void Parser::initializePragmaHandlers()
PP.AddPragmaHandler(MSCodeSeg.get());
MSSection.reset(new PragmaMSPragma("section"));
PP.AddPragmaHandler(MSSection.get());
+ } else if (getTargetInfo().getTriple().isPS4()) {
+ MSCommentHandler.reset(new PragmaCommentHandler(Actions));
+ PP.AddPragmaHandler(MSCommentHandler.get());
}
OptimizeHandler.reset(new PragmaOptimizeHandler(Actions));
@@ -282,6 +285,9 @@ void Parser::resetPragmaHandlers() {
MSCodeSeg.reset();
PP.RemovePragmaHandler(MSSection.get());
MSSection.reset();
+ } else if (getTargetInfo().getTriple().isPS4()) {
+ PP.RemovePragmaHandler(MSCommentHandler.get());
+ MSCommentHandler.reset();
}
PP.RemovePragmaHandler("STDC", FPContractHandler.get());
Modified: cfe/trunk/test/CodeGen/pragma-comment.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/pragma-comment.c?rev=227336&r1=227335&r2=227336&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/pragma-comment.c (original)
+++ cfe/trunk/test/CodeGen/pragma-comment.c Wed Jan 28 12:26:15 2015
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 %s -triple i686-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 %s -triple x86_64-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 %s -triple i686-pc-linux -fms-extensions -emit-llvm -o - | FileCheck -check-prefix LINUX %s
+// RUN: %clang_cc1 %s -triple x86_64-scei-ps4 -fms-extensions -emit-llvm -o - | FileCheck -check-prefix PS4 %s
#pragma comment(lib, "msvcrt.lib")
#pragma comment(lib, "kernel32")
@@ -21,3 +22,8 @@
// LINUX: !{!"-lkernel32"}
// LINUX: !{!"-lUSER32.LIB"}
// LINUX: !{!" /bar=2"}
+
+// PS4: !{!"\01msvcrt.lib"}
+// PS4: !{!"\01kernel32"}
+// PS4: !{!"\01USER32.LIB"}
+// PS4: !{!" /bar=2"}
More information about the cfe-commits
mailing list