diff options
author | Roman Divacky <rdivacky@freebsd.org> | 2011-02-10 16:52:03 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@freebsd.org> | 2011-02-10 16:52:03 +0000 |
commit | be4c8705e499b55548467eb7adaa23cbc6edfef9 (patch) | |
tree | 180fd2910e4cbbdcd9dca8d8e7d54e347c7a3ccc /include | |
parent | 9186ff310cf0ad92ec7f39b2c9dcb7e848195052 (diff) |
Implement mcount profiling, enabled via -pg.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125282 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Basic/TargetInfo.h | 6 | ||||
-rw-r--r-- | include/clang/Driver/CC1Options.td | 1 | ||||
-rw-r--r-- | include/clang/Frontend/CodeGenOptions.h | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h index 57ddb91b1d..586680bbd0 100644 --- a/include/clang/Basic/TargetInfo.h +++ b/include/clang/Basic/TargetInfo.h @@ -76,6 +76,7 @@ protected: unsigned char LongLongWidth, LongLongAlign; const char *DescriptionString; const char *UserLabelPrefix; + const char *MCountName; const llvm::fltSemantics *FloatFormat, *DoubleFormat, *LongDoubleFormat; unsigned char RegParmMax, SSERegParmMax; TargetCXXABI CXXABI; @@ -243,6 +244,11 @@ public: return UserLabelPrefix; } + /// MCountName - This returns name of the mcount instrumentation function. + const char *getMCountName() const { + return MCountName; + } + bool useBitFieldTypeAlignment() const { return UseBitFieldTypeAlignment; } diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index 3160e96339..fda194bb4a 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -191,6 +191,7 @@ def mms_bitfields : Flag<"-mms-bitfields">, HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard.">; def O : Joined<"-O">, HelpText<"Optimization level">; def Os : Flag<"-Os">, HelpText<"Optimize for size">; +def pg : Flag<"-pg">, HelpText<"Enable mcount instrumentation">; //===----------------------------------------------------------------------===// // Dependency Output Options diff --git a/include/clang/Frontend/CodeGenOptions.h b/include/clang/Frontend/CodeGenOptions.h index 66c9409fe5..ee85b655c2 100644 --- a/include/clang/Frontend/CodeGenOptions.h +++ b/include/clang/Frontend/CodeGenOptions.h @@ -58,6 +58,7 @@ public: /// hidden visibility. unsigned InstrumentFunctions : 1; /// Set when -finstrument-functions is /// enabled. + unsigned InstrumentForProfiling : 1; /// Set when -pg is enabled unsigned LessPreciseFPMAD : 1; /// Enable less precise MAD instructions to be /// generated. unsigned MergeAllConstants : 1; /// Merge identical constants. @@ -131,6 +132,7 @@ public: HiddenWeakTemplateVTables = 0; HiddenWeakVTables = 0; InstrumentFunctions = 0; + InstrumentForProfiling = 0; LessPreciseFPMAD = 0; MergeAllConstants = 1; NoCommon = 0; |