[llvm-commits] [llvm-gcc-4.2] r40094 - in /llvm-gcc-4.2/trunk/gcc/ada: misc.c opt.ads
Duncan Sands
baldrick at free.fr
Fri Jul 20 05:05:02 PDT 2007
Author: baldrick
Date: Fri Jul 20 07:05:01 2007
New Revision: 40094
URL: http://llvm.org/viewvc/llvm-project?rev=40094&view=rev
Log:
Make the optimization level available to the parts of the
compiler written in Ada (it is a macro rather than a
variable in Apple's tree). It's true that the Ada f-e
uses it in dubious ways, but that's another story.
Modified:
llvm-gcc-4.2/trunk/gcc/ada/misc.c
llvm-gcc-4.2/trunk/gcc/ada/opt.ads
Modified: llvm-gcc-4.2/trunk/gcc/ada/misc.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ada/misc.c?rev=40094&r1=40093&r2=40094&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/ada/misc.c (original)
+++ llvm-gcc-4.2/trunk/gcc/ada/misc.c Fri Jul 20 07:05:01 2007
@@ -224,6 +224,11 @@
extern void adainit (void);
extern void _ada_gnat1drv (void);
+/* LLVM local begin */
+/* Export the optimization level (a macro in Apple's tree) */
+int optimization_level(void);
+/* LLVM local end */
+
/* The parser for the language. For us, we process the GNAT tree. */
static void
@@ -950,3 +955,11 @@
abort ();
}
+
+/* LLVM local begin */
+int
+optimization_level(void)
+{
+ return optimize;
+}
+/* LLVM local end */
Modified: llvm-gcc-4.2/trunk/gcc/ada/opt.ads
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ada/opt.ads?rev=40094&r1=40093&r2=40094&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/ada/opt.ads (original)
+++ llvm-gcc-4.2/trunk/gcc/ada/opt.ads Fri Jul 20 07:05:01 2007
@@ -768,8 +768,10 @@
-- compiler options. This is identical to Operating_Mode except that
-- this is not affected by errors.
- Optimization_Level : Int;
- pragma Import (C, Optimization_Level, "optimize");
+-- LLVM local begin
+ function Optimization_Level return Int;
+ pragma Import (C, Optimization_Level, "optimization_level");
+-- LLVM local end
-- This constant reflects the optimization level (0,1,2 for -O0,-O1,-O2)
Output_File_Name_Present : Boolean := False;
More information about the llvm-commits
mailing list