summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Stmt.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2013-08-22 06:02:26 +0000
committerCraig Topper <craig.topper@gmail.com>2013-08-22 06:02:26 +0000
commitc571c810bf5bff1096705fecb534bd5ff41b3076 (patch)
tree25abd03f998c4bbcb6d7e08f78ea307ac1f911c5 /clang/lib/AST/Stmt.cpp
parent1d76b115a37e55f5bf294e8f6d66732199b83c79 (diff)
downloadbcm5719-llvm-c571c810bf5bff1096705fecb534bd5ff41b3076.tar.gz
bcm5719-llvm-c571c810bf5bff1096705fecb534bd5ff41b3076.zip
Constify some more ASTContext& uses.
llvm-svn: 188989
Diffstat (limited to 'clang/lib/AST/Stmt.cpp')
-rw-r--r--clang/lib/AST/Stmt.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp
index ff9e2721d29..2711e9ba979 100644
--- a/clang/lib/AST/Stmt.cpp
+++ b/clang/lib/AST/Stmt.cpp
@@ -264,7 +264,8 @@ CompoundStmt::CompoundStmt(const ASTContext &C, ArrayRef<Stmt*> Stmts,
std::copy(Stmts.begin(), Stmts.end(), Body);
}
-void CompoundStmt::setStmts(ASTContext &C, Stmt **Stmts, unsigned NumStmts) {
+void CompoundStmt::setStmts(const ASTContext &C, Stmt **Stmts,
+ unsigned NumStmts) {
if (this->Body)
C.Deallocate(Body);
this->CompoundStmtBits.NumStmts = NumStmts;
@@ -295,7 +296,7 @@ AttributedStmt *AttributedStmt::CreateEmpty(const ASTContext &C,
return new (Mem) AttributedStmt(EmptyShell(), NumAttrs);
}
-std::string AsmStmt::generateAsmString(ASTContext &C) const {
+std::string AsmStmt::generateAsmString(const ASTContext &C) const {
if (const GCCAsmStmt *gccAsmStmt = dyn_cast<GCCAsmStmt>(this))
return gccAsmStmt->generateAsmString(C);
if (const MSAsmStmt *msAsmStmt = dyn_cast<MSAsmStmt>(this))
@@ -381,14 +382,14 @@ StringRef GCCAsmStmt::getInputConstraint(unsigned i) const {
return getInputConstraintLiteral(i)->getString();
}
-void GCCAsmStmt::setOutputsAndInputsAndClobbers(ASTContext &C,
- IdentifierInfo **Names,
- StringLiteral **Constraints,
- Stmt **Exprs,
- unsigned NumOutputs,
- unsigned NumInputs,
- StringLiteral **Clobbers,
- unsigned NumClobbers) {
+void GCCAsmStmt::setOutputsAndInputsAndClobbers(const ASTContext &C,
+ IdentifierInfo **Names,
+ StringLiteral **Constraints,
+ Stmt **Exprs,
+ unsigned NumOutputs,
+ unsigned NumInputs,
+ StringLiteral **Clobbers,
+ unsigned NumClobbers) {
this->NumOutputs = NumOutputs;
this->NumInputs = NumInputs;
this->NumClobbers = NumClobbers;
@@ -436,7 +437,7 @@ int GCCAsmStmt::getNamedOperand(StringRef SymbolicName) const {
/// it into pieces. If the asm string is erroneous, emit errors and return
/// true, otherwise return false.
unsigned GCCAsmStmt::AnalyzeAsmString(SmallVectorImpl<AsmStringPiece>&Pieces,
- ASTContext &C, unsigned &DiagOffs) const {
+ const ASTContext &C, unsigned &DiagOffs) const {
StringRef Str = getAsmString()->getString();
const char *StrStart = Str.begin();
const char *StrEnd = Str.end();
@@ -574,7 +575,7 @@ unsigned GCCAsmStmt::AnalyzeAsmString(SmallVectorImpl<AsmStringPiece>&Pieces,
}
/// Assemble final IR asm string (GCC-style).
-std::string GCCAsmStmt::generateAsmString(ASTContext &C) const {
+std::string GCCAsmStmt::generateAsmString(const ASTContext &C) const {
// Analyze the asm string to decompose it into its pieces. We know that Sema
// has already done this, so it is guaranteed to be successful.
SmallVector<GCCAsmStmt::AsmStringPiece, 4> Pieces;
@@ -595,7 +596,7 @@ std::string GCCAsmStmt::generateAsmString(ASTContext &C) const {
}
/// Assemble final IR asm string (MS-style).
-std::string MSAsmStmt::generateAsmString(ASTContext &C) const {
+std::string MSAsmStmt::generateAsmString(const ASTContext &C) const {
// FIXME: This needs to be translated into the IR string representation.
return AsmStr;
}
OpenPOWER on IntegriCloud