llvm.org GIT mirror llvm / 939c687
Make Stacker Runtime -pedantic clean. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31390 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 12 years ago
2 changed file(s) with 10 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
1111 MODULE_NAME = stkr_runtime
1212
1313 include $(LEVEL)/Makefile.common
14
15 CompileCommonOpts := $(filter-out -pedantic,$(CompileCommonOpts))
16 CompileCommonOpts := $(filter-out -Wno-long-long,$(CompileCommonOpts))
None //===-- stacker_rt.c - Runtime Support For Stacker Compiler -----*- C++ -*-===//
0 /*===-- stacker_rt.c - Runtime Support For Stacker Compiler -----*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1414 // The real reason this is here is to test LLVM's ability to link with
1515 // separately compiled software.
1616 //
17 //===----------------------------------------------------------------------===//
17 //===----------------------------------------------------------------------===*/
1818
1919 #include
2020 #include
3939 int
4040 main ( int argc, char** argv )
4141 {
42 // Avoid modifying argc
42 /* Avoid modifying argc */
4343 int a = argc;
4444
45 // Make sure we're starting with the right index
45 /* Make sure we're starting with the right index */
4646 _index_ = 0;
4747
48 // Copy the arguments to the stack in reverse order
49 // so that they get popped in the order presented
48 /* Copy the arguments to the stack in reverse order
49 * so that they get popped in the order presented
50 */
5051 while ( a > 0 )
5152 {
5253 if ( isdigit( (int) argv[--a][0] ) )
5960 }
6061 }
6162
62 // Put the argument count on the stack
63 /* Put the argument count on the stack */
6364 _stack_[_index_] = argc;
6465
65 // Invoke the user's main program
66 /* Invoke the user's main program */
6667 _MAIN_();
6768
68 // Return last item on the stack
69 /* Return last item on the stack */
6970 if ( _index_ >= 0 )
7071 return _stack_[_index_];
7172 return -1;