Tms320c28x Optimizing C/C++ Compiler V21.6.0.LTS
Total Page:16
File Type:pdf, Size:1020Kb
TMS320C28x Optimizing C/C++ Compiler v21.6.0.LTS User’s Guide Literature Number: SPRU514W AUGUST 2001 – REVISED JUNE 2021 www.ti.com Table of Contents Table of Contents Read This First...........................................................................................................................................................................9 About This Manual................................................................................................................................................................... 9 Notational Conventions.......................................................................................................................................................... 10 Related Documentation..........................................................................................................................................................11 Related Documentation From Texas Instruments.................................................................................................................. 12 Trademarks............................................................................................................................................................................ 12 1 Introduction to the Software Development Tools..............................................................................................................13 1.1 Software Development Tools Overview........................................................................................................................... 14 1.2 Compiler Interface............................................................................................................................................................15 1.3 ANSI/ISO Standard.......................................................................................................................................................... 15 1.4 Output Files......................................................................................................................................................................16 1.5 Utilities..............................................................................................................................................................................16 2 Using the C/C++ Compiler....................................................................................................................................................17 2.1 About the Compiler.......................................................................................................................................................... 18 2.2 Invoking the C/C++ Compiler........................................................................................................................................... 18 2.3 Changing the Compiler's Behavior with Options..............................................................................................................19 2.3.1 Linker Options........................................................................................................................................................... 25 2.3.2 Frequently Used Options...........................................................................................................................................28 2.3.3 Miscellaneous Useful Options................................................................................................................................... 29 2.3.4 Run-Time Model Options...........................................................................................................................................30 2.3.5 Symbolic Debugging and Profiling Options............................................................................................................... 32 2.3.6 Specifying Filenames................................................................................................................................................ 32 2.3.7 Changing How the Compiler Interprets Filenames....................................................................................................33 2.3.8 Changing How the Compiler Processes C Files........................................................................................................33 2.3.9 Changing How the Compiler Interprets and Names Extensions............................................................................... 34 2.3.10 Specifying Directories..............................................................................................................................................34 2.3.11 Assembler Options...................................................................................................................................................35 2.3.12 Deprecated Options.................................................................................................................................................35 2.4 Controlling the Compiler Through Environment Variables............................................................................................... 36 2.4.1 Setting Default Compiler Options (C2000_C_OPTION)............................................................................................36 2.4.2 Naming One or More Alternate Directories (C2000_C_DIR).....................................................................................37 2.5 Controlling the Preprocessor............................................................................................................................................37 2.5.1 Predefined Macro Names..........................................................................................................................................37 2.5.2 The Search Path for #include Files........................................................................................................................... 39 2.5.3 Support for the #warning and #warn Directives.........................................................................................................40 2.5.4 Generating a Preprocessed Listing File (--preproc_only Option).............................................................................. 40 2.5.5 Continuing Compilation After Preprocessing (--preproc_with_compile Option)........................................................ 40 2.5.6 Generating a Preprocessed Listing File with Comments (--preproc_with_comment Option)....................................40 2.5.7 Generating Preprocessed Listing with Line-Control Details (--preproc_with_line Option).........................................41 2.5.8 Generating Preprocessed Output for a Make Utility (--preproc_dependency Option)...............................................41 2.5.9 Generating a List of Files Included with #include (--preproc_includes Option)......................................................... 41 2.5.10 Generating a List of Macros in a File (--preproc_macros Option)........................................................................... 41 2.6 Passing Arguments to main()...........................................................................................................................................41 2.7 Understanding Diagnostic Messages...............................................................................................................................42 2.7.1 Controlling Diagnostic Messages.............................................................................................................................. 43 2.7.2 How You Can Use Diagnostic Suppression Options................................................................................................. 44 2.8 Other Messages...............................................................................................................................................................45 2.9 Generating Cross-Reference Listing Information (--gen_cross_reference Option)..........................................................45 2.10 Generating a Raw Listing File (--gen_preprocessor_listing Option).............................................................................. 45 2.11 Using Inline Function Expansion.................................................................................................................................... 46 SPRU514W – AUGUST 2001 – REVISED JUNE 2021 TMS320C28x Optimizing C/C++ Compiler 3 Submit Document Feedback v21.6.0.LTS Copyright © 2021 Texas Instruments Incorporated Table of Contents www.ti.com 2.11.1 Inlining Intrinsic Operators....................................................................................................................................... 47 2.11.2 Inlining Restrictions..................................................................................................................................................48 2.11.3 Unguarded Definition-Controlled Inlining................................................................................................................. 48 2.11.4 Guarded Inlining and the _INLINE Preprocessor Symbol........................................................................................49 2.12 Using Interlist................................................................................................................................................................. 50 2.13 About the Application Binary Interface..........................................................................................................................